Build scalable backend APIs in seconds with an interactive CLI that generates clean, production-ready Node.js projects using Express or Fastify.
create-smart-api is a powerful CLI toolkit that helps developers scaffold modern backend applications with:
- Clean architecture
- CRUD generation
- Authentication
- Validation
- Swagger docs
- Testing setup
- Plugin support
- Interactive schema builder
Perfect for rapid backend development.
Generate complete backend projects with guided prompts.
Create models visually with:
- Add/Edit/Delete fields
- Bulk field input mode
- Table preview before generation
- Auto typo correction for field types
Generated projects include:
- Folder structure
- Database config
- Environment setup
- Real connected CRUD APIs
- Express.js / Fastify support
- CommonJS + ESM support
- MongoDB / MySQL / MSSQL support
- Sequelize + Mongoose support
- CRUD generator
- Auth generator
- Validation generator
- Swagger/OpenAPI setup
- Jest testing support
- Plugin system
- Microservice scaffolding
npx create-smart-api create my-api
npx create-smart-api c my-api
npm install -g create-smart-api
create-smart-api create my-api
or
create-smart-api c my-api
The CLI will guide you through:
- Project name
- Framework selection
- Module system
- Database choice
- CRUD generation
- Port configuration
Supported databases:
- MongoDB
- MySQL
- MSSQL
Generate complete CRUD module instantly:
create-smart-api generate:crud user
or shortcut:
create-smart-api g:c user
Field name: name
Type: string
Required? Yes
Unique? No
name:string,email:string,age:number,status:enum
| # | Field | Type | Req | Uniq | Default | Extra |
|---|---|---|---|---|---|---|
| 1 | name | string | Yes | No | - | - |
| 2 | string | Yes | Yes | - | - | |
| 3 | status | enum | No | No | active | active,inactive |
Options include:
- Edit field
- Add field
- Delete field
- Continue
create-smart-api create my-api
create-smart-api c my-api
create-smart-api generate:crud user
create-smart-api g:c user
create-smart-api generate:auth
create-smart-api g:a
create-smart-api generate:service user
create-smart-api g:s user
create-smart-api generate:route user
create-smart-api g:r user
create-smart-api generate:model user
create-smart-api g:m user
create-smart-api generate:validation user
create-smart-api g:v user
create-smart-api generate:test user
create-smart-api g:t user
create-smart-api generate:swagger
create-smart-api add:plugin redis
create-smart-api add:p redis
Currently supported plugins:
- Redis
- Kafka
Example:
create-smart-api add:plugin kafka
- Schema models
- Enum support
- Defaults
- Validation ready
- Typed models
- Constraints
- Auto mappings
Define model relationships interactively:
Related model name: User
Relation type:
β― 1:1
1:N
N:N
Auto-create missing related models if needed.
Generated apps support Jest:
npm test
Mistyped command?
Example:
create-smart-api genrate:crud user
CLI automatically suggests:
Did you mean: generate:crud ?
And can rerun automatically after confirmation.
Upcoming features:
- GraphQL generator
- Redis cache layer
- Advanced microservices templates
- AI-powered API generation
- Docker support
- CI/CD templates
Contributions are welcome!
- Fork repository
- Create feature branch
- Commit changes
- Submit PR
MIT License
Created with β€οΈ by Chirag Chauhan
GitHub: https://github.com/cvchauhan
If you like this project:
π Star the repository π Share with developers π Contribute ideas
npx create-smart-api create my-next-api