______ __ ________
/ ____/_______ ____ _/ /____ / ____/ /_ __ ___________ _
/ / / ___/ _ \/ __ `/ __/ _ \ / / / __ \/ / / / ___/ __ `/
/ /___/ / / __/ /_/ / /_/ __/ / /___/ / / / /_/ / / / /_/ /
\____/_/ \___/\__,_/\__/\___/ \____/_/ /_/\__,_/_/ /\__,_/
Scaffold production-ready backend projects with ease
A powerful CLI tool to create fully configured backend projects with your preferred stack. Choose from multiple ORMs, databases, authentication methods, testing frameworks, and deployment configurationsβall in one command.
npx create-churn@latest- 6 ORM Options: Prisma, Drizzle, TypeORM, Sequelize, Mongoose, or None
- 4 Databases: PostgreSQL, MySQL, SQLite, MongoDB
- Auto-configured: Connection strings, models, and migrations
- JWT: Token-based authentication with middleware
- OAuth: Google & GitHub integration
- Session: Express session-based auth
- Security: Environment-based secrets management
- Jest: Full-featured testing with coverage
- Vitest: Fast, Vite-powered testing
- Pre-configured: Test examples for HTTP/WebSocket APIs
- ESLint: Automatic linting with TypeScript support
- Prettier: Consistent code formatting
- Husky: Git hooks for pre-commit validation
- lint-staged: Run linters on staged files
- Docker: Multi-stage builds with health checks
- docker-compose: Database orchestration
- CI/CD: GitHub Actions, GitLab CI, CircleCI
- Languages: TypeScript & JavaScript
- Package Managers: Bun, npm, yarn, pnpm
- Protocols: HTTP (REST API with optional CORS) & WebSocket
- Path Aliases: TypeScript path mapping
- Environment: Type-safe env variables with Zod
- Zero Config: Ready-to-run projects out of the box
my-project/
βββ src/
β βββ index.ts # Main entry point
β βββ config/
β β βββ database.ts # Database connection (if ORM selected)
β β βββ env.ts # Environment validation
β βββ auth/ # Authentication logic (if selected)
β βββ models/ # Database models (ORM-specific)
β βββ entities/ # TypeORM entities (if TypeORM)
βββ __tests__/ # Test files (if testing selected)
βββ prisma/ # Prisma schema (if Prisma)
βββ drizzle/ # Drizzle migrations (if Drizzle)
βββ .github/workflows/ # GitHub Actions (if selected)
βββ .gitlab-ci.yml # GitLab CI (if selected)
βββ .circleci/config.yml # CircleCI (if selected)
βββ Dockerfile # Docker config (if selected)
βββ docker-compose.yml # Docker Compose (if selected)
βββ .eslintrc.json # ESLint config (if linting)
βββ .prettierrc # Prettier config (if linting)
βββ tsconfig.json # TypeScript config (if TS)
βββ package.json # Dependencies & scripts
βββ .env.example # Environment template
βββ .gitignore # Git ignore rules
βββ README.md # Project documentation
The easiest way to get started. The CLI will guide you through all configuration options:
npx create-churn@latestYou'll be prompted to configure:
- Project name - Your project directory name
- Language - TypeScript or JavaScript
- Package manager - Bun, npm, yarn, or pnpm
- Protocol - HTTP (REST API) or WebSocket
- CORS - Enable/Disable (HTTP only)
- ORM/ODM - Prisma, Drizzle, TypeORM, Sequelize, Mongoose, or None
- Database - PostgreSQL, MySQL, SQLite, or MongoDB
- Path aliases - TypeScript path mapping (TS only)
- Authentication - JWT, OAuth, Session, or None
- Testing - Jest, Vitest, or None
- Linting - ESLint & Prettier with Husky
- Docker - Dockerfile & docker-compose
- CI/CD - GitHub Actions, GitLab CI, CircleCI, or None
Note: Coming in v1.2.0. Skip prompts by providing configuration via flags:
npx create-churn@latest [project-name] [options]# TypeScript + Bun + Prisma + PostgreSQL
npx create-churn@latest my-app --ts --bun --prisma --postgresql
# JavaScript + npm + MongoDB
npx create-churn@latest my-api --js --npm --mongoose --mongodb
# WebSocket server with testing
npx create-churn@latest realtime-app --ws --vitest --docker| Flag | Description | Options | Default |
|---|---|---|---|
| Language | |||
--ts, --typescript |
Use TypeScript | - | β Default |
--js, --javascript |
Use JavaScript | - | |
| Package Manager | |||
--bun |
Use Bun | - | β Default |
--npm |
Use npm | - | |
--yarn |
Use Yarn | - | |
--pnpm |
Use pnpm | - | |
| Protocol | |||
--http |
HTTP/REST API | - | β Default |
--ws, --websocket |
WebSocket server | - | |
--cors |
Enable CORS (HTTP only) | - | β Default for HTTP |
--no-cors |
Disable CORS | - | |
| ORM/ODM | |||
--prisma |
Use Prisma | - | β Default |
--drizzle |
Use Drizzle | - | |
--typeorm |
Use TypeORM | - | |
--sequelize |
Use Sequelize | - | |
--mongoose |
Use Mongoose | - | |
--no-orm |
Skip ORM setup | - | |
| Database | |||
--postgresql, --postgres |
PostgreSQL database | - | β Default |
--mysql |
MySQL database | - | |
--sqlite |
SQLite database | - | |
--mongodb |
MongoDB database | - | Auto with Mongoose |
| TypeScript Features | |||
--aliases |
Enable path aliases | - | β Default for TS |
--no-aliases |
Disable path aliases | - | |
| Authentication | |||
--jwt |
JWT authentication | - | |
--oauth |
OAuth (Google, GitHub) | - | |
--session |
Session-based auth | - | |
--no-auth |
Skip authentication | - | β Default |
| Testing | |||
--jest |
Use Jest | - | |
--vitest |
Use Vitest | - | |
--no-testing |
Skip testing setup | - | β Default |
| Code Quality | |||
--linting |
ESLint + Prettier + Husky | - | β Default |
--no-linting |
Skip linting setup | - | |
| DevOps | |||
--docker |
Add Docker support | - | |
--no-docker |
Skip Docker | - | β Default |
--github |
GitHub Actions CI/CD | - | |
--gitlab |
GitLab CI | - | |
--circleci |
CircleCI | - | |
--no-cicd |
Skip CI/CD setup | - | β Default |
Full-stack TypeScript API:
npx create-churn@latest my-api \
--ts \
--bun \
--http \
--cors \
--drizzle \
--postgresql \
--aliases \
--jwt \
--jest \
--linting \
--docker \
--githubMinimal JavaScript REST API:
npx create-churn@latest simple-api --js --npm --http --no-orm --no-auth --no-testing --no-linting --no-dockerWebSocket Server with MongoDB:
npx create-churn@latest realtime-server --ts --bun --ws --mongoose --mongodb --session --vitest --dockerMicroservice with TypeORM:
npx create-churn@latest user-service --ts --pnpm --http --typeorm --mysql --jwt --jest --linting --gitlab| Scenario | Command |
|---|---|
| Default setup | npx create-churn@latest |
| TypeScript only | npx create-churn@latest my-app --ts |
| JavaScript only | npx create-churn@latest my-app --js |
| With authentication | npx create-churn@latest my-app --jwt |
| With testing | npx create-churn@latest my-app --jest |
| Production ready | npx create-churn@latest my-app --jwt --jest --linting --docker --github |
| MongoDB stack | npx create-churn@latest my-app --mongoose --mongodb --session |
| No database | npx create-churn@latest my-app --no-orm |
| WebSocket | npx create-churn@latest my-app --ws |
| Minimal setup | npx create-churn@latest my-app --js --no-orm --no-auth --no-testing --no-linting --no-docker |
Production-ready API with authentication, testing, and deployment configuration.
Interactive:
npx create-churn@latest
# Select: TypeScript β Bun β HTTP β CORS β Drizzle β PostgreSQL β
# Path aliases β JWT β Jest β Linting β Docker β GitHub ActionsCLI Flags (v1.2.0):
npx create-churn@latest production-api \
--ts --bun --http --cors \
--drizzle --postgresql \
--aliases --jwt --jest \
--linting --docker --githubWhat you get:
- TypeScript with path aliases (
@/config,@/models) - Drizzle ORM with PostgreSQL
- JWT authentication with middleware
- Jest testing with coverage
- ESLint + Prettier + Husky
- Docker multi-stage build
- GitHub Actions CI/CD
Lightweight Express server with no dependencies, ready to customize.
Interactive:
npx create-churn@latest
# Select: JavaScript β npm β HTTP β No CORS β No ORM β
# No auth β No testing β No linting β No docker β No CI/CDCLI Flags (v1.2.0):
npx create-churn@latest simple-api \
--js --npm --http --no-cors \
--no-orm --no-auth --no-testing \
--no-linting --no-docker --no-cicdWhat you get:
- Plain JavaScript
- Express HTTP server
- No database (add your own)
- Minimal dependencies
- Quick prototyping setup
WebSocket server with database persistence and testing.
Interactive:
npx create-churn@latest
# Select: TypeScript β Bun β WebSocket β Sequelize β SQLite β
# Path aliases β No auth β Vitest β Linting β DockerCLI Flags (v1.2.0):
npx create-churn@latest realtime-server \
--ts --bun --ws \
--sequelize --sqlite \
--aliases --no-auth \
--vitest --linting --dockerWhat you get:
- WebSocket server (ws library)
- Sequelize ORM with SQLite
- Vitest for testing WebSocket events
- Docker with health checks
- Linting and formatting
MongoDB-backed API with session authentication and CI/CD.
Interactive:
npx create-churn@latest
# Select: TypeScript β pnpm β HTTP β CORS β Mongoose β MongoDB β
# Path aliases β Session β Jest β Linting β CircleCICLI Flags (v1.2.0):
npx create-churn@latest user-service \
--ts --pnpm --http --cors \
--mongoose --mongodb \
--aliases --session --jest \
--linting --circleciWhat you get:
- Mongoose ODM with MongoDB
- Session-based authentication
- Express session configuration
- Jest with MongoDB memory server
- CircleCI pipeline
- Environment validation (Zod)
Full-featured API with Prisma, OAuth, and comprehensive tooling.
Interactive:
npx create-churn@latest
# Select: TypeScript β yarn β HTTP β CORS β Prisma β MySQL β
# Path aliases β OAuth β Jest β Linting β Docker β GitLab CICLI Flags (v1.2.0):
npx create-churn@latest enterprise-api \
--ts --yarn --http --cors \
--prisma --mysql \
--aliases --oauth --jest \
--linting --docker --gitlabWhat you get:
- Prisma ORM with MySQL
- OAuth (Google + GitHub)
- Prisma Studio for database GUI
- Jest with Supertest
- Docker Compose with MySQL service
- GitLab CI/CD pipeline
Fastest way to get a running server.
Interactive:
npx create-churn@latest
# Just press Enter for all defaultsCLI Flags (v1.2.0):
npx create-churn@latest my-prototype
# Uses all defaults: TS + Bun + HTTP + CORS + Prisma + PostgreSQLWhat you get:
- TypeScript + Bun (fastest runtime)
- HTTP REST API with CORS
- Prisma with PostgreSQL
- Path aliases enabled
- No auth, testing, or Docker
- ESLint + Prettier by default
| ORM | PostgreSQL | MySQL | SQLite | MongoDB |
|---|---|---|---|---|
| Prisma | [x] | [x] | [x] | [ ] |
| Drizzle | [x] | [x] | [x] | [ ] |
| TypeORM | [x] | [x] | [x] | [ ] |
| Sequelize | [x] | [x] | [x] | [ ] |
| Mongoose | [ ] | [ ] | [ ] | [x] |
| Language | Bun | npm | yarn | pnpm |
|---|---|---|---|---|
| TypeScript | [x] | [x] | [x] | [x] |
| JavaScript | [x] | [x] | [x] | [x] |
| Framework | TypeScript | JavaScript |
|---|---|---|
| Jest | [x] | [x] |
| Vitest | [x] | [x] |
Your project comes with useful npm scripts:
{
"scripts": {
"dev": "Start development server with watch mode",
"build": "Build for production",
"start": "Start production server",
"test": "Run tests",
"test:coverage": "Run tests with coverage",
"lint": "Lint and fix code",
"format": "Format code with Prettier",
"db:generate": "Generate database client/types",
"db:migrate": "Run database migrations",
"db:studio": "Open database GUI (Prisma/Drizzle)"
}
}- ORM Guides: Each ORM comes with configured examples
- Auth Examples: JWT tokens, OAuth flows, session management
- Testing: Pre-configured test suites
- Docker: Multi-stage builds with database services
- CI/CD: Automated workflows for testing and deployment
git clone https://github.com/Basharkhan7776/Churn.git
cd Churn
bun installbun run dev# Run all tests
bun test
# Run specific test
bun test-cli.ts
# Deep validation
bun deep-test.ts
# CORS verification
bun verify-cors.tsbun run buildAll features are thoroughly tested:
- [+] 5/5 CLI tests passed
- [+] 62/62 Deep validation checks passed
- [+] 0 TypeScript errors
- [+] 0 Build errors
- Multiple ORMs (Prisma, Drizzle, TypeORM, Sequelize, Mongoose)
- Multiple databases (PostgreSQL, MySQL, SQLite, MongoDB)
- Authentication (JWT, OAuth, Session)
- Testing frameworks (Jest, Vitest)
- Linting & formatting (ESLint, Prettier, Husky)
- Docker support
- CI/CD templates
- Optional CORS
- CLI flags (non-interactive mode)
- GraphQL support
- API documentation (Swagger/OpenAPI)
- More auth providers (Auth0, Supabase)
- Deployment templates (Vercel, Railway, Fly.io)
- Plugin system
- Custom templates
- GUI interface
- Migration tool
We welcome contributions! Here's how to get started:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Add tests for your changes
- Ensure all tests pass (
bun test) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- New ORM integrations
- New CI/CD platforms
- Deployment templates
- Documentation improvements
- Bug fixes
MIT License - Copyright (c) Bashar Khan
Built with:
- Bun - Fast JavaScript runtime
- TypeScript - Type-safe JavaScript
- Prompts - Interactive CLI prompts
- Chalk - Terminal styling
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Star us: If you find this useful, please star the repo!
Made with <3 by Bashar Khan
Note: This CLI is under active development. More features coming soon!