- Project Setup using @nestjs/fastify(Fast and low overhead web framework, with a powerful plugin architecture, inspired by Hapi and Express)
- Logging using @nestjs/commom logger
- Swagger documentation using @nestjs/swagger with Authorization
- Enabled dotenv support on Approot using @nestjs/config
- API Versioning(/api/v1 , api/v2){default: /api/v1}
- Enable RBAC
- Added Docker Support
- Create global custom exception filter to catch global errors
- Use email and otp for user login instead of username and password; use otplib npm package
- Enable User Authentication
- Enabled Social Logins using Passport (JWT/ Local)
- Added Mailing SMTP service for Mailing using Nodemailer with handlebars for email templates
- Added Bull for Queuing purpose (currently using for Queuing Emails)
- Replace Sqlite db with Prisma/Postgres
- Linter (tslint + eslint + prettier)
- Integration Testing / Unit Testing using Jest [With Test DB Environment]
Nest framework TypeScript starter repository.
- PostgreSQL
- Redis
- Nodejs 18 and above
# Package Installation
$ npm install
# Copy the env example as .env file
$ cp .env.example .env
# Add your mailer service detail in .env file
#setup the db migration
$ npx prisma migrate dev --create-only
#Push the db migration
$ npx prisma db push
#Run the seed to setup the DB
$ npx ts-node prisma/seed.ts
# development
$ npm run start
# watch mode (use this)
$ npm run start:dev
# production mode
$ yarn run start:prod
-
Visit the url shown in the terminal >>> http://localhost:3333/api/docs for more details
-
Register the User
- Send otp to the User
- Login
- Use the Access token from Above to access protected route
- Refresh the token