This is a skeleton API so we can start new projects. Quickly focus only on implementing business rules
This project uses NestJS.
So it is recommended that you know a little about this framework
To run this project in dev mode you need to follow these steps
npm installation
npm run start:dev
npm run tests
- SWC (fast compiler)
- Fastify
- CORS and Helmet
- Vitest
- Docker Configuration
- Prettier and eslint rules
- Validations
- Exception Handler
- Base recorder (Winston)
- API versioning
- Debug mode in VSCode
- All routes are protected by default
- Health Check with terminus
- Using Passport
- Role validation (Role decorator) // like @Roles(ApplicationRole.ADMIN) in controller
- Github Actions Pipeline for validate tests
The project code is all inside src folder and we have three principal folders config, modules, shared
Here we have config files, like a swagger or a typeorm configs the base structure is like
/config
/env
index.ts
/typeorm
/migrations
datasource.ts
Here we have our bussines logic and unit tests modules are contexts of or module and every module have the same structure like
/modules
/contexts
/create
/dtos
request.dto.ts
response.dto.ts
/tests
create.spec.ts
create.controller.ts
create.service.ts
moduleName.module.ts
We have the common logic of application and shared things like entities and repositories who we can use in any module and de structure is like
/shared
/constants
apiTags.ts
index.ts
/decoratos
public.decorator.ts
roles.decorator.ts
index.ts
/dtos
error.dto.ts
index.ts