π I Built exp-gen β An Interactive Express.js API Generator
After spending a lot of time creating the same Express.js project structure over and over again, I decided to automate the entire process.
Introducing exp-gen π
A fast, interactive CLI that scaffolds production-ready Express.js APIs in seconds.
π₯ Demo
β¨ Features
β
Interactive CLI powered by @clack/prompts
β Supports both TypeScript and JavaScript
β Database selection during project creation
- MongoDB (Mongoose)
- MySQL
- SQLite
- PostgreSQL (JavaScript)
- Prisma support coming soon
β
Generates a clean Layered Architecture
configs/
controllers/
dtos/
interfaces/
middlewares/
models/
repositories/
routes/
services/
utils/
β Optional automatic dependency installation
No more manually creating folders or copying boilerplate.
π¦ Installation
npm install -g @madhusha_99/exp-gen
Run it anywhere:
exp
# or
gen
# or
express-draft
π₯ Example
The CLI will ask you:
β Project Name
β TypeScript or JavaScript?
β Select Database
β Install dependencies?
β¦and generates everything for you.
After that:
cd my-api
npm run dev
You're ready to start building.
π Generated Architecture
Instead of a flat Express project, exp-gen creates a scalable layered architecture.
- Configurations
- Controllers
- DTOs
- Interfaces
- Models
- Repositories
- Services
- Routes
- Middlewares
- Utilities
Perfect for medium and large backend projects.
π€ Open Source Contributions Welcome
I'd love to grow this into a community project.
Contributions are welcome for:
- Prisma template
- PostgreSQL improvements
- Better authentication templates
- Docker support
- Testing templates (Jest/Vitest)
- CI/CD templates
- New project templates
GitHub:
https://github.com/Open-Core-Lab/exp-gen
NPM:
https://www.npmjs.com/package/@madhusha_99/exp-gen
I'd really appreciate any feedback from the community.
- What features would you like to see?
- What templates should be added next?
- Any suggestions to improve the developer experience?
If you find it useful, consider giving the repository a β.
Happy coding! π

Top comments (0)