create-smart-api
v4.4.3
Published
CLI tool to quickly generate production-ready Node.js REST APIs with CRUD, authentication, validation, testing, and microservices support
Downloads
451
Maintainers
Readme
🚀 create-smart-api
Smart Node.js Backend Generator for Production-Ready APIs
Build scalable backend APIs in seconds with an interactive CLI that generates clean, production-ready Node.js projects using Express or Fastify.
📦 Overview
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.
✨ Key Highlights
🔥 Smart Interactive CLI
Generate complete backend projects with guided prompts.
🧠 Interactive Schema Builder
Create models visually with:
- Add/Edit/Delete fields
- Bulk field input mode
- Table preview before generation
- Auto typo correction for field types
⚡ Production Ready
Generated projects include:
- Folder structure
- Database config
- Environment setup
- Real connected CRUD APIs
🎯 Features
- 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
📥 Installation
Run instantly with npx
npx create-smart-api create my-apiShort alias
npx create-smart-api c my-apiGlobal install
npm install -g create-smart-api⚡ Quick Start
create-smart-api create my-apior
create-smart-api c my-api🏗️ Project Setup Wizard
The CLI will guide you through:
- Project name
- Framework selection
- Module system
- Database choice
- CRUD generation
- Port configuration
Supported databases:
- MongoDB
- MySQL
- MSSQL
🧠 Smart CRUD Generator
Generate complete CRUD module instantly:
create-smart-api generate:crud useror shortcut:
create-smart-api g:c userSchema Builder Example
Interactive Mode
Field name: name
Type: string
Required? Yes
Unique? NoQuick Input Mode
name:string,email:string,age:number,status:enumSchema Preview Table
| # | Field | Type | Req | Uniq | Default | Extra | | --- | ------ | ------ | --- | ---- | ------- | --------------- | | 1 | name | string | Yes | No | - | - | | 2 | email | string | Yes | Yes | - | - | | 3 | status | enum | No | No | active | active,inactive |
Edit Before Generate
Options include:
- Edit field
- Add field
- Delete field
- Continue
⚙️ CLI Commands
Create Project
create-smart-api create my-api
create-smart-api c my-apiGenerate CRUD
create-smart-api generate:crud user
create-smart-api g:c userGenerate Auth
create-smart-api generate:auth
create-smart-api g:aGenerate Service
create-smart-api generate:service user
create-smart-api g:s userGenerate Route
create-smart-api generate:route user
create-smart-api g:r userGenerate Model
create-smart-api generate:model user
create-smart-api g:m userGenerate Validation
create-smart-api generate:validation user
create-smart-api g:v userGenerate Test
create-smart-api generate:test user
create-smart-api g:t userGenerate Swagger
create-smart-api generate:swaggerAdd Plugin
create-smart-api add:plugin redis
create-smart-api add:p redis🔌 Plugin Support
Currently supported plugins:
- Redis
- Kafka
Example:
create-smart-api add:plugin kafka🧩 Database Support
MongoDB (Mongoose)
- Schema models
- Enum support
- Defaults
- Validation ready
MySQL / MSSQL (Sequelize)
- Typed models
- Constraints
- Auto mappings
🔗 Relationship Support
Define model relationships interactively:
Related model name: User
Relation type:
❯ 1:1
1:N
N:NAuto-create missing related models if needed.
🧪 Testing
Generated apps support Jest:
npm test🛠️ Auto Command Suggestions
Mistyped command?
Example:
create-smart-api genrate:crud userCLI automatically suggests:
Did you mean: generate:crud ?And can rerun automatically after confirmation.
🚀 Roadmap
Upcoming features:
- GraphQL generator
- Redis cache layer
- Advanced microservices templates
- AI-powered API generation
- Docker support
- CI/CD templates
🤝 Contributing
Contributions are welcome!
- Fork repository
- Create feature branch
- Commit changes
- Submit PR
📄 License
MIT License
👨💻 Author
Created with ❤️ by Chirag Chauhan
GitHub: https://github.com/cvchauhan
⭐ Support
If you like this project:
👉 Star the repository 👉 Share with developers 👉 Contribute ideas
Build APIs Faster. Smarter. Cleaner.
npx create-smart-api create my-next-api