{"id":18014265,"url":"https://github.com/powerfulyang/cloudflare-worker-tutorial","last_synced_at":"2025-06-28T01:04:53.243Z","repository":{"id":203925231,"uuid":"693493489","full_name":"powerfulyang/cloudflare-worker-tutorial","owner":"powerfulyang","description":"The backend API is developed using a D1 database and Zod with OpenAPI integration, and it is hosted on Cloudflare Workers utilizing Hono.","archived":false,"fork":false,"pushed_at":"2025-04-12T08:12:56.000Z","size":2756,"stargazers_count":13,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-20T23:13:09.078Z","etag":null,"topics":["cloudflare-workers","d1","d1-database","hono"],"latest_commit_sha":null,"homepage":"https://life.littleeleven.com","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/powerfulyang.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}},"created_at":"2023-09-19T06:23:21.000Z","updated_at":"2025-03-19T02:07:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"9bf95a0e-b519-45ce-90ca-fdae5161bae0","html_url":"https://github.com/powerfulyang/cloudflare-worker-tutorial","commit_stats":null,"previous_names":["powerfulyang/cloudflare-worker","powerfulyang/cloudflare-worker-tutorial","piisy/cloudflare-worker-tutorial","powrrfulyang/cloudflare-worker-tutorial"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/powerfulyang/cloudflare-worker-tutorial","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/powerfulyang%2Fcloudflare-worker-tutorial","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/powerfulyang%2Fcloudflare-worker-tutorial/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/powerfulyang%2Fcloudflare-worker-tutorial/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/powerfulyang%2Fcloudflare-worker-tutorial/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/powerfulyang","download_url":"https://codeload.github.com/powerfulyang/cloudflare-worker-tutorial/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/powerfulyang%2Fcloudflare-worker-tutorial/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262357551,"owners_count":23298463,"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":["cloudflare-workers","d1","d1-database","hono"],"created_at":"2024-10-30T04:07:26.787Z","updated_at":"2025-06-28T01:04:53.181Z","avatar_url":"https://github.com/powerfulyang.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# A Comprehensive Cloudflare Workers Tutorial\n\n[![Deploy to Cloudflare Workers](https://deploy.workers.cloudflare.com/button)](https://deploy.workers.cloudflare.com/?url=https://github.com/powerfulyang/cloudflare-worker-tutorial)\n\n## Introduction\n\nThis tutorial will guide you step by step from scratch on how to develop your own API service using Cloudflare Workers.\n\nPreview: https://life.littleeleven.com\n\n## Install Dependencies\n\nRecommended to use [pnpm](https://pnpm.io/installation) to install dependencies\n\n```bash\npnpm install\n```\n\n## Configure wrangler\n\n### Configure D1 database\n\n\u003e Related documentation: https://developers.cloudflare.com/workers/wrangler/commands/#d1\n\nSet the `d1_database` field in `wrangler.toml` to your database information (**required**)\n\nExample:\n\n```toml\n[[d1_databases]]\nbinding = \"DB\"\ndatabase_name = \"\u003cdatabase-name\u003e\"\ndatabase_id = \"\u003cdatabase-id\u003e\"\n```\n\n### Sync table structure\n\nSync the sql files of `drizzle`, execute the following command using `d1 execute` command\n\n```bash\nwrangler d1 execute eleven --file .\\drizzle\\0000_reflective_dracula.sql\n```\n\n### Configure R2 bucket\n\nSet the `r2_bucket` field in `wrangler.toml` to your bucket information (**required**)\n\nExample:\n\n```toml\n[[r2_buckets]]\nbinding = \"BUCKET\"\nbucket_name = \"\u003cbucket-name\u003e\"\n```\n\n## Start local development server\n\nExecute the following command to start the local development server\n\n```bash\n# run your Worker in an ideal development workflow (with a local server, file watcher \u0026 more)\npnpm run start:local\n```\n\n## Test\n\n### Unit test\n\n```bash\npnpm run unit:test\n```\n\n### Integration test\n\n```bash\npnpm run e2e:test\n```\n\n## Deploy\n\n```bash\n# deploy your Worker globally to the Cloudflare network (update your wrangler.toml file for configuration)\npnpm run deploy\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpowerfulyang%2Fcloudflare-worker-tutorial","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpowerfulyang%2Fcloudflare-worker-tutorial","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpowerfulyang%2Fcloudflare-worker-tutorial/lists"}