Nest (NestJS) is a framework for building efficient, scalable Node.js server-side applications.
This project helps you:
- Understand Nest's code flow and concepts: controllers, providers, modules, etc,...
- Base authentication is ready, using JWT token.
- Available modules for reusing or referencing: auth, users, mail.
- Common classes for: entity DTO, pagination.
- ORM sets up for MySQL, includes DB migration.
- Snowflake ID is available.
- Swagger is integrated.
- Can develop your project easily and quickly.
See more: https://docs.nestjs.com/
- NestJS
- Typescript
- Class transformer, Class validator
- TypeORM
- MySQL, DB migration
- Passport Jwt
- Snowflake ID
- Eslint, Prettier
- Jest
- Docker
.env file:
#== ENVIRONMENT
NODE_ENV=<production or development>
#== APP
PORT=<port to run the app>
DOMAIN=<domain of the app>
#== JWT Auth
JWT_KEY=<paste a key for JWT_KEY>
JWT_ACCESS_EXPIRATION_TIME=3600
JWT_REFRESH_EXPIRATION_TIME=86400
#== DB
MYSQL_HOST=localhost
MYSQL_PORT=3306
MYSQL_DB=<database name>
# If you use Docker, please also edit database name at the file docker/mysql/docker-entrypoint-initdb.d/createdb.sql
MYSQL_USERNAME=root
MYSQL_PASSWORD=<paste password here>
# Mail
MAIL_HOST=smtp.example.com
[email protected]
MAIL_PASSWORD=
[email protected]
For development (Node 16, Yarn):
$ yarn
$ yarn dev
For running on live servers:
$ docker-compose up -d
# Then please config Nginx
# Run migrations
$ yarn migrate
# Create migration
$ yarn migration:create src/database/migrations/<name-of-migration>
# Revert migration
$ yarn migration:revert
Reference: https://github.com/NarHakobyan/awesome-nest-boilerplate