Awesome Open Source
Awesome Open Source

Logo

NestJS API Boilerplate

Nestjs API Boilerplate: Typescript, Postgresql, TypeORM, Swagger for Api documentation, Passport-JWT authentication, Jest, Env configuration, Migrations, Seeds, Docker, most popular node js libraries, and best application architecture.

This is an a personal effort made with love to setup this architecture and dev environment for new node projects using NestJS.

Getting started (development envioroment) 👍👍👍

# 1. Clone the repository or click on "Use this template" button.
git clone https://github.com/MidoAhmed/nestjs-api-boilerplate nestjs-api-boilerplate

# 2. Enter your newly-cloned folder.
cd nestjs-api-boilerplate

# 3. Install dependencies.
npm i

# 4. fill in default.yml.example and development.yml.example files and rename it to default.yml and development.yml

# 5. Run docker containers
npm run docker:up
# you can verify your DB by opening http://localhost:8080 (Adminer)

# 6. Run development server 
npm run start:dev 
# access swagger api doc by opening http://localhost:3000/docs
🥳🥳🥳

# 7. Read the documentation linked below for "Setup and development" (Sorry ! it is not yet available).

Deploy (production envioroment) 👍👍👍

# 1. fill in .env.example file and rename it to .env 

# 2. Enter your project folder.
cd nestjs-api-boilerplate

# 2. Install dependencies.
sh scripts/deploy.prod.sh 

# 3. Enjoy it 🥳🥳🥳  you have your api up ! 😌

# NB : 🤔 to shut down production 
sh scripts/down.prod.sh

Features

Quick scaffolding
Create modules, services, controller - right from the CLI!
Developer friendly
Enjoy the best Developer eXperience.
JWT Authentication
Installed and configured JWT authentication.
Next generation Typescript
Always up to date typescript version.
best application architecture
Empowered with best practices facilitating the development of scalable server-side applications
Environment Configuration
development, staging and production environment configurations
Swagger Api Documentation
Already integrated API documentation. To see all available endpoints visit http://localhost:3000/docs
Seeding Database
Awesome way to seed test data into your database using typeorm-seeding
Migrations
Already provided and configured npm script commands to run our migration process, see 'migrations.doc.txt'
Caching
high performance data access using Redis store
Documentation
Already setup Compodoc
Production grade logging system
Setup an external logger for production grade logging system - winston
AWS S3
AWS SDK used for S3, tested with MinIO Server
Linter
tslint + eslint + prettier = ❤️

WIP/Comming Features

TypeScript source code Documentation
Use a documentation generator for TypeScript projects such as or other alternative - https://typedoc.org/

Documentation [Sorry ! it is not yet available]

This project includes a docs folder with more details on:

  1. Setup and development
  2. Architecture
Alternatives To Nestjs Api Boilerplate
Select To Compare


Alternative Project Comparisons
Related Awesome Lists
Top Programming Languages
Top Projects

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
Typescript (239,577
Docker (97,002
Redis (23,809
Postgres (23,180
Logging (15,816
Migration (9,932
Jwt (9,740
Jest (8,550
Docker Compose (8,230
Swagger (7,951
Nestjs (4,410
Passport (4,208
Aws S3 (1,283
Typeorm (874
Database Migrations (690
Redis Cache (311
Winston Logger (35
Compodoc (21
Passport Jwt Authentication (3
Typeorm Seeding (3