{"id":16218349,"url":"https://github.com/firesquid6/delb-stack","last_synced_at":"2026-04-29T00:34:22.479Z","repository":{"id":226842591,"uuid":"767170653","full_name":"FireSquid6/delb-stack","owner":"FireSquid6","description":"Drizzle, Elysia, Lucia, and Bun","archived":false,"fork":false,"pushed_at":"2024-03-17T23:07:04.000Z","size":399,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-07T23:23:18.494Z","etag":null,"topics":["backend","bun","bun-js","drizzle-orm","full-stack","lucia","lucia-auth","stack"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FireSquid6.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2024-03-04T20:33:59.000Z","updated_at":"2024-03-16T22:28:58.000Z","dependencies_parsed_at":"2024-11-05T20:17:56.029Z","dependency_job_id":null,"html_url":"https://github.com/FireSquid6/delb-stack","commit_stats":null,"previous_names":["firesquid6/delb-stack"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/FireSquid6/delb-stack","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FireSquid6%2Fdelb-stack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FireSquid6%2Fdelb-stack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FireSquid6%2Fdelb-stack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FireSquid6%2Fdelb-stack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FireSquid6","download_url":"https://codeload.github.com/FireSquid6/delb-stack/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FireSquid6%2Fdelb-stack/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32405901,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-28T19:38:08.556Z","status":"ssl_error","status_checked_at":"2026-04-28T19:37:55.688Z","response_time":56,"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":["backend","bun","bun-js","drizzle-orm","full-stack","lucia","lucia-auth","stack"],"created_at":"2024-10-10T11:49:12.785Z","updated_at":"2026-04-29T00:34:22.463Z","avatar_url":"https://github.com/FireSquid6.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# The DELB Stack\n\n`D`rizzle [Site](https://orm.drizzle.team/)\n\n`E`lysia [Site](https://elysiajs.com/)\n\n`L`ucia [Site](https://lucia-auth.com/)\n\n`B`un [Site](https://bun.sh/)\n\nYou may notice that this doesn't include a database. We use whatever SQL service fits our use case best. This could be:\n\n- [Supabase](https://supabase.com/)\n- [Neon](https://neon.tech/)\n- [Turso](https://turso.tech/)\n- Bun's SQLite API\n- Self hosted:\n  - Postgres\n  - MySQL\n  - SQLite\n\nYou may also notice that there is no frontend. This is because DELB believes that the frontend and backend should remain separate. Your frontend can be whatever you're most familiar with or whatever suits your needs best. This means that DELB can be used in:\n\n- Web Apps\n- Desktop Apps\n- Mobile Apps\n- Plain API services\n- all of the above!\n\n# Values\n\n1. Frontend independence\n2. Simplicity\n3. Transparent abstraction\n4. Cloud Agnosticism\n5. Portability\n6. Testability\n\n# Abstraction Model\n\nDelb uses the following layers of abstraction:\n\n```mermaid\nflowchart TD\n    A(Client) \u003c--\u003e Codebase\n    subgraph Codebase\n    B(Elysia API)\n    B \u003c--\u003e C(Capsule)\n    C \u003c--\u003e D(Drizzle ORM)\n    end\n    D \u003c--\u003eE[(Database)]\n```\n\nThese are:\n\n- Client - your client code. Whatever frontend you feel like using.\n- API - Your main API exposed to the internet. It is built in Elysia using a file system router. It communicates with the client over HTTP (as well as [eden treaties](https://elysiajs.com/eden/treaty). Don't slack on them.)\n- Capsule - This serves as a \"gateway\" between your API and database. It can be mocked out to allow for testing of just the logic of the API.\n- Drizzle ORM - Drizzle ORM is how you communicate with your database. It allow you to easily swap your database or cloud provider without touching your code or schema.\n\nThere's a bit of confusion around what code should go in your API routes and what should go in your capsule. In general:\n\n- If the piece of code is part of the logic of your application, it should go in the `api` directory in its respective route, or in the `lib`\n- If the piece of code deals with the actual fetching or pushing of data through drizzle, it should go in the `capsule` directory\n\nSome helpful rules for doing this \"\"\"right\"\"\":\n\n## Testing\nYou should have three test groups:\n  1. Logic - tests a client communicating to an API with a mocked database capsule. Should mostly focus on validating application logic.\n  1. Schema - tests the capsule communicating through drizzle to validate the schema of your application.\n  1. E2E - a full test of your system doing what it's supposed to do\nYou can bring whatever test runner you prefer. I find that bun's test runner typically does the job just fine.\n\n# Example Project Filesystem\n\n```\n/ \u003cmy project\u003e\n  /website\n    \u003cwhatever code your website needs\u003e\n  /mobile\n    \u003cwhatever code your mobile app needs\u003e\n  /app --\u003e should be its own package\n    package.json\n    .gitignore\n    drizzle.config.ts\n    migrate.ts\n\n    /db --\u003e Handles connection to database\n    /lib --\u003e Helper modules to keep your codebase dry\n    /api --\u003e Filesystem router, like next js\n      index.ts\n      users/\n        index.ts\n      ...\n    /capsule --\u003e Handles talking to drizzle\n      user.ts\n      posts.ts\n    /migrations\n    /tests\n      /schema\n        ...\n      /logic\n        ...\n      /e2e\n        ...\n\n```\n\n# Deploying\n\nSince we value cloud agnosticism, DELB is designed to be deployed anywhere. Some common options are:\n\n- [fly.io](https://fly.io) with docker\n- AWS/Google with docker\n- Nix (my personal favorite)\n\n# `create-delb-app`\n\nCreate delb app is still being worked on. We plan to have options for:\n\n- Using a minimal or preconfigured example app\n- choosing your database\n- using docker or nix\n- bootstrapping a frontend\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffiresquid6%2Fdelb-stack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffiresquid6%2Fdelb-stack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffiresquid6%2Fdelb-stack/lists"}