The project is an example of a medium-level application developed using NestJS. The project includes the following features:
Project src
structure directories.
src/
├─ app/
│ ├─ _common/
| | ├─ api/
| | ├─ enum/
| | ├─ model/
| | ├─ repository/
| | | ├─ repository.ts
| | ├─ service/
| | | ├─ service.ts
│ ├─ auth/
│ ├─ ...
│ ├─ email/
│ ├─ ...
│ ├─ user/
| | ├─ dto
| | ├─ enum
| | ├─ test
| | ├─ user.controller.ts
| | ├─ user.model.ts
| | ├─ user.module.ts
| | ├─ user.repository.ts
| | ├─ user.service.ts
│ ├─ app.module.ts
├─ core/
│ ├─ decorators/
| | ├─ authenticated-user.decorator.ts
| | ├─ public.decorator.ts
| | ├─ user-type.decorator.ts
│ ├─ environment/
| | ├─ config.ts
│ ├─ filters/
| | ├─ all-exception.filter.ts
| | ├─ http.exception.ts
│ ├─ guards/
| | ├─ jwt-auth.guard.ts
| | ├─ user-type.guard.ts
│ ├─ middlewares/
| | ├─ logger.middleware.ts
│ ├─ pipes/
| | ├─ validation.pipe.ts
│ ├─ strategy/
| | ├─ jwt.strategy.ts
│ ├─ tools/
│ ├─ crypto.util.ts
│ ├─ app.module.ts
├─ mail.ts
└─
Install project dependencies using the following command.
npm install
Then, create an example .env file and add the necessary environmental variables before running the project.
cp example.env .env
Start the project with the following command
npm run start
Use the following command to test the project.
npm run test
After successfully starting the project, you can access the API at http://localhost:3000.
Learn more about logging using Nest-Winston.
Request data validation using Class-Validator.
Explore authentication and authorization using JWT (JSON Web Token).
Get detailed information about API documentation using Swagger.
Understand the concept of middleware using Middleware.
Learn about exception filters using Exception Filters.
Understand the concept of pipes using Pipes.
Explore the concept of guards using Guards.
Learn about interceptors using Interceptors.
Discover custom decorators using Custom Decorators.