ts-express-generator-kit
v1.1.0
Published
A TypeScript-based Express.js project generator with best practices and clean architecture.
Maintainers
Readme
⚡ ts-express-generator-kit
A fast, modern, and developer-friendly Node.js CLI tool to generate a production-ready TypeScript + Express boilerplate with best practices built in.
Built for speed, scalability, and real-world backend development.
✨ Why ts-express-generator-kit?
Most generators give you a “hello world”.
This gives you a project you can actually ship.
- Clean & scalable architecture
- TypeScript-first setup
- Environment-based configuration
- Cross-platform support (macOS, Linux, Windows)
- Minimal setup, maximum productivity
🚀 Features
- ⚡ Fast CLI execution
- 🧩 Simple & intuitive commands
- 🟦 TypeScript-first architecture
- 🌍 Cross-platform support using
cross-env - 🛠 Minimal configuration
- 📦 Production-ready structure
- 🧪 Easy to extend & customize
- 🐳 Optional Docker support
- ✨ ESLint & Prettier ready
- 🗄 Database support (MongoDB / MySQL / PostgreSQL)
- 🔐 JWT service included
📦 Installation
Global installation (recommended)
npm install -g ts-express-generator-kitOr run without installing
npx ts-express-generator-kit my-project🧑💻 Usage
ts-express-generator-kit <project-name> [options]Example
ts-express-generator-kit my-api --eslint --prettier --db mongoHelp
ts-express-generator-kit --help⚙️ Options
| Option | Description |
|------|------------|
| --use-docker | Include Docker configuration |
| --eslint | Add ESLint setup |
| --prettier | Add Prettier configuration |
| --db <type> | Database setup (mongo, mysql, postgres) |
| -h, --help | Display help |
📁 Generated Project Structure
.
├─ envs/ # Environment variable files
│ ├─ local.env
│ ├─ development.env
│ └─ staging.env
│
├─ scripts/ # Build & utility scripts
│ ├─ common/
│ │ └─ utils.ts # Shared script utilities
│ └─ build.ts # Custom build logic
│
├─ src/ # Application source code
│ ├─ common/ # Shared utilities
│ │ ├─ constants/ # App-wide constants
│ │ │ ├─ HTTP_STATUS_CODES.ts
│ │ │ ├─ PATHS.ts
│ │ │ └─ index.ts
│ │ └─ util/ # Helper utilities
│ │ ├─ misc.ts
│ │ ├─ route-errors.ts
│ │ └─ validators.ts
│ │
│ ├─ config/ # Configuration modules
│ │ └─ db.ts # Database configuration
│ │
│ ├─ controllers/ # Route controllers
│ │ └─ main.controller.ts
│ │
│ ├─ models/ # Database models
│ │ └─ index.ts
│ │
│ ├─ routes/ # API routes
│ │ └─ index.ts
│ │
│ ├─ services/ # Business logic services
│ │ └─ jwt.service.ts # JWT authentication service
│ │
│ ├─ index.ts # Application entry point
│ └─ server.ts # HTTP server bootstrap
│
├─ config.ts # Global runtime configuration
├─ eslint.config.ts # ESLint configuration
├─ package.json # Project metadata & scripts
├─ tsconfig.json # Base TypeScript config
└─ tsconfig.prod.json # Production TypeScript config
▶️ Running the Project
Development mode
npm run dev
# or
yarn devDevelopment with hot reload
npm run dev:hot
# or
yarn dev:hot🌍 Environment-Based Scripts (Cross-Platform)
This project uses cross-env so it works consistently on Windows, macOS, and Linux.
{
"local": "cross-env NODE_ENV=local ts-node ./src",
"local:hot": "nodemon --exec \"npm run local\" --watch ./src --ext .ts",
"start:dev": "cross-env NODE_ENV=development node -r ./config.js ./dist",
"start:stag": "cross-env NODE_ENV=staging node -r ./config.js ./dist",
"start:local": "cross-env NODE_ENV=local node -r ./config.js ./dist"
}🆕 What’s New & Improved
✅ Fixed
- Build creation issues
- TypeScript output inconsistencies
➕ Added
- Environment-specific run scripts
cross-envfor OS-independent execution- Hot-reload support for local development
- Improved project structure for scalability
🧠 Built With
- TypeScript
- Node.js
- Express
- Commander
- Chalk
- Execa
- cross-env
👤 Author
Tarun Bhardwaj
Sr. Software Engineer | Full-Stack Developer
React • React Native • Node.js • TypeScript
Email: [email protected]
⭐ Support
If you find this useful:
- ⭐ Star the repository
- 🐛 Report issues
- 💡 Suggest new features
