BackForge is designed to be the "Vite for Backend" - a blazing fast, production-ready backend scaffolder.
- Runtime Detection: Automatically detects if you are running Node.js or Bun.
- Package Manager Detection: Detects if you used
npm,pnpm,yarn, orbunto launch the CLI and configures the project accordingly.
- Language: TypeScript (Recommended) or JavaScript.
- Framework: Express (Classic) or Fastify (High Performance).
- Database: SQL (via Prisma) or NoSQL (via Mongoose/MongoDB).
- Structured: Clean architecture (Controllers, Services, Utils).
- Configured: Pre-configured
.env,README.md,tsconfig.json(if TS). - Optimized: Best practices for security and performance out of the box.
- Monorepo Setup: Ensure
backforge-cliandbackforge-coreare properly linked. - CLI Entry Point: Basic CLI that can be run with
npm create backforge. - Runtime & PM Detection: Logic to identify the environment.
- Template System: A robust system to compose templates based on user choices (e.g., "TS + Fastify + Prisma").
- File Generation: Efficiently copy and transform template files.
- Dependency Injection: Dynamically generate
package.jsondependencies based on choices.
- Express Template:
- Error Handling Middleware.
- Async Handler.
- Security Headers (Helmet).
- Fastify Template:
- Schema Validation.
- Hooks.
- High-performance defaults.
- Database Integration:
- Mongoose: Connection pooling, schema setup.
- Prisma: Client generation, initial migration script.
- Beautiful CLI: Use colors, spinners, and clear prompts.
- Detailed READMEs: Each generated project gets a custom README explaining how to run, build, and deploy.
- Testing: Verify all combinations (8 variants) work seamlessly.
- CLI:
prompts(for interactivity),commanderorcac(for args),picocolors(for style). - Core: Node.js / Bun file system APIs.
- Templates: EJS or simple string replacement for dynamic content.