{"id":29404745,"url":"https://github.com/bernabedev/bklar","last_synced_at":"2026-03-05T20:04:55.099Z","repository":{"id":303443588,"uuid":"1015439497","full_name":"bernabedev/bklar","owner":"bernabedev","description":"Minimal, fast, and modern web framework for Bun","archived":false,"fork":false,"pushed_at":"2026-02-03T14:25:49.000Z","size":1755,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-04T04:26:42.839Z","etag":null,"topics":["bklar","bun","fast","framework"],"latest_commit_sha":null,"homepage":"https://bklar.vercel.app","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/bernabedev.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":"AGENTS.md","dco":null,"cla":null}},"created_at":"2025-07-07T13:58:01.000Z","updated_at":"2026-02-03T14:27:36.000Z","dependencies_parsed_at":"2025-07-17T07:39:04.997Z","dependency_job_id":null,"html_url":"https://github.com/bernabedev/bklar","commit_stats":null,"previous_names":["bernabedev/bklar"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/bernabedev/bklar","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bernabedev%2Fbklar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bernabedev%2Fbklar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bernabedev%2Fbklar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bernabedev%2Fbklar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bernabedev","download_url":"https://codeload.github.com/bernabedev/bklar/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bernabedev%2Fbklar/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30148052,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T16:58:46.102Z","status":"ssl_error","status_checked_at":"2026-03-05T16:58:45.706Z","response_time":93,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["bklar","bun","fast","framework"],"created_at":"2025-07-10T21:01:21.972Z","updated_at":"2026-03-05T20:04:55.094Z","avatar_url":"https://github.com/bernabedev.png","language":"TypeScript","readme":"# bklar 🐰\n\n[![NPM Version](https://img.shields.io/npm/v/bklar.svg)](https://www.npmjs.com/package/bklar)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Tests](https://img.shields.io/github/actions/workflow/status/bernabedev/bklar/test.yml?branch=main\u0026label=tests)](https://github.com/bernabedev/bklar/actions)\n\n**bklar** (pronounced *buh-klar*) is a minimalist, high-performance web framework built specifically for [Bun](https://bun.sh/).\n\nDesigned for production excellence, it combines the raw speed of Bun with a robust ecosystem, first-class TypeScript support, and a developer experience inspired by the best modern frameworks.\n\n---\n\n## ✨ Features\n\n- 🚀 **Native Speed:** Built directly on `Bun.serve` and `Bun.file`. No Node.js compatibility overhead.\n- 🛡️ **Type-Safe Validation:** Integrated [Zod](https://zod.dev/) support. Inputs and outputs are validated and strongly typed automatically.\n- 🔌 **Native WebSockets:** Real-time support integrated directly into the core router.\n- 🔋 **Batteries Included:** A complete ecosystem of official packages for Security, Performance, and Utilities.\n- 📝 **Auto-Documentation:** Generate OpenAPI 3.1 specs and Swagger UI automatically from your code.\n- 🎨 **Minimalist API:** A clear, expressive syntax that stays out of your way.\n\n## 🚀 Getting Started\n\nThe best way to start is using the official CLI. It provides interactive templates for different use cases.\n\n```bash\nbun create bklar my-app\n```\n\nNavigate to your new project and start the server:\n\n```bash\ncd my-app\nbun install\nbun run dev\n```\n\n## ⚡ Quick Look\n\nHere is a complete API endpoint with validation, parameters, and JSON response.\n\n```typescript\nimport { Bklar } from \"bklar\";\nimport { z } from \"zod\";\n\nconst app = Bklar();\n\n// GET /users/123\napp.get(\n  \"/users/:id\",\n  (ctx) =\u003e {\n    // ctx.params.id is strictly typed as a number here!\n    return ctx.json({ \n      id: ctx.params.id, \n      name: \"Bun User\" \n    });\n  },\n  {\n    schemas: {\n      // Automatic validation and coercion\n      params: z.object({ id: z.coerce.number() })\n    }\n  }\n);\n\napp.listen(3000);\n```\n\n## 🔌 Real-Time (WebSockets)\n\nBklar v2 supports WebSockets natively. No external plugins required.\n\n```typescript\napp.ws(\"/chat\", {\n  open(ws) {\n    console.log(\"Client connected\");\n    ws.subscribe(\"global-chat\");\n  },\n  message(ws, msg) {\n    // Native Pub/Sub support\n    ws.publish(\"global-chat\", `New message: ${msg}`);\n  }\n});\n```\n\n## 🌳 The Ecosystem\n\nBklar v2 comes with a suite of official, high-performance packages designed to work perfectly together.\n\n### Security\n- **[@bklarjs/helmet](https://npmjs.com/package/@bklarjs/helmet):** Secure your app with essential HTTP headers (CSP, HSTS, XSS).\n- **[@bklarjs/cors](https://npmjs.com/package/@bklarjs/cors):** Cross-Origin Resource Sharing middleware.\n- **[@bklarjs/jwt](https://npmjs.com/package/@bklarjs/jwt):** JSON Web Token authentication.\n- **[@bklarjs/rate-limit](https://npmjs.com/package/@bklarjs/rate-limit):** Protection against brute-force and DDoS attacks.\n\n### Performance\n- **[@bklarjs/cache](https://npmjs.com/package/@bklarjs/cache):** Server-side caching with ETag support and pluggable stores (Redis/Memory).\n- **[@bklarjs/compression](https://npmjs.com/package/@bklarjs/compression):** Gzip/Deflate compression using Bun's native APIs.\n\n### Utilities\n- **[@bklarjs/logger](https://npmjs.com/package/@bklarjs/logger):** Production-ready structured logging (JSON) with request correlation.\n- **[@bklarjs/upload](https://npmjs.com/package/@bklarjs/upload):** Handle multipart file uploads (Memory or Disk).\n- **[@bklarjs/swagger](https://npmjs.com/package/@bklarjs/swagger):** Auto-generated OpenAPI documentation and Swagger UI.\n- **[@bklarjs/cron](https://npmjs.com/package/@bklarjs/cron):** Schedule background tasks and jobs.\n- **[@bklarjs/static](https://npmjs.com/package/@bklarjs/static):** Serve static files efficiently.\n\n## 🛡️ Error Handling\n\nThrow standard errors from anywhere in your application, and Bklar will handle the response codes for you.\n\n```typescript\nimport { NotFoundError } from \"bklar/errors\";\n\napp.get(\"/item/:id\", (ctx) =\u003e {\n  const item = db.find(ctx.params.id);\n  \n  if (!item) {\n    // Automatically returns 404 with JSON body\n    throw new NotFoundError(\"Item not found\");\n  }\n  \n  return ctx.json(item);\n});\n```\n\n## 🤝 Contributing\n\nContributions are welcome! If you have ideas, suggestions, or find a bug, please open an [issue](https://github.com/bernabedev/bklar/issues) or submit a Pull Request.\n\n## 📄 License\n\nThis project is licensed under the **MIT License**.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbernabedev%2Fbklar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbernabedev%2Fbklar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbernabedev%2Fbklar/lists"}