v2.0.1 is live: Flat-MVC, Native ESM & Auto Service Generator

Production-Ready Express Apps in Seconds.

Skip the repetitive boilerplate fatigue. Scaffold a battle-tested Node.js + Express backend with clean flat-MVC architecture, 4 package managers, multi-database support, and an automated inline service generator.

$npx xpresso-cli my-app
4
Package Managers
npm, yarn, pnpm & bun
3+
Database Options
MongoDB, Postgres, MySQL, None
100%
Native ESM
type: "module", zero Babel
< 2s
Scaffold Speed
Instant directory bootstrap
Interactive Simulator

Experience xpresso-cli in Your Browser

Test drive how the CLI prompts you, configures your database adapter, and bootstraps the project in real-time.

Quick Presets:
bash ~ my-express-api
Welcome to xpresso-cli interactive simulator. Select options and press 'Run Scaffold'.
$ npx xpresso-cli my-express-api
Built for Modern Backend Engineers

Engineered for Speed, Built for Production

Everything you need to launch a production Express service without the usual glue code and configuration headaches.

Native ESM

Instant Scaffold

Generates a clean flat-MVC structure in under 2 seconds. Full ES modules (`type: 'module'`) with zero Babel, zero transpilation, and instant Node.js runtime boot.

  • type: 'module' from day one
  • Clean flat-MVC layout
  • Zero compilation delay
MongoDB / SQL

Multi-Database Support

First-class adapters for MongoDB (via Mongoose), PostgreSQL (via Sequelize), and MySQL (via Sequelize) — or choose None for a ultra-lightweight REST API.

  • Auto-configured connection files
  • Graceful disconnect handling
  • Pre-built user/auth schemas
xpresso-cli create

Inline Service Generator

Scaffold complete features on the fly. `xpresso-cli create <name>` generates a controller, route, and model, then automatically patches `routes/index.routes.js`.

  • Controller with model bindings
  • Express router template
  • Zero manual route wiring
Smart Generator

Auto DB Detection

When running the `create` command, the CLI inspects your existing `package.json` dependencies to determine whether to emit Mongoose or Sequelize models.

  • Reads package dependencies
  • Outputs matched model syntax
  • Falls back to custom templates
Hardened Core

Production Middleware

Pre-configured with CORS, Gzip compression, Morgan HTTP logging, cookie-parser, and AES-256-GCM token encryption for tamper-proof tokens.

  • Gzip level 4 compression
  • AES-256-GCM crypto helpers
  • Centralized error logging to file
Strict Schema

Environment Aware

Dynamically switches between `.env.development` and `.env.production` based on `NODE_ENV`, with strict fail-fast validation when required keys are missing.

  • Dual .env file support
  • Startup validation guard
  • Type-safe config exports
Inline Service Generator

Never Write Route Wiring Glue Code Again

Type xpresso-cli create <name> inside any project directory to scaffold a full service and automatically inject it into your application router.

create
$ xpresso-cli create product
Quick suggestions:

Scaffolded Service Files

controllers/product.controller.js
CRUD methods
routes/product.routes.js
Endpoints
models/product.model.js
Schema
routes/index.routes.js
⚡ Auto-Wired
// routes/index.routes.js
import express from 'express'
import authRoutes from './auth.routes.js'
// ⚡ Auto-injected by xpresso-cli create product:
import productRoutes from './product.routes.js'

const router = express.Router({ caseSensitive: true })

router.use('/api/auth', authRoutes)
// ⚡ Auto-wired route:
router.use('/api/product', productRoutes)

export default router
Auto DB detection detects Mongoose or Sequelize automaticallyZero manual import needed
Architecture Deep Dive

Clean Flat-MVC Architecture

Click any file below to inspect the actual generated code and understand why xpresso-cli makes backend development faster.

Project Explorerflat-mvc
app.jsExpress Entry Point
â„šī¸Production-ready Express pipeline: CORS, Morgan, Gzip compression, Cookie Parser, static route serving, and global error handler.
import express from 'express'
import cookieParser from 'cookie-parser'
import logger from 'morgan'
import compression from 'compression'
import cors from 'cors'
import { globalErrorHandler } from './utils/helper.utils.js'
import indexRoutes from './routes/index.routes.js'

const app = express()

app.use(cors())
app.use(logger('dev'))
app.use(express.json({ limit: '10kb' }))
app.use(express.urlencoded({ extended: true }))
app.use(compression({ level: 4, threshold: 0 }))
app.use(cookieParser())

// Main router
app.use('/', indexRoutes)

// Centralized error handler
app.use(globalErrorHandler)

export default app
CLI Command Reference

Simple, Expressive Commands

No endless flags or configuration files to memorize. Two intuitive commands handle scaffolding and scaling.

$
xpresso-cli [directory]

Scaffolds a new Express application with flat-MVC structure, selected database adapter, and auth boilerplate.

Arguments
project-directoryoptional
Folder name where the project will be created. If omitted, the CLI interactively prompts for one.
Examples:
$
xpresso-cli create <name>

Creates controllers/<name>.controller.js, routes/<name>.routes.js, and models/<name>.model.js, and auto-wires routes/index.routes.js.

Arguments
serviceNamerequired
The name of the entity or domain service to scaffold (e.g. user, product, order, payment).
Examples:
💡
Smart Missing Package Manager Guard: If you pick a package manager (e.g. bun or pnpm) that isn't installed on the machine, xpresso-cli gracefully warns you with install instructions and skips the install step instead of crashing.
Get Started in Seconds

Ready to Build Your Next Express API?

No manual directory setups, no repetitive route wiring, and no boilerplate fatigue. Run one command and start writing your business logic immediately.

$npx xpresso-cli my-app
Star on GitHub