npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

create-smart-api

v4.2.0

Published

CLI to generate production-ready Node.js APIs with CRUD, auth, validation, testing and microservices

Downloads

820

Readme

📦 create-smart-api — Smart Node.js Backend Generator

A powerful CLI toolkit to generate production-ready Node.js REST APIs with advanced scaffolding, interactive schema builder, and database integration.


🚀 What’s New 🔥

  • 🧠 Interactive Schema Builder
  • 📊 Table Preview before model creation
  • ✏️ Edit / Add / Delete fields dynamically
  • Bulk field input support
  • 🔍 Auto typo correction (string, boolean, etc.)
  • 🧩 Supports Sequelize & Mongoose models
  • 📁 Auto .env + DB config generation
  • 🔄 Real DB-connected CRUD APIs (not dummy)

🚀 Features

  • Express.js or Fastify support
  • CommonJS & ES Modules
  • Clean architecture (Controller / Service / Model / Route)
  • Smart CRUD generator
  • JWT authentication
  • Validation (Zod/Joi)
  • Jest testing setup
  • Swagger/OpenAPI docs
  • Plugin system

📦 Installation

Run with npx (recommended)

npx create-smart-api create my-api

Or install globally

npm install -g create-smart-api

⚡ Quick Start

create-smart-api create my-api

Follow CLI prompts:

  • Project name

  • Framework (Express / Fastify)

  • Module system (CommonJS / ESM)

  • Database:

    • MongoDB (Mongoose)
    • MySQL (Sequelize)
    • MSSQL (Sequelize)
  • Generate CRUD module

  • Port


🧠 Smart CRUD Generator (🔥 Highlight Feature)

create-smart-api generate:crud user

✨ Step 1: Bulk Field Input

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

✨ Step 2: Field Enhancements

  • Required
  • Unique
  • Default values
  • Enum values

📊 Step 3: Table Preview

📊 Schema Preview

┌───┬─────────┬────────┬─────┬─────┬─────────┬────────────────────┐
│ # │ Field   │ Type   │ Req │Uniq │ Default │ Extra              │
├───┼─────────┼────────┼─────┼─────┼─────────┼────────────────────┤
│ 1 │ name    │ string │ ✔   │ ✖  │ -       │ -                  │
│ 2 │ email   │ string │ ✔   │ ✔  │ -       │ -                  │
│ 3 │ status  │ string │ ✖   │ ✖  │ active  │ enum(active,inact) │
└───┴─────────┴────────┴─────┴─────┴─────────┴────────────────────┘

✏️ Step 4: Edit Before Confirm

Options:

  • Edit field
  • Add new field
  • Delete field
  • Continue

🧩 Database Support

🟢 Sequelize (MySQL / MSSQL)

  • Auto model generation
  • Proper type mapping
  • Validation & constraints

🟢 Mongoose (MongoDB)

  • Schema-based model
  • Enum support
  • Default values
  • Ready-to-use models

📁 Generated Structure

my-api/
├── src/
│   ├── controllers/
│   ├── services/
│   ├── models/
│   ├── routes/
│   ├── middleware/
│   ├── config/
│   ├── server.js
├── .env
└── package.json

⚙️ CLI Commands

Create project

create-smart-api create my-api

Generate CRUD

create-smart-api generate:crud user

Generate Auth

create-smart-api generate:auth

Generate Service

create-smart-api generate:service

Generate Validation

create-smart-api generate:validation user

Generate Tests

create-smart-api generate:test user

Generate Swagger Docs

create-smart-api generate:swagger

🧪 Testing

npm test

⚠️ Important Note

If no models are created:

⚠️ Project created successfully, but no models were generated.

Database operations and related features may not work.

👉 Run:
create-smart-api generate:crud <module-name>

🔌 Plugin System

create-smart-api plugin install redis

🗺️ Roadmap

  • Relations (1:1, 1:N, N:N)
  • GraphQL generator
  • Redis cache support
  • Microservices support
  • AI-based API generation

🤝 Contributing

  1. Fork repo
  2. Create feature branch
  3. Add tests
  4. Submit PR

📄 License

MIT


👨‍💻 Author

Created by Chirag Chauhan

⭐ Star the repo if you like it!