exp-gen a lightning-fast, interactive CLI tool designed to scaffold Express.js REST APIs in seconds.
Whether you're starting a project with TypeScript or JavaScript, exp-gen generates a clean layered architecture, configures your preferred database boilerplate so you can start coding immediately, and now includes a built-in web-based Regex Simulator to help you build and debug regular expressions visually.
- π Interactive CLI powered by
@clack/prompts - β‘ Scaffold Express.js APIs in seconds
- π¦ TypeScript support
- π¨ JavaScript support
- π Professional layered architecture
- π MongoDB (Mongoose)
- π¬ MySQL
- πͺΆ SQLite
- π PostgreSQL (JavaScript projects)
- π¦ Optional automatic dependency installation
- π¬ Built-in Regex Simulator
- π Opens automatically in your browser
- π¨ Modern developer-friendly UI
- π Live regex explanation & validation
Install globally using npm:
npm install -g @madhusha_99/exp-genAfter installation you can launch the CLI using any of the following commands:
expor
genor
express-draftWhen the CLI starts you'll be greeted with an interactive menu.
π Scaffold a new Express API
π¬ Run Regex Simulator
Choose Scaffold a new Express API and answer a few questions.
The CLI will ask for:
- Project name
- Language
- Database
- Install dependencies
Supported languages
- TypeScript (Recommended for type safety) β Currently available with MongoDB (Mongoose) and No Database templates. More database integrations will be added in future releases.
- JavaScript β Full template support for all currently available databases, including MongoDB (Mongoose), MySQL (mysql2), SQLite (sqlite3), PostgreSQL (pg), and No Database.
| Database | JavaScript | TypeScript | Driver / ORM | Status |
|---|---|---|---|---|
| MongoDB | β | β | Mongoose | Stable |
| MySQL | β | β | mysql2 | Stable |
| SQLite | β | β | sqlite3 | Stable |
| PostgreSQL | β | β | pg | Stable |
| None (No Database) | β | β | β | Stable |
| Prisma (MongoDB) | π§ | π§ | Prisma ORM | Planned |
| Prisma (MySQL) | π§ | π§ | Prisma ORM | Planned |
| Prisma (PostgreSQL) | π§ | π§ | Prisma ORM | Planned |
| Prisma (SQLite) | π§ | π§ | Prisma ORM | Planned |
configs/: Environment variables and database connection logic.controllers/: Bridges the routes and the business logic; handles requests/responses.dtos/: Data Transfer Objects for validating and shaping incoming data.interfaces/: TypeScript interfaces and types for strict type safety.middlewares/: Custom Express middlewares (Auth, Error handling, Logging).models/: Database schemas (e.g., Mongoose/MongoDB models).repositories/: The data access layer; handles direct database operations.routes/: API endpoint definitions and mapping to controllers.services/: Core Business Logic layer; where the heavy lifting happens.utils/: Shared helper functions and utility classes.app.ts: The application entry point.
The generated architecture follows a clean layered design making projects easier to maintain and scale.
Starting from v1.4.0, exp-gen includes a fully interactive Regex Simulator.
Simply choose:
π¬ Run Regex Simulator
The CLI automatically starts a lightweight local server and opens the Regex Simulator in your default web browser.
β No additional dependencies are required. The simulator is built into
exp-genand runs entirely on your local machine.
- β‘ Live regex matching
- π Regex rule explanations
- π― Capture group visualization
- π Match position detection
- π¨ Friendly validation errors
- π§ Beginner-friendly regex guidance
- π· Regex flag helper
- π Modern dark developer UI
- π Runs completely locally
Example
(?<name>\w+)-(\d+)Input:
hello-123
world-456
invalid-value
Output:
β Match 1
hello-123
Group 1:
hello
Group 2:
123
The simulator also explains regex tokens such as:
| Token | Description |
|---|---|
\d |
Digit |
\w |
Word character |
. |
Any character |
+ |
One or more |
* |
Zero or more |
? |
Optional |
^ |
Start of input |
$ |
End of input |
() |
Capture group |
(?<name>) |
Named capture group |
expβ What would you like to do?
β― π Scaffold a new Express API
π¬ Run Regex Simulator
or
β What would you like to do?
π Scaffold a new Express API
β― π¬ Run Regex Simulator
Navigate into your project
cd my-projectIf dependencies were installed
npm run devOtherwise
npm install
npm run devWe love open source! exp-gen is a community-driven project, and we welcome contributions to make it better.
You can help by:
- Adding new database templates
- Improving generated project templates
- Improving the Regex Simulator
- Reporting bugs
- Suggesting new CLI features
Clone the project
git clone https://github.com/Open-Core-Lab/exp-gen.gitInstall dependencies
npm installRun locally
npm run devUpcoming features include:
- Prisma support
- Docker template generation
- JWT Authentication template
- Swagger/OpenAPI generation
- Testing templates (Vitest/Jest)
- Redis integration
- Prisma PostgreSQL template
- Environment profile generator
- More Regex Simulator utilities
If you enjoy using exp-gen, consider giving the repository a β on GitHub.
It helps the project grow and supports future development.
Repository: exp-gen
This project is licensed under the MIT License.
Happy coding! π
Maintained with β€οΈ by Madhusha Prasad


