{"id":27928419,"url":"https://github.com/mhdzhhan/bun-basket","last_synced_at":"2025-05-07T02:07:07.579Z","repository":{"id":291461113,"uuid":"977688631","full_name":"mhdZhHan/bun-basket","owner":"mhdZhHan","description":"🎯 Zero ORM,  SQL experiments with Bun + PostgreSQL","archived":false,"fork":false,"pushed_at":"2025-05-04T19:10:37.000Z","size":28,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-07T02:07:02.681Z","etag":null,"topics":["bun","bun-sql","express","neon","postgresql"],"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/mhdZhHan.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,"zenodo":null}},"created_at":"2025-05-04T18:59:12.000Z","updated_at":"2025-05-04T19:12:30.000Z","dependencies_parsed_at":"2025-05-04T20:32:34.047Z","dependency_job_id":null,"html_url":"https://github.com/mhdZhHan/bun-basket","commit_stats":null,"previous_names":["mhdzhhan/bun-basket"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhdZhHan%2Fbun-basket","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhdZhHan%2Fbun-basket/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhdZhHan%2Fbun-basket/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhdZhHan%2Fbun-basket/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mhdZhHan","download_url":"https://codeload.github.com/mhdZhHan/bun-basket/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252798852,"owners_count":21805887,"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","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":["bun","bun-sql","express","neon","postgresql"],"created_at":"2025-05-07T02:07:06.661Z","updated_at":"2025-05-07T02:07:07.559Z","avatar_url":"https://github.com/mhdZhHan.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🛍️ Bun Basket\n\nA lightweight, secure, and scalable REST API for managing products, built with **Express**, **TypeScript**, and **Bun**. It includes a powerful migration script, input validation, and structured logging out of the box.\n\n## 🚀 Features\n\n- 🧱 Type-safe environment config using Zod\n- 🔐 Security with Helmet\n- 🧾 Structured logging via Pino\n- ✅ Request validation with Zod schemas\n- ⚡ Ultra-lightweight SQL queries using `bun-sql`\n- 📦 Products CRUD API\n- 🧙‍♂️ Superpowered `migrate.ts` for handling database migrations (with advisory locks!)\n\n## 🔧 Setup\n\n1. **Clone the repo**\n\n```bash\ngit clone https://github.com/mhdZhHan/bun-basket\ncd bun-basket\n```\n\n2. **Install dependencies**\n\n```bash\nbun install\n```\n\n3. **Set up environment variables**\n   Create a `.env` file based on `env.ts` schema:\n\n```env\nDATABASE_URL=\nPGHOST=\nPGDATABASE=\nPGUSER=\nPGPASSWORD=\nARCJET_KEY=\nARCJET_ENV=\n```\n\n4. **Run migrations**\n\n```bash\nbun run migrate.ts up\n```\n\n5. **Start the server**\n\n```bash\nbun run index.ts\n```\n\n## 🧙 Migrations\n\nThis project includes a custom migration system:\n\n- `bun run migrate.ts up` – Apply new migrations\n- `bun run migrate.ts down` – Rollback applied migrations\n- Uses **PostgreSQL advisory locks** to prevent race conditions\n- Tracks executed migrations in a custom table\n\nMigration files live in:\n\n```bash\nserver/db/migrations/\n```\n\n## ✅ Example Request\n\n```bash\ncurl http://localhost:8080/api/products\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmhdzhhan%2Fbun-basket","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmhdzhhan%2Fbun-basket","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmhdzhhan%2Fbun-basket/lists"}