Express-Prisma Boilerplate

A robust Node.js Express starter kit built with TypeScript, Prisma ORM, and MongoDB.
Express, Prisma, MongoDB stack

Overview

This boilerplate provides a production-ready foundation for building RESTful APIs with modern technologies. It includes authentication, validation, error handling, and file uploading capabilities out of the box.

Features

  • Express Framework: Fast, unopinionated, minimalist web framework for Node.js
  • TypeScript: Static typing for better developer experience and code quality
  • MongoDB: Flexible NoSQL database integration
  • Prisma ORM: Next-generation ORM for Node.js and TypeScript
  • RESTful API Structure: Well-organized API architecture
  • Authentication: JWT-based authentication with cookie support
    • Registration
    • Login
    • Password reset
    • New password creation
  • Email Integration: Using Resend for transactional emails
  • Security: Password hashing with bcrypt
  • Validation: Request validation using Zod
  • Error Handling: Comprehensive error handling system
  • File Uploads: Cloudinary integration for file storage

Getting Started

  1. Clone the repository
git clone https://github.com/KunNew/express-prisma.git
cd express-prisma
  1. Install dependencies
npm install
  1. Configure environment variables
DATABASE_URL=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret
RESEND_API_KEY=your_resend_api_key
CLOUDINARY_CLOUD_NAME=your_cloudinary_cloud_name
CLOUDINARY_API_KEY=your_cloudinary_api_key
CLOUDINARY_API_SECRET=your_cloudinary_api_secret
  1. Run database migrations
npx prisma generate
npx prisma db push
  1. Start the development server
npm run dev

Project Structure

express-prisma/
├── prisma/           # Prisma schema and migrations
├── src/
│   ├── controllers/  # Request handlers
│   ├── middleware/   # Express middleware
│   ├── models/       # Data models
│   ├── routes/       # API routes
│   ├── services/     # Business logic
│   ├── utils/        # Utility functions
│   └── index.ts      # App entry point
└── ...

Contributing

Contributions are welcome! If you find this project useful, please consider giving it a GitHub star ⭐.

License

This project is open source and available under the MIT License.

Copyright © 2025