forge-backend
v1.0.1
Published
CLI to scaffold backend projects with best practices
Maintainers
Readme
Backforge
Backforge is a CLI for scaffolding backend projects with an opinionated structure, practical defaults, and minimal setup.
Version 1.0.0 currently supports generating a TypeScript functional backend starter from interactive prompts.
Features
- Interactive CLI prompt flow for project setup
- Project name validation and normalization
- Template-based project generation
- TypeScript functional backend starter template
- Optional dependency installation after generation
- Ready-to-run Express starter with env config, health route, and sample module
Current Support
Backforge currently supports:
- Language:
TypeScript - Architecture:
Functional - Package managers:
pnpm,npm
Planned template structure:
ts/functionalts/oopjs/functionaljs/oop
Installation
Install dependencies for this project:
pnpm installRun the CLI locally:
pnpm devBuild the CLI:
pnpm buildUsage
Start the CLI:
pnpm devOr pass a default project name:
pnpm dev my-backend-appThe CLI will guide you through:
- project name
- language selection
- architecture selection
- package manager selection
- dependency installation preference
After confirmation, Backforge will:
- Resolve the matching template.
- Create the target project directory.
- Copy template files into the new project.
- Replace placeholders like
{{projectName}}. - Optionally install dependencies.
- Print next-step commands for running the generated app.
Generated Project
The current starter template includes:
- Express app bootstrap
- environment config with
dotenv /api/healthroute- sample module with controller, service, and routes
- TypeScript, ESLint, and Prettier setup
- starter
.envand.env.example
Example Flow
$ pnpm dev my-service
? Project name: my-service
? Select language: TypeScript
? Select architecture style: Functional
? Select package manager: pnpm
? Install dependencies? YesOutput:
Project created successfully!
Location: /path/to/my-service
Next steps:
cd my-service
pnpm run devProject Structure
src/
cli.ts
constants/
generator/
prompts/
types/
utils/
template/
ts/
functional/Development
Useful commands:
pnpm dev
pnpm buildGenerated template docs live in:
template/README.md
Project reference docs:
CHANGELOG.mdCODEBASE_INDEX.md
Notes
- The current release focuses on the TypeScript functional starter.
ts/oop,js/functional, andjs/oopfolders exist as placeholders for future templates.- If dependency installation fails, Backforge still finishes generation and prints manual install commands.
License
MIT
