{"id":33309132,"url":"https://github.com/bendhq/bend","last_synced_at":"2026-04-11T09:35:53.444Z","repository":{"id":322779316,"uuid":"1090825170","full_name":"bendhq/bend","owner":"bendhq","description":"Bend - The modern backend project generator and bundler. Create production-ready backend apps instantly with your favorite stack - TypeScript or JavaScript, Express or Fastify, Prisma or Mongoose - all preconfigured with nodemon, esbuild, and smart templates","archived":false,"fork":false,"pushed_at":"2025-11-13T08:34:02.000Z","size":91,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-13T10:22:09.195Z","etag":null,"topics":["backend","bundler","cli","express","fastify","javascript","mongoose","nodejs","prisma","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bendhq.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-06T07:28:01.000Z","updated_at":"2025-11-09T08:48:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"0419bf7e-bf4c-418e-923b-597459de4dd8","html_url":"https://github.com/bendhq/bend","commit_stats":null,"previous_names":["bendhq/bend"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bendhq/bend","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bendhq%2Fbend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bendhq%2Fbend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bendhq%2Fbend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bendhq%2Fbend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bendhq","download_url":"https://codeload.github.com/bendhq/bend/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bendhq%2Fbend/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":285170109,"owners_count":27126456,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-11-19T02:00:05.673Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["backend","bundler","cli","express","fastify","javascript","mongoose","nodejs","prisma","typescript"],"created_at":"2025-11-19T02:00:37.363Z","updated_at":"2026-04-11T09:35:53.431Z","avatar_url":"https://github.com/bendhq.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/bendhq/bend/main/packages/bend-core/public/bend_logo.png\" width=\"200\" alt=\"Bend Logo\" /\u003e\n\u003c/p\u003e\n\n# Bend - The Backend Bundler\n\n[![npm version](https://img.shields.io/npm/v/bend-core.svg)](https://www.npmjs.com/package/bend-core)\n[![CI](https://github.com/bendhq/bend/actions/workflows/ci.yml/badge.svg)](https://github.com/bendhq/bend/actions/workflows/ci.yml)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](./LICENSE)\n![Node.js Version](https://img.shields.io/badge/node-%3E%3D18.0.0-brightgreen)\n![Bun Version](https://img.shields.io/badge/bun-%3E%3D1.0.0-orange)\n\n**Bend is a production-ready backend scaffolder** that creates secure, optimized backend projects with enterprise-grade features baked in from day one.\n\n## Why Bend?\n\n- **Production-Ready Security**: helmet(), cors(), rate limiting, and HPP protection out of the box\n- **Enterprise Logging**: Winston with daily rotation, structured metadata, and HTTP request logging\n- **Smart Detection**: Auto-detects runtime (Node.js/Bun) and package manager (npm/pnpm/yarn/bun)\n- **Multiple Stacks**: 8 template combinations (TypeScript/JavaScript × Express/Fastify × Mongoose/Prisma)\n- **Zero Configuration**: Works immediately, customizable when needed\n- **TypeScript First**: Full TypeScript support with strict mode enabled\n\n## Quick Start\n\n### Recommended: Using npm create\n\n```bash\n# Latest version\nnpm create bend@latest\n\n# With project name\nnpm create bend@latest my-backend\n```\n\n### Other Package Managers\n\n```bash\n# Using pnpm\npnpm create bend\n\n# Using yarn\nyarn create bend\n\n# Using bun\nbunx create-bend\n```\n\n## What You Get\n\nEvery Bend project includes:\n\n### Security (Production-Ready)\n\n- **[helmet](https://helmetjs.github.io/)** - Sets security HTTP headers\n- **[cors](https://github.com/expressjs/cors)** - Configurable cross-origin resource sharing\n- **[rate-limit](https://github.com/express-rate-limit/express-rate-limit)** - DDoS protection (100 req/15min per IP)\n- **[hpp](https://github.com/analog-nico/hpp)** - HTTP parameter pollution prevention\n- **Body size limits** - Prevents memory exhaustion (10MB default)\n- **Error sanitization** - Hides sensitive info in production\n- **Compression** - gzip/deflate response compression\n\n### Logging \u0026 Monitoring\n\n- **[Winston](https://github.com/winstonjs/winston)** - Enterprise-grade logging\n- **Daily log rotation** - Automatic archival (30-day retention)\n- **Separate log files** - error.log, combined.log, exceptions.log\n- **HTTP request logging** - Morgan middleware integration\n- **Structured metadata** - JSON format for easy parsing\n- **Production-ready** - Compatible with DataDog, Splunk, ELK, CloudWatch\n\n### Error Handling\n\n- **Async error handling** - `express-async-errors` for cleaner code\n- **Centralized error middleware** - Single point for error handling\n- **Graceful shutdown** - Proper cleanup on SIGTERM/SIGINT\n- **Unhandled rejection handlers** - No silent crashes\n\n### Developer Experience\n\n- **TypeScript strict mode** - Maximum type safety\n- **ESLint + Prettier** - Code quality and formatting\n- **Environment variables** - .env file support with dotenv\n- **Project structure** - Clean, scalable architecture\n- **Example models** - User model to get started quickly\n\n## Tech Stack Options\n\n### Runtimes\n- **Node.js** (≥18.0.0) - Auto-detected\n- **Bun** (≥1.0.0) - Auto-detected\n\n### Languages\n- **TypeScript** (Recommended) - Full type safety\n- **JavaScript** (ESM) - Modern JavaScript\n\n### Frameworks\n- **Express** - Battle-tested, extensive ecosystem\n- **Fastify** - High performance, modern\n\n### Databases/ORMs\n- **MongoDB + Mongoose** - NoSQL with schema validation\n- **SQL + Prisma** - PostgreSQL, MySQL, SQLite support\n\n**Total: 8 template combinations**\n\n## Generated Project Structure\n\n```\nmy-backend/\n├── src/\n│   ├── config/\n│   │   ├── database.ts      # Database connection with retry logic\n│   │   └── logger.ts        # Winston logger with daily rotation\n│   ├── controllers/         # Route controllers\n│   │   └── health.controller.ts\n│   ├── models/              # Database models\n│   │   └── User.model.ts    # Example user model\n│   ├── routes/              # Express/Fastify routes\n│   │   └── health.routes.ts\n│   ├── services/            # Business logic layer\n│   ├── middlewares/         # Custom middlewares\n│   ├── utils/               # Utility functions\n│   ├── app.ts               # App configuration + middlewares\n│   └── server.ts            # Server entry point + graceful shutdown\n├── logs/                    # Auto-generated log directory\n│   ├── combined-YYYY-MM-DD.log\n│   ├── error-YYYY-MM-DD.log\n│   └── exceptions-YYYY-MM-DD.log\n├── .env                     # Environment variables\n├── .gitignore\n├── package.json\n├── tsconfig.json            # TypeScript strict mode\n└── README.md                # Project-specific README\n```\n\n## Example: What Your API Includes\n\n```typescript\n// src/app.ts - Security \u0026 Logging (Auto-generated)\n\nimport helmet from 'helmet';\nimport cors from 'cors';\nimport rateLimit from 'express-rate-limit';\nimport hpp from 'hpp';\nimport compression from 'compression';\nimport morgan from 'morgan';\nimport logger from './config/logger';\n\nconst app = express();\n\n// Security\napp.use(helmet());              // Security headers\napp.use(cors({ /* config */ })); // CORS\napp.use(hpp());                 // Parameter pollution prevention\n\n// Rate limiting\nconst limiter = rateLimit({\n  windowMs: 15 * 60 * 1000,    // 15 minutes\n  max: 100,                     // 100 requests per IP\n});\napp.use('/api/', limiter);\n\n// Logging\napp.use(morgan('combined', {\n  stream: { write: (msg) =\u003e logger.info(msg.trim()) }\n}));\n\n// Compression\napp.use(compression());\n\n// Your routes...\n```\n\n```typescript\n// src/config/logger.ts - Winston Logger (Auto-generated)\n\nimport winston from 'winston';\nimport DailyRotateFile from 'winston-daily-rotate-file';\n\nconst logger = winston.createLogger({\n  level: 'info',\n  format: winston.format.json(),\n  transports: [\n    new DailyRotateFile({\n      filename: 'logs/error-%DATE%.log',\n      level: 'error',\n      maxFiles: '30d',\n    }),\n    new DailyRotateFile({\n      filename: 'logs/combined-%DATE%.log',\n      maxFiles: '30d',\n    }),\n  ],\n});\n```\n\n## Published Packages\n\nBend is published as three npm packages:\n\n### 1. `create-bend` (Recommended)\n\nInitializer package used via `npm create bend`.\n\n```bash\nnpm create bend@latest\n```\n\n**What it does**: Downloads and runs `bend-core` automatically.\n\n### 2. `bend-core`\n\nCore library with all templates and scaffolding logic.\n\n```bash\nnpx bend-core\n```\n\n**Use case**: Direct usage or programmatic access.\n\n### 3. `bendjs`\n\nGlobal CLI wrapper (optional).\n\n```bash\nnpm install -g bendjs\nbend\n```\n\n**Use case**: For users who prefer global installation.\n\n## Development\n\n### Prerequisites\n\n- Node.js ≥18.0.0\n- pnpm (recommended)\n\n### Setup\n\n```bash\n# Clone repository\ngit clone https://github.com/bendhq/bend.git\ncd bend\n\n# Install dependencies\npnpm install\n\n# Build all packages\npnpm build\n\n# Run linting\npnpm lint\n\n# Format code\npnpm format\n```\n\n### Project Structure (Monorepo)\n\n```\nbend/\n├── packages/\n│   ├── create-bend/        # npm create initializer\n│   │   ├── bin/\n│   │   │   └── index.js    # Delegates to bend-core\n│   │   └── package.json\n│   ├── bend-cli/           # Global CLI wrapper (bendjs)\n│   │   ├── bin/\n│   │   │   └── bend.js     # Wrapper script\n│   │   └── package.json\n│   └── bend-core/          # Core library\n│       ├── src/\n│       │   ├── cli/        # CLI implementation\n│       │   ├── scaffold/   # Project scaffolding\n│       │   │   └── templates/  # All 8 templates\n│       │   ├── types/      # TypeScript types\n│       │   └── utils/      # Utilities\n│       └── package.json\n├── scripts/                # Build scripts\n├── .github/\n│   └── workflows/\n│       └── ci.yml          # CI/CD pipeline\n├── package.json            # Root package\n├── pnpm-workspace.yaml     # Workspace config\n└── tsconfig.json           # TypeScript config\n```\n\n### Testing Locally\n\n```bash\n# Test CLI locally\nnode packages/bend-core/dist/cli/index.js my-test-project\n\n# Test with specific options\nnode packages/bend-core/dist/cli/index.js my-app --no-install\n```\n\n## Environment Variables\n\nConfigure your generated project via `.env`:\n\n```bash\n# Server\nPORT=3000\nNODE_ENV=development\n\n# Database (MongoDB example)\nMONGODB_URI=mongodb://localhost:27017/myapp\n\n# Database (Prisma example)\nDATABASE_URL=\"postgresql://user:password@localhost:5432/mydb\"\n\n# Security\nCORS_ORIGIN=https://yourdomain.com\n\n# Logging\nLOG_LEVEL=info  # error | warn | info | debug\n```\n\n## Roadmap\n\n- [x] Core CLI functionality\n- [x] Multiple runtime support (Node.js, Bun)\n- [x] Express \u0026 Fastify frameworks\n- [x] Mongoose \u0026 Prisma ORMs\n- [x] TypeScript \u0026 JavaScript\n- [x] Security middlewares (helmet, cors, rate-limit, hpp)\n- [x] Winston logging with daily rotation\n- [x] GitHub Actions CI/CD\n- [x] ESLint + Prettier\n- [ ] Docker support\n- [ ] Authentication templates (JWT, OAuth)\n- [ ] Testing setup (Jest)\n- [ ] API documentation (Swagger/OpenAPI)\n- [ ] GraphQL support\n- [ ] Microservices templates\n\n## Contributing\n\nWe welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.\n\n1. Fork the repository\n2. Create your feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'feat: add amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\n## License\n\nMIT © [Bend](https://github.com/bendhq/bend)\n\n## Links\n\n- **GitHub**: https://github.com/bendhq/bend\n- **npm (bend-core)**: https://www.npmjs.com/package/bend-core\n- **npm (create-bend)**: https://www.npmjs.com/package/create-bend\n- **npm (bendjs)**: https://www.npmjs.com/package/bendjs\n- **Website**: https://bendhq.org\n- **Issues**: https://github.com/bendhq/bend/issues\n- **Discussions**: https://github.com/bendhq/bend/discussions\n\n## Credits\n\nBuilt with:\n- [TypeScript](https://www.typescriptlang.org/)\n- [Commander.js](https://github.com/tj/commander.js)\n- [@clack/prompts](https://github.com/natemoo-re/clack)\n- [EJS](https://ejs.co/)\n- [tsup](https://github.com/egoist/tsup)\n\n---\n\n**Bend** - Production-ready backends in seconds, not hours.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbendhq%2Fbend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbendhq%2Fbend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbendhq%2Fbend/lists"}