A progressive Node.js framework for building efficient and scalable server-side applications.
Template REST API built using NestJS.
- Authentication using JWTs & UseGuards (Register, Login)
- Email Integration (Registration Confirmation, Forgot Password)
- Scaffold CRUD (User, Widget)
Before you can start the application you have to create an .env
file by running
$ cp template.env .env
Then update all of the variables in your local version of .env
. This file is not committed to Git because it contains private keys you don't want exposed publicly.
This application is dockerized, so to start it just run:
docker-compose up -d
## Run migrations
docker-compose exec api npm run typeorm:migration:run
This application uses TypeORM to interact with the Database. We can automatically generate new migrations based on the state of our entity files by following these instructions:
- First create a new entity, and related resources, using the nest CLI,
npx nest g new resource resourceName
- Update the Entity file based on your ERD
- Compile the application with
npm run build
. We need our Entity fils in JS because TypeORM can't read TypeScript files - Run the generate migration common,
npm run typeorm:migration:generate -- migrationName
# unit tests
$ npm run test
# e2e tests
$ npm run test:e2e
# test coverage
$ npm run test:cov