This repository serves as a robust starting point for building secure and scalable applications using the NestJS framework. It is designed with modern development practices and features a suite of tools and patterns to enhance productivity, security, and maintainability.
- Database
- Typeorm (@nestjs/typeorm)
- Config Service
- Authentication
- JWT (@nestjs/jwt)
- Bcrypt
- Authorization
- Role-Based Access Control (RBAC)
- Claim-Based Authorization
- Documentation
- Swagger (@nestjs/swagger)
- Scalar (@scalar/nestjs-api-reference)
- Message Broker
- Kafka
- Cache
- Redis
- Docker
Follow the steps below to set up and run the codebase on your local machine.
- Node.js (v16.x or later)
- npm or yarn for dependency management
- Docker (optional, for running the application in a containerized environment)
- Clone the repository:
git clone https://github.com/wildandhya/nestjs-boilerplate.git
cd nestjs-boilerplate
- Install dependencies:
npm install
- Set up the environment variables by creating a .env file:
cp .env.example .env
- Start the application in development mode:
npm run start:dev
-
Access the API documentation at http://localhost:3000/docs
-
To build for production:
npm run build
npm run start:prod