design-backend-app
v1.1.4
Published
Intelligent Backend Architecture Generator
Downloads
1,386
Readme
📖 Table of Contents
- Why DevForge?
- Key Features
- Quick Start
- Interactive Setup Wizard
- Architecture Patterns
- CLI Command Reference
- Available Plugins
- Automated API Documentation
- Contributing
- License
💡 Why DevForge?
Modern backend development is bogged down by repetitive tasks: configuring TypeScript, setting up ORMs, writing JWT middleware, structuring folders, and wiring up Swagger docs. DevForge (design-backend-app) eliminates this overhead entirely.
Unlike basic boilerplate generators, DevForge is an intelligent engine. If you ask it to generate an authentication module, it dynamically inspects your chosen ORM (Prisma/Mongoose/Sequelize) and writes the exact database queries, bcrypt hashing, and JWT token generation logic needed for your specific tech stack.
✨ Key Features
- True Database Intelligence: Generates models and CRUD operations specifically tailored for Mongoose, Prisma, or Sequelize.
- Framework Agnostic Foundations: Currently supports Express.js and Fastify, with an architecture designed to easily adopt Hono and NestJS in the future.
- Production-Ready Auth: One command generates complete Registration, Login, and Logout flows using standard JWTs or Session cookies.
- Role-Based Access Control (RBAC): Generate middleware and controllers that automatically enforce role-based security out-of-the-box.
- Dynamic Plugin Ecosystem: Add enterprise features like Docker, Redis, BullMQ, and AWS S3 instantly without touching configuration files.
- Auto-Generated Swagger UI: Endpoints generated by DevForge automatically contain detailed OpenAPI JSDoc comments grouped by tags.
🚀 Quick Start
You don't need to install anything globally. You can bootstrap a new project directly using npx:
npx design-backend-app my-backend(Or navigate to an empty directory and run npx design-backend-app init ./)
Once the CLI generates your codebase and installs dependencies:
cd my-backend
npm run devYour server will start (default port 3000), and your API documentation will be instantly available at http://localhost:3000/api-docs!
⚙️ Interactive Setup Wizard
When you run the initialization command, DevForge will ask you a series of questions to tailor the project exactly to your needs:
- Framework:
Express.jsorFastify - Language:
TypeScript(JavaScript coming soon) - Architecture:
MVC(Classic Model-View-Controller)Modular(Domain-Driven Design for scalable microservices)
- Scale (if Modular is chosen):
Small,Medium, orEnterprise - Database:
MongoDB (Mongoose),PostgreSQL (Prisma),MySQL (Sequelize), orNone - Authentication:
JWT,Session, orNone - RBAC: Define custom roles (e.g.,
user, admin, superadmin)
🗂 Architecture Patterns
1. MVC (Model-View-Controller)
The industry standard for straightforward, monolithic web applications.
src/
├── controllers/ # Handles HTTP requests and responses
├── models/ # Database schemas and abstractions
├── routes/ # Express/Fastify router configurations
├── middleware/ # Auth, Validation, and logging middleware
├── utils/ # Helper functions (JWT, hashers)
└── app.ts # Application entry point2. Modular (Domain-Driven Design)
Designed for maximum scalability. Code is grouped tightly by business domain, making it incredibly easy to split into microservices later.
src/
├── modules/
│ ├── users/
│ │ ├── domain/ # Models, Types, Interfaces
│ │ ├── application/ # Business Logic (Services)
│ │ └── infrastructure/ # Controllers, Routes
├── middleware/
└── app.ts🛠 CLI Command Reference
Once your project is created, DevForge tracks its state via a hidden .devforge.json file. You can run CLI commands from within your project directory using npx design-backend-app <command>.
1. Generate Component
Dynamically scaffold new features. DevForge automatically wires new routes into your app.ts file!
Commands:
Generate an Authentication Flow:
npx design-backend-app generate authCreates a fully working
auth.controllerintegratingbcrypt, your chosen database, and token generation.Generate a generic Module:
npx design-backend-app generate module inventoryCreates controllers, routes, and services for a new domain.
Generate a complete CRUD Module:
npx design-backend-app generate module products --crudGenerates the database model file AND the controller logic required to Create, Read, Update, and Delete products.
Generate Background Workers / Queues:
npx design-backend-app generate queue emailsGenerate Upload Handlers:
npx design-backend-app generate upload documents
2. Plugin System
Why spend hours reading documentation to configure Redis or Docker? Let DevForge inject the best-practice setup directly into your code.
Add a plugin:
npx design-backend-app add swaggerRemove a plugin:
npx design-backend-app remove swagger(Removes the configuration files, cleans up app.ts, and uninstalls dependencies)
🧩 Available Plugins
| Plugin Name | Description | Packages Installed |
|---|---|---|
| swagger | Injects an automated OpenAPI/Swagger UI at /api-docs. | swagger-ui-express, swagger-jsdoc |
| docker | Creates an optimized Dockerfile and docker-compose.yml for local dev & production. | None (System level) |
| redis | Sets up a Redis client connection pool in src/config/redis.ts. | ioredis |
| bullmq | Configures BullMQ for robust background job processing. | bullmq, ioredis |
| logger | Replaces console.log with a structured winston logging utility. | winston |
| rate-limit | Adds basic API rate-limiting middleware to app.ts. | express-rate-limit |
| validation | Sets up request validation middleware using Zod. | zod |
| aws-s3 | Generates an S3 service wrapper for AWS uploads. | @aws-sdk/client-s3 |
| nodemailer | Sets up a reusable email dispatcher utility. | nodemailer |
| code-quality | Installs and configures ESLint, Prettier, and Husky pre-commit hooks. | eslint, prettier, husky |
📝 Automated API Documentation
Whenever you generate a module using --crud or generate an auth flow, DevForge automatically annotates your routes with OpenAPI (Swagger) Comments.
For example, generating an auth module automatically produces code like this:
/**
* @openapi
* /api/auth/register:
* post:
* tags:
* - Auth
* summary: Register a new user
* description: Creates a new user account.
* responses:
* 201:
* description: Successfully registered.
*/
authRouter.post('/register', register);If you have the swagger plugin installed, this endpoint instantly appears beautifully formatted in your Swagger UI!
🤝 Contributing
We actively welcome community contributions! If you want to build a new plugin, add a new framework (like NestJS or Hono), or fix a bug:
- Read our Contributing Guidelines.
- Review our Code of Conduct.
- Check the Issues Tab for feature requests or bug reports.
To run the CLI locally for development:
git clone https://github.com/PuneethKrishnaS/design-backend-app.git
cd design-backend-app
npm install
npm run dev
node dist/index.js --help📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
