Skip to content

cvchauhan/create-smart-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

129 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ 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-api

Short alias

npx create-smart-api c my-api

Global install

npm install -g create-smart-api

⚑ Quick Start

create-smart-api create my-api

or

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 user

or shortcut:

create-smart-api g:c user

Schema Builder Example

Interactive Mode

Field name: name
Type: string
Required? Yes
Unique? No

Quick Input Mode

name:string,email:string,age:number,status:enum

Schema 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-api

Generate CRUD

create-smart-api generate:crud user
create-smart-api g:c user

Generate Auth

create-smart-api generate:auth
create-smart-api g:a

Generate Service

create-smart-api generate:service user
create-smart-api g:s user

Generate Route

create-smart-api generate:route user
create-smart-api g:r user

Generate Model

create-smart-api generate:model user
create-smart-api g:m user

Generate Validation

create-smart-api generate:validation user
create-smart-api g:v user

Generate Test

create-smart-api generate:test user
create-smart-api g:t user

Generate Swagger

create-smart-api generate:swagger

Add 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:N

Auto-create missing related models if needed.


πŸ§ͺ Testing

Generated apps support Jest:

npm test

πŸ› οΈ Auto Command Suggestions

Mistyped command?

Example:

create-smart-api genrate:crud user

CLI 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!

  1. Fork repository
  2. Create feature branch
  3. Commit changes
  4. 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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Sponsor this project

  •  

Packages

 
 
 

Contributors