Repository navigation
🚀 v1.0.0 - Fastify Prisma Starter Template
A comprehensive, production-ready Node.js backend starter template built with Fastify, PostgreSQL, Prisma ORM, TypeScript, and modern development practices.
✨ What's New
🎯 Core Features
- Fastify Framework: High-performance web framework with plugin architecture
- Prisma ORM: Type-safe database access with PostgreSQL
- JWT Authentication: Complete authentication system with refresh tokens
- File Upload: Cloudinary integration for media management
- Email Service: Nodemailer integration for email functionality
- Health Monitoring: Comprehensive health check endpoint with database status
- Graceful Shutdown: Proper server shutdown with database cleanup
🛠️ Module Generation Scripts
- Create Module: Generate complete module structure with one command
npm run create-module- Rename Module: Rename modules and update all references automatically
npm run rename-module
📦 Generated Module Structure
- Rename Module: Rename modules and update all references automatically
Each module includes:
- Routes (Fastify plugin-based)
- Controllers (FastifyRequest/FastifyReply)
- Services (Prisma integration)
- Interfaces (TypeScript types)
- Validation (Zod schemas)
- Constants (Module constants)
🔐 Security Features
- Helmet for security headers
- CORS configuration
- Rate limiting support
- Input validation with Zod
- JWT-based authentication
- Role-based access control
📊 Health Check Endpoint
- Server status monitoring
- Database connection status
- Memory usage tracking
- Response time metrics
- Uptime information
🐳 Docker Support
- Complete Docker setup
- Docker Compose configuration
- Production-ready Dockerfile
- Health check integration
📚 Documentation
Comprehensive documentation included:
- Quick Start Guide: Get started in 5 minutes
- API Documentation: Complete API reference
- Project Structure: Detailed project organization
- Deployment Guide: Production deployment instructions
- Troubleshooting: Common issues and solutions
- Contributing Guide: How to contribute
🚀 Quick Start
sh
Clone the repository
git clone https://github.com/ibnabdullah1/nodejs-fastify-prisma-starter.git
cd nodejs-fastify-prisma-starter
Install dependencies
npm install
Setup environment
cp env.example .env
Edit .env with your configuration
Generate Prisma client
npm run db:generate
Run migrations
npm run migrate
Start development server
npm run dev## 📋 Prerequisites
- Node.js (v16 or higher)
- PostgreSQL database
- npm or yarn
🛠️ Available Scripts
Development
npm run dev- Start development servernpm run build- Build for productionnpm run start- Start production server
Database
npm run migrate- Run database migrationsnpm run db:studio- Open Prisma Studionpm run db:generate- Generate Prisma client
Module Management
npm run create-module <name>- Create new modulenpm run rename-module <old> <new>- Rename module
Code Quality
npm run lint- Run ESLintnpm run format- Format code with Prettiernpm run type-check- TypeScript type checking
🎯 Key Features
- ✅ Fastify framework (high performance)
- ✅ TypeScript (type safety)
- ✅ Prisma ORM (type-safe database)
- ✅ JWT authentication
- ✅ File upload (Cloudinary)
- ✅ Email service (Nodemailer)
- ✅ Health monitoring
- ✅ Graceful shutdown
- ✅ Module generation scripts
- ✅ Comprehensive documentation
- ✅ Docker support
- ✅ ESLint & Prettier
- ✅ Testing setup (Jest)
📦 Tech Stack
- Runtime: Node.js
- Framework: Fastify
- Language: TypeScript
- Database: PostgreSQL
- ORM: Prisma
- Authentication: JWT
- File Storage: Cloudinary
- Email: Nodemailer
- Validation: Zod
- Testing: Jest
🔗 Links
- Repository: https://github.com/ibnabdullah1/nodejs-fastify-prisma-starter
- Documentation: See
DOCS/directory - Issues: https://github.com/ibnabdullah1/nodejs-fastify-prisma-starter/issues
🙏 Acknowledgments
- Fastify - Web framework
- Prisma - Database ORM
- TypeScript - Type safety
- PostgreSQL - Database
📄 License
MIT License - see LICENSE file for details
Happy Coding! 🎉