k220j / nest-default

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

prime-nestjs

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

  1. Install the insomnia app
  2. Import the endpoints.json file
  3. Enjoy

Generate SSL certificates

  1. 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
  1. 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

About

License:MIT License


Languages

Language:TypeScript 74.3%Language:Shell 12.7%Language:JavaScript 11.7%Language:Dockerfile 1.3%