Skip to content

hoojinguyen/nestjs-base

Repository files navigation

Nest Logo

Description

This is a basic project with Nest framework, along with neat source code organization and many pre-configured features and techniques.

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

Getting Started

To start developing the project please check if you have these tools installed on your machine:

Installation

  1. Clone the repo
git clone https://github.com/hoojinguyen/nestjs-base
  1. Move into project
cd nestjs-base
  1. Install project dependencies
yarn
  1. Copy .env.example file as .env and fill it with your environment variables
cp .env.example .env
  1. 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
  1. 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

Todo

  • 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

License

This project is available under the MIT licensed. See LICENSE for more information.

About

This is a basic project with Nest framework, along with neat source code organization and many pre-configured features and techniques.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages