Skip to content

CODE-Y02/express-cli

create-express-forge

⚑ Scaffold production-ready Express.js TypeScript backends in seconds

npm version CI License: MIT

Quick Start

npx create-express-forge my-api
# or
npm create express-forge my-api
# or (short alias)
npx cef my-api

What You Get

Interactive prompts let you choose:

Option Choices
Architecture Modular (feature-based) Β· MVC
ORM Prisma Β· Sequelize Β· None
Database PostgreSQL Β· MySQL Β· SQLite Β· None
Logger Winston Β· Pino Β· None
Testing Vitest Β· Jest Β· None
Docker Dockerfile + docker-compose

Generated Project Includes

  • βœ… TypeScript + tsx hot-reload dev server
  • βœ… Zod env validation on startup β€” fails fast on bad config
  • βœ… Global centralized error handler β€” ApiError, ZodError, unknown errors all handled
  • βœ… Request validation middleware via validate(schema)
  • βœ… ApiError β€” custom class with static factories (.notFound(), .unauthorized(), etc.)
  • βœ… ApiResponse β€” consistent JSON response helpers
  • βœ… asyncHandler β€” wraps async routes, no try/catch needed
  • βœ… Helmet + CORS + compression + rate limiter
  • βœ… Graceful shutdown (SIGTERM / SIGINT)
  • βœ… Multi-stage Dockerfile with healthcheck
  • βœ… docker-compose with correct DB service

Repository Structure

create-express-forge/
β”œβ”€β”€ packages/
β”‚   β”œβ”€β”€ create-express-forge/   ← The published CLI
β”‚   β”œβ”€β”€ typescript-config/      ← Shared internal TS config
β”‚   └── eslint-config/          ← Shared internal ESLint config
β”œβ”€β”€ examples/
β”‚   └── modular-postgres-prisma/ ← Pre-generated example
└── .github/workflows/           ← CI + Release

Contributing

See CONTRIBUTING.md.

Versioning & Branches

Branch npm tag Description
main latest Stable releases
next next Pre-releases / beta

License

MIT Β© Yatharth Lakhate

About

πŸš€ express-cli is a lightweight command-line tool that helps developers quickly create and structure Express.js applications without repetitive setup. Designed for simplicity and speed, it provides a clean starting point so you can focus on building APIs instead of configuring boilerplate.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors