express-api-template
v3.3.0
Published
Project for quick express.js setup
Maintainers
Readme
✨ Features
| Feature | Description |
|---------|-------------|
| 🔷 TypeScript & JavaScript | Full support for both languages—you choose |
| 🏗️ MVC or Scalable Architecture | Classic Model-View-Controller or modern modular structure |
| 🍃 MongoDB Ready | Pre-configured MongoDB connection with Mongoose |
| 📂 Smart Project Structure | Organized folders for controllers, routes, models, and utilities |
| 🔧 ESLint + Prettier + Biome | Code quality tools configured out of the box |
| 📦 Auto Dependency Install | Optional automatic npm install during setup |
| 🎯 Interactive CLI | Guided prompts for a smooth setup experience |
📦 Quick Start
npx express-api-templateThat's it! The CLI will guide you through:
- Project name — Name your project folder
- Architecture — Choose MVC or Scalable (Modular)
- Language — JavaScript or TypeScript
- Dependencies — Auto-install packages or do it yourself
🏗️ Project Structures
MVC (Model-View-Controller)
Traditional, battle-tested architecture ideal for small to medium projects.
my-project/
├── config/ # Configuration files
├── controllers/ # Request handlers
├── models/ # Mongoose schemas
├── routers/ # Express routes
├── utils/ # Helper functions
├── lib/ # Shared libraries
├── index.js # Entry point
└── .env # Environment variablesScalable (Modular)
Feature-based architecture designed for large, maintainable codebases.
my-project/
├── src/
│ ├── modules/ # Feature modules (users, auth, etc.)
│ ├── common/ # Shared utilities
│ ├── config/ # App configuration
│ └── index.ts # Entry point
├── tsconfig.json # TypeScript config (if applicable)
└── .env # Environment variables🚀 After Installation
# Navigate to your project
cd my-project
# Set up environment variables
cp .env.example .env # Edit with your config
# Start development server
npm run dev🛠️ Included Tools
| Tool | Purpose | |------|---------| | ESLint | Linting and code standards | | Prettier | Code formatting | | Biome | Fast formatter & linter | | Mongoose | MongoDB object modeling | | dotenv | Environment variable management |
📋 Available Scripts
| Script | Description |
|--------|-------------|
| npm run dev | Start development server with hot reload |
| npm run start | Start production server |
| npm run lint | Run ESLint checks |
| npm run format | Format code with Prettier/Biome |
🤝 Contributing
Contributions are welcome! Feel free to:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
📄 License
This project is licensed under the MIT License — see the LICENSE file for details.
