prime-nestjs
prime-nestjs copied to clipboard
A production-ready NestJS boilerplate using Typescript, Postgres, TypeORM, and Docker.
Production-ready and flexible NestJS Boilerplate with Typescript π, Postgres πΎ, TypeORM π₯· and Docker π³.
Out-of-box Solutions
Built-in Features
- π± NestJS β latest version
- π TypeScript - Type checking
- βοΈ Dotenv - Supports environment variables
- π Authentication - JWT, RSA256
- π¬ Authorization - RBAC, CBAC
- πͺ TypeORM - Database ORM
- πͺ PostgreSQL - Open-Source Relational Database
- π§ Configuration - Single config for all
- π Swagger - API Documentation
- π³ Docker Compose - Container Orchestration
- π Helmet - secure HTTP headers
- π΄ Insomnia - Insomnia config for endpoints
- π ESLint β Pluggable JavaScript linter
- π Prettier - Opinionated Code Formatter
- β¨ Commitlint - Lint your conventional commits
GitHub actions
- π΅οΈββοΈ Code Scanning - Code scanning with CodeQL
- π΅οΈββοΈ Megalinter - analyzes 48 languages, 22 formats, 19 tooling formats, excessive copy-pastes, spelling mistakes and security issues
Quick Setup (Production)
bash ./setup.sh
Installation (Development)
$ npm install
Running the app
# development
$ npm run start
# watch mode
$ npm run start:dev
# production mode
$ npm run start:prod
Test
# unit tests
$ npm run test
# e2e tests
$ npm run test:e2e
# test coverage
$ npm run test:cov
Endpoints
- Install the insomnia app
- Import the
endpoints.json
file - Enjoy
Generate SSL certificates
- Generate an RSA private key, of size 2048, and output it to a file named key.pem:
openssl genrsa -out private_key.pem 2048
# It needs be copied&pasted from terminal manually
awk 'NF {sub(/\r/, ""); printf"%s\\n",$0;}' private_key.pem
- Extract the public key from the key pair, which can be used in a certificate:
openssl rsa -in private_key.pem -outform PEM -pubout -out public_key.pem
# It needs be copied&pasted from terminal manually
awk 'NF {sub(/\r/, ""); printf "%s\\n",$0;}' public_key.pem
π License
This project is licensed under the MIT License - see the LICENSE.md file for more information.
Joey Goksu π |
Made with β₯ by Joey GΓΆksu