A NestJS project template for building scalable and production-ready REST APIs using NestJS, a progressive Node.js framework. NestJS Boilerplate includes many features and libraries, such as:
- Docker support using Docker Compose
- MongoDB integration using @nestjs/mongoose and Mongoose
- Open API documentation using swagger
- Validation using class-validator
- A Basic clean folder structure with CRUD operation to get started.
- Testing using Jest and Supertest
- Authentication and authorization using Passport and JWT
To run this project, you need to have Node.js, npm, and Docker installed on your machine.
Clone this repository and install the dependencies:
git clone https://github.com/ITZSHOAIB/nestjs-boilerplate.git
cd nestjs-boilerplate
npm installCopy the default.env file and rename it to .env. Fill in the required environment variables, such as the database URL, and ports.
To run the app in development mode, use:
npm run start:devTo run the app in production mode, use:
npm run start:prodTo run the app in a Docker container, use:
docker-compose upThe app will be available at http://localhost:${PORT}.
To run the unit tests, use:
npm run testTo run the end-to-end tests, use:
npm run test:e2eThe app uses Swagger to document the API endpoints. You can access the Swagger UI at http://localhost:${PORT}/api.
We welcome contributions from the community.
This project is licensed under the MIT License.
