{"id":18052617,"url":"https://github.com/cham11ng/bun-api-starter","last_synced_at":"2025-04-10T19:42:02.494Z","repository":{"id":225955797,"uuid":"766796981","full_name":"cham11ng/bun-api-starter","owner":"cham11ng","description":"Bun (🍔) ElysiaJS / MongoDB API Starter","archived":false,"fork":false,"pushed_at":"2024-08-28T18:30:31.000Z","size":324,"stargazers_count":26,"open_issues_count":2,"forks_count":5,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-24T17:21:16.771Z","etag":null,"topics":["bun","docker","elysia","elysiajs","good-first-issue","hacktoberfest","mongodb"],"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/cham11ng.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":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-04T06:25:34.000Z","updated_at":"2025-03-23T10:52:53.000Z","dependencies_parsed_at":"2024-04-29T03:45:40.883Z","dependency_job_id":"9fcba9c8-1092-42b6-86d3-b581d5a15c99","html_url":"https://github.com/cham11ng/bun-api-starter","commit_stats":null,"previous_names":["cham11ng/bun-api-starter"],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cham11ng%2Fbun-api-starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cham11ng%2Fbun-api-starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cham11ng%2Fbun-api-starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cham11ng%2Fbun-api-starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cham11ng","download_url":"https://codeload.github.com/cham11ng/bun-api-starter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248281415,"owners_count":21077423,"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","docker","elysia","elysiajs","good-first-issue","hacktoberfest","mongodb"],"created_at":"2024-10-30T23:12:30.503Z","updated_at":"2025-04-10T19:42:02.475Z","avatar_url":"https://github.com/cham11ng.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bun-api-starter\n\n[![Bun (🍔) API Starter CI](https://github.com/cham11ng/bun-api-starter/actions/workflows/ci.yml/badge.svg)](https://github.com/cham11ng/bun-api-starter/actions/workflows/ci.yml)\n\nA robust Bun-based API starter built using ElysiaJS framework, and MongoDB as database. ElysiaJS, a type-safe and fast framework. MongoDB, a powerful NoSQL database. This starter offers a solid foundation for your API development, allowing you to focus on your unique business logic.\n\n## Getting Started\n\nTo install bun and starter packages.\n\n```bash\ncurl -fsSL https://bun.sh/install | bash\n\nbun install\n```\n\n## Development\n\nTo start the development server run:\n\n```bash\n$ bun run dev\nEnvironment: development\nBun (🍔) API Starter is running at localhost:8000\nInfo: MongoDB connection successful: starter\n```\n\nOpen \u003chttp://localhost:8000/docs\u003e with your browser to see the result.\n\n### cURL\n\n```bash\ncurl --request POST \\\n  --url http://localhost:8000/login \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"email\": \"mail@example.com\",\n  \"password\": \"secret@123\"\n}'\n```\n\n### Docker\n\n```bash\n# development\n$ docker compose up -d dev\n[+] Running 2/3\n ⠋ Network bun-api-starter_default  Created           1.0s\n ✔ Container starter-mongodb        Started           0.5s\n ✔ Container starter-dev            Started           0.9s\n\n# check logs\n$ docker compose logs -f\n```\n\n```bash\n# production\ndocker build --target production -t bun-api-starter-prod .\ndocker run -d --rm --env-file .env.docker \\\n  -p 8080:8000 \\\n  -t bun-api-starter-prod:latest\n```\n\n### MongoDB Compass\n\n```bash\n# connect URI for root user.\nmongodb://rootuser:root%40123@localhost:27017/starter?authSource=admin\n```\n\n## Troubleshooting\n\n```bash\n# on default export error\nconst app = new Elysia();\nexport default app;\n\n# double bun server initiated.\n$ Bun (🍔) API Starter is running at localhost:8000\nStarted server http://localhost:3000\n\n# do this\nexport const app = new Elysia();\n```\n\n\n```js\n// exception not captured onError.\nfunction controller(context: Context) {}\n\n// do this\nconst controller = (context: Context) =\u003e {}\n```\n\n## Happy Coding\n\n\u003e @cham11ng\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcham11ng%2Fbun-api-starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcham11ng%2Fbun-api-starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcham11ng%2Fbun-api-starter/lists"}