express-api-rest-gen
v4.6.2
Published
A minimal CLI tool to generate a REST API with Express with JS or TS
Readme
express-api-rest-gen
🚀 A minimal and powerful CLI tool to generate a production-ready REST API with Express.js (JavaScript or TypeScript)
✨ Features
- ⚡ Zero-configuration - Interactive CLI setup
- 🔧 Flexible - Choose between JavaScript or TypeScript
- 📦 Production-ready - Best practices included
- 🎯 Fast - Generate your API in seconds
- 📝 Well-structured - Clean project structure
- 🛠️ Extensible - Easy to customize after generation
📋 Table of Contents
📦 Installation
Global Installation
npm i -g express-api-rest-genRequirements:
- Node.js 22.0.0 or higher
- npm 10.0.0 or higher
🚀 Quick Start
Navigate to your desired directory
Run the CLI generator:
express-api-rest-genalternatively, you can use npx:
npx express-api-rest-genFollow the interactive prompts:
- Project name - Your API project name
- Language - Choose between JavaScript or TypeScript
- Database - Select a database (MongoDB, PostgreSQL or MySQL)
- Testing - Optionally include testing setup (Jest)
Start coding:
cd your-project-name
npm start📁 Project Structure
your-project-name/
├── src/
│ ├── controllers/
│ ├── middleware/
│ ├── models/
│ ├── routes/
| |── tests/
| |── utils/ # Optional utility functions
| |── validators/ # Optional validation logic
| |── index.js (or index.ts) # Entry point
│ └── app.js (or app.ts) # Express app setup
├── .env
├── database.js (or database.ts) # Database connection setup
├── jest.config.js (if Testing selected)
├── package.json
├── package.lock.json
└── tsconfig.json (if TypeScript selected)🤝 Contributing
Contributions are welcome! Please feel free to:
- Report bugs and request features via GitHub Issues
- Submit pull requests with improvements
- Improve documentation
Development
git clone https://github.com/rubsuadav/express-api-rest-gen.git
cd express-api-rest-gen
npm i📄 License
This project is licensed under the ISC License - see the LICENSE file for details.
