A modern, production-ready Express.js API starter kit and scaffolding CLI built with TypeScript, Prisma ORM, and a modular addon system.
This monorepo provides a complete solution for building Express.js APIs with best practices baked in. It includes:
- CLI Tool - Interactive scaffolding for new projects
- Starter Template - Production-ready Express + Prisma backend
- Modular Addons - Optional features (Swagger, Jest, Docker, Email)
- Documentation - Comprehensive guides and examples
Create a new Express.js project with one command:
npx create-express-preset my-apiOr with Bun: (recommended)
bunx create-express-preset my-apiFollow the interactive prompts to configure your project with the features you need.
Click to expand
create-express-preset/
├── packages/
│ └── create-express-preset/ # Published npm CLI package
│ ├── src/ # CLI source code (TypeScript)
│ ├── dist/ # Compiled output
│ └── templates/ # Template files used by CLI
│
├── starter/ # Reference implementation
│ ├── src/
│ │ ├── modules/ # Feature modules (auth, user)
│ │ ├── middleware/ # Express middleware
│ │ ├── routes/ # API routes
│ │ └── config/ # Configuration
│ ├── prisma/ # Database schema & migrations
│ └── test/ # Test suites
│
├── templates/ # CLI templates
│ ├── base/ # Core Express + Prisma setup
│ └── addons/ # Optional feature modules
│ ├── swagger/ # API documentation
│ ├── tests/ # Jest + Supertest
│ ├── docker/ # Docker configuration
│ └── resend/ # Email password reset
│
└── docs/ # Documentation & guides
- Express.js - Fast, minimalist web framework
- TypeScript - Type safety and modern JavaScript features
- Prisma ORM - Type-safe database client for PostgreSQL
- Zod - Runtime validation and type inference
- JWT - Secure authentication with access and refresh tokens
- ESLint & Prettier - Code quality and formatting
- User registration and login
- JWT token generation (access + refresh)
- Password hashing with bcrypt
- Protected route middleware
- Token refresh endpoint
Enhance your project with optional addons:
| Addon | Description |
|---|---|
| Swagger | OpenAPI documentation with interactive UI |
| Jest | Complete testing setup with Supertest |
| Docker | Containerization with multi-stage builds |
| Resend | Email-based password reset flow |
Each addon includes:
- Pre-configured files and dependencies
- Automatic integration with base template
- Documentation and usage examples
- Prisma schema extensions (if needed)
The CLI uses a template merging system:
- Base Template (
templates/base/) - Core Express + Prisma application - Addon Selection - User chooses features during setup
- Smart Merging - Files, dependencies, and configs are merged
- Prisma Integration - Schema models from addons are combined
- Ready to Use - Fully configured project with all dependencies
Each addon contains:
addon-name/
├── files/ # Files to copy into project
├── package.extend.json # Dependencies and scripts to merge
├── addon.config.json # Route and import injections
└── prisma/
└── schema.extend.prisma # Additional Prisma models
- Node.js >= 18.0.0
- npm or yarn or bun
- Git
Clone the repository:
git clone https://github.com/mrap10/create-express-preset.git
cd create-express-presetInstall dependencies:
npm installcd packages/create-express-preset
npm run buildnpm run devnpm run build- Compile TypeScript and copy templatesnpm run dev- Run CLI in development modenpm test- Run test suite
Comprehensive guides available in the /docs directory:
Contributions are welcome and appreciated! Here's how you can help:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes and test thoroughly
- Commit with clear messages (
git commit -m 'Add amazing feature') - Push to your fork (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow the existing code style
- Add tests for new features
- Update documentation as needed
- Keep commits atomic and well-described
npx create-express-preset my-api
# Select: Swagger, Jest, Docker, Password Reset, Gitnpx create-express-preset my-api
# Select: None (base template only)The starter/ directory contains a fully configured reference implementation. Use it to:
- Understand the project structure
- See addon integration examples
- Test new features before adding to templates
- Learn best practices
- MongoDB support
- GraphQL integration
- WebSocket support
- Redis caching addon
- Rate limiting addon
- More authentication strategies (OAuth, etc.)
This project is licensed under the MIT License. See the LICENSE file for details.
You are free to use this in commercial and personal projects.
- Star the repository on GitHub
- Share with other developers
- Report bugs and suggest features via Issues
Built with modern tools and inspired by the Node.js community's best practices.
Built with TypeScript | Maintained by mrap10