Skip to content

anamul94/nest-boilerplate

Repository files navigation

Nest Logo

NestJS Starter Template with Postgres DB

A feature-rich NestJS starter template with PostgreSQL integration, authentication, and more.

CircleCI Backers on Open Collective Sponsors on Open Collective

📋 Description

This repository is a Nest framework TypeScript starter template with enhanced features and integrations.

✨ Features

  • 👤 User Management
    • SignUp (with optional Role)
    • SignIn
    • User Update
  • 🔐 Authentication & Authorization
    • JWT Authentication
    • Role-based Access Control
    • Google OAuth
    • Facebook OAuth
  • 🔑 Password Management
    • Reset Password
    • Forgot Password
  • 📨 Email Integration
  • 📚 API Documentation
    • Swagger UI
  • 🔄 Data Handling
    • Pagination
    • Automatic User Metadata Injection
  • 🛠 Developer Tools
    • Docker Compose integration
    • Database Migrations

🚀 Installation

$ npm install

🏃‍♂️ Running the app

First, create roles in the database manually. Then:

# Prepare .env
$ cp .env-example .env
# Set values according to your config

# Development
$ npm run start

# Watch mode
$ npm run start:dev

# Production mode
$ npm run start:prod

🗄️ Database Migrations

# Generate migration
$ npm run migration:generate db/migrations/<name_of_migration>

# Run migration
$ npm run migration:run

# Revert migration
$ npm run migration:revert

🐳 Docker Compose Commands

We've included several make commands to simplify Docker Compose operations:

# Build Docker images
$ make build

# Start the application and related services in detached mode
$ make start

# Stop the application and related services
$ make stop

# View logs of all services
$ make logs

📚 API Documentation

Access Swagger UI at:

http://<your-domain>:<port>/api

Example: http://localhost:8080/api

👤 Author

🤝 Stay in touch

📄 License

This project is MIT licensed.