DEV Community

Nabin Kandel
Nabin Kandel

Posted on

A Quick Setup for NestJS 11 + Prisma 7 + PostgreSQL backend in seconds.

πŸš€ Create Quick Nest

A Quick Setup for NestJS 11 + Prisma 7 + PostgreSQL backend in seconds.

The fastest way to start a NestJS + Prisma database project. Skip boilerplate, skip setup start building real features in minutes.

Create your project instantly:

bunx quick-nest my-app
# or
npx  quick-nest my-app
Enter fullscreen mode Exit fullscreen mode

npm/bun pacakge :https://www.npmjs.com/package/quick-nest
Your NestJS + Prisma database is ready to go.


✨ Features

  • πŸ—οΈ NestJS 11 β€” Modern, opinionated Node.js framework
  • πŸ—„οΈ Prisma ORM v7 β€” Type-safe PostgreSQL ORM with auto-migrations
  • 🐘 PostgreSQL Database β€” Robust relational database included
  • πŸ” JWT Authentication β€” Register, login, and protected routes
  • πŸ“ Todo CRUD Example β€” Real-world patterns you can learn from
  • ⚑ Bun Runtime β€” Fast, modern JavaScript runtime
  • 🧩 Feature-Based Architecture β€” Scalable folder structure
  • πŸ“¦ Zero Configuration Database Setup β€” Migrations run automatically
  • 🧬 Prisma Client Auto-Generation β€” Type-safe database queries out of the box
  • ☁️ Production Ready β€” Deploy to Vercel, Railway, Render, or Docker
  • 🎯 Minimal Stack β€” No unnecessary abstractions or bloat

πŸ“¦ Generated Stack

Technology Version
NestJS 11.x
Prisma ORM 7.x
PostgreSQL 15+
TypeScript 6.x
Bun 1.2+
JWT 11.x
Passport 0.7+
bcrypt 6.x

⚑ Quick Setup: Database to Development

Get your NestJS + Prisma database running in 5 minutes.

1️⃣ Create Project

npm create quick-nest my-app
cd my-app
Enter fullscreen mode Exit fullscreen mode

2️⃣ Configure Database

cp .env.example .env
Enter fullscreen mode Exit fullscreen mode

Edit .env with your PostgreSQL credentials:

DATABASE_URL="postgresql://user:password@localhost:5432/quick_nest"
JWT_SECRET="your-super-secret-key-here"
Enter fullscreen mode Exit fullscreen mode

3️⃣ Generate Prisma Client & Run Migrations

bunx prisma migrate dev --name init
Enter fullscreen mode Exit fullscreen mode

This command:

  • Generates the Prisma client
  • Creates your PostgreSQL database schema
  • Seeds initial tables (User, Todo)

4️⃣ Start Development Server

bun run start:dev
Enter fullscreen mode Exit fullscreen mode

βœ… Done. Your API is live at http://localhost:3000


πŸ—„οΈ What Happens Behind the Scenes

  • Prisma v7 connects to your PostgreSQL database
  • User & Todo tables are created automatically
  • Prisma Studio opens (optional) for data exploration
  • TypeScript types are generated for all database models

πŸ—„οΈ Prisma v7 & Database

Included Database Features

  • Prisma ORM v7 β€” Latest version with performance improvements
  • PostgreSQL β€” Production-grade relational database
  • Type-Safe Queries β€” Full TypeScript support for all database operations
  • Auto-Generated Types β€” Database models auto-converted to TypeScript interfaces
  • Migrations β€” Version-controlled database schema changes
  • Prisma Studio β€” Visual database explorer (bunx prisma studio)

Common Database Commands

# Generate Prisma client (auto-run after migrations)
bunx prisma generate

# Create & run migrations
bunx prisma migrate dev --name add_feature

# View database with Prisma Studio
bunx prisma studio

# Reset database (development only)
bunx prisma migrate reset
Enter fullscreen mode Exit fullscreen mode

πŸ“ Project Structure

src/
β”œβ”€β”€ common/
β”‚   β”œβ”€β”€ decorators/        # Custom decorators
β”‚   └── guards/            # Auth guards, etc.
β”œβ”€β”€ core/
β”‚   └── prisma/            # Prisma service singleton
β”œβ”€β”€ modules/
β”‚   β”œβ”€β”€ auth/              # Register, login, JWT
β”‚   └── todo/              # CRUD example
β”œβ”€β”€ app.module.ts
└── main.ts

prisma/
β”œβ”€β”€ schema.prisma          # Database schema
└── migrations/            # Migration history
Enter fullscreen mode Exit fullscreen mode

πŸ” Included Features

Authentication

  • User Registration with validation
  • User Login with JWT tokens
  • Password hashing (bcrypt)
  • Protected route guards
  • Access token generation

Database

  • Prisma ORM v7 with PostgreSQL
  • Type-safe queries
  • Automatic migrations
  • Prisma Studio for data exploration

Todo Module (Example)

  • Create, read, update, delete todos
  • User ownership & isolation
  • Input validation
  • Clean service layer

πŸ“‘ API Endpoints

Method Route Description
POST /auth/register Create new user
POST /auth/login Login & receive token
GET /todos List user's todos
GET /todos/:id Get single todo
POST /todos Create todo
PATCH /todos/:id Update todo
DELETE /todos/:id Delete todo

☁️ Deployment

Optimized for:

  • Vercel β€” Recommended for serverless
  • Railway β€” Simple, Git-connected
  • Render β€” Free tier available
  • Fly.io β€” Global deployment
  • Docker β€” Containerized deployments
  • Traditional VPS β€” Full control

πŸ“‹ System Requirements

Tool Version
Node.js 22+
Bun 1.2+
PostgreSQL 15+

🎯 Perfect For

  • Learning NestJS + Prisma + PostgreSQL β€” All three together
  • Building NestJS databases quickly β€” Zero config database setup
  • Prisma ORM projects β€” v7 best practices built in
  • Backend API development β€” With a real database layer
  • MVP & startup projects β€” From idea to API in minutes
  • Portfolio projects β€” Show employers production-ready code
  • Internship preparation β€” Learn modern NestJS patterns
  • Freelance projects β€” Get to feature development faster
  • SaaS backends β€” Scalable from day one
  • Hackathons β€” Get your database layer done first

πŸ›  Local Development

Clone & Setup

git clone https://github.com/nabinkdl/quick-nest.git
cd quick-nest
bun install
Enter fullscreen mode Exit fullscreen mode

Run Locally

bun run start my-app
Enter fullscreen mode Exit fullscreen mode

Force Overwrite

bun run start my-app --force
Enter fullscreen mode Exit fullscreen mode

🌱 Extensible Foundation

The starter intentionally stays minimalβ€”perfect for learning and quick MVPs. As your app grows, easily add:

  • πŸ”΄ Redis caching
  • 🐳 Docker & Docker Compose
  • 🚦 Rate limiting & throttling
  • πŸ“Š Logging & monitoring
  • πŸ“¨ Email services
  • πŸ“ File uploads & storage
  • πŸ”„ Background jobs & queues
  • 🌐 WebSockets & real-time features
  • πŸ”‘ OAuth (Google, GitHub, Discord)
  • πŸ›‘οΈ RBAC authorization
  • πŸ“š Swagger API docs
  • πŸ§ͺ Automated testing (Jest)
  • πŸ“ˆ Metrics & observability
  • 🏒 Multi-tenancy

πŸ“¦ Package

Available on npm:

npx  quick-nest my-app
Enter fullscreen mode Exit fullscreen mode

Package name: quick-nest


πŸ“ License

MIT

Top comments (0)