This is a basic project with Nest framework, along with neat source code organization and many pre-configured features and techniques.
- Authentication (passport JWT)
- Authorization (ACL)
- Security
- Emailing Queue (bull)
- API Document (swagger)
- File uploads. Support local and Amazon S3 drivers
- Server static
- Schedule with cronjobs
- Check health
- Caching (redis)
- Cache manager (redis-commander)
- Logging (winston)
- CRUD
- Pagination (nestjs-paginate)
- Request Validation
- Config Service
- TypeORM
- Migration and seeding
- E2E and units tests
- CI/CD
To start developing the project please check if you have these tools installed on your machine:
- Clone the repo
git clone https://github.com/hoojinguyen/nestjs-base
- Move into project
cd nestjs-base
- Install project dependencies
yarn
- Copy .env.example file as .env and fill it with your environment variables
cp .env.example .env
- Running with docker
- Start development environment:
docker-compose -f docker-compose.dev.yml up -d
# or run script
# sh run.sh up-dev
- Start development environment with debugger on vscode:
docker-compose -f docker-compose.debug.yml up -d
# or run script
# sh run.sh up-debug
- You can access to API by URL: http://localhost:3001/api in browser
- You can access to redis commander by URL: http://localhost:8081 in browser
- Stopping
docker-compose -f docker-compose.dev.yml up -d # dev env
docker-compose -f docker-compose.debug.yml up -d # debug env
# or run script
# sh run.sh down-dev || sh run.sh down-debug
- Write API document with Swagger
- Write units tests for every module
- Switch the way authorization from ACL to RBAC
- Switch Message queues from bull to RabbitMQ or Kafka
- Create migration and seeding
- Multiple databases
- CI/CD
- Deployment to product
This project is available under the MIT licensed. See LICENSE
for more information.