{"id":23900114,"url":"https://github.com/matthewlynch/better-auth-react-router-cloudflare-d1","last_synced_at":"2025-06-15T12:06:44.509Z","repository":{"id":270896086,"uuid":"911774811","full_name":"matthewlynch/better-auth-react-router-cloudflare-d1","owner":"matthewlynch","description":"Example of Better Auth integrated with React Router (v7) which is setup to deploy to Cloudflare \u0026 use D1 for the database","archived":false,"fork":false,"pushed_at":"2025-02-24T20:51:34.000Z","size":282,"stargazers_count":13,"open_issues_count":2,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-15T11:47:22.167Z","etag":null,"topics":["better-auth","cloudflare","cloudflare-d1","drizzle-orm","react-router"],"latest_commit_sha":null,"homepage":"https://better-auth-react-router-cloudflare-d1.mattlynch.workers.dev","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/matthewlynch.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":"2025-01-03T20:22:09.000Z","updated_at":"2025-04-14T15:57:18.000Z","dependencies_parsed_at":"2025-04-15T11:48:54.713Z","dependency_job_id":null,"html_url":"https://github.com/matthewlynch/better-auth-react-router-cloudflare-d1","commit_stats":null,"previous_names":["matthewlynch/better-auth-react-router-cloudflare-d1"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/matthewlynch/better-auth-react-router-cloudflare-d1","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthewlynch%2Fbetter-auth-react-router-cloudflare-d1","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthewlynch%2Fbetter-auth-react-router-cloudflare-d1/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthewlynch%2Fbetter-auth-react-router-cloudflare-d1/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthewlynch%2Fbetter-auth-react-router-cloudflare-d1/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/matthewlynch","download_url":"https://codeload.github.com/matthewlynch/better-auth-react-router-cloudflare-d1/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthewlynch%2Fbetter-auth-react-router-cloudflare-d1/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259971379,"owners_count":22940012,"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":["better-auth","cloudflare","cloudflare-d1","drizzle-orm","react-router"],"created_at":"2025-01-04T19:14:33.516Z","updated_at":"2025-06-15T12:06:44.483Z","avatar_url":"https://github.com/matthewlynch.png","language":"TypeScript","funding_links":[],"categories":["Starter Kits"],"sub_categories":[],"readme":"# Better Auth + Drizzle + React Router on Cloudflare Workers with D1\n\nThis repo was generated from the [`react-router-cloudflare-d1` template](https://github.com/matthewlynch/react-router-cloudflare-d1)\n\nYou can start a react-router project from this repo by running:\n\n```\nnpx create-react-router@latest --template matthewlynch/better-auth-react-router-cloudflare-d1\n```\n\n## Getting Started\n\n1. Run `cp .dev-example.vars .dev.vars` to create an .env file you can use to override variables defined in `wrangler.toml` or set secret values you don't want to check into source control\n2. Update the `name` field in `wranlger.toml`\n3. Install dependencies `pnpm install`\n4. Create a database by running [`wrangler d1 create \u003cname\u003e`](https://developers.cloudflare.com/d1/wrangler-commands/#d1-create) and update `wranlger.toml` with the UUID and name for the database\n5. Add your GitHub OAuth Client ID/Secret \u0026 optionally your Cloudflare Account ID/Database UUID/Token to `.dev.vars` (you only need this when you want to view data via Drizzle Studio for your remote database)\n6. Run `pnpm typegen` any time you make changes to `wranlger.toml` to ensure types from bindings and module rules are up to date for type safety\n7. Run `pnpm db:warm` to ensure wrangler has created a local database\n8. Run `pnpm db:migrate` to apply the migration files to your local database\n9. Run `pnpm dev` to start the app\n\n## Better Auth config\n\n1. Make changes to the `better-auth` config in `./app/auth/auth.server.ts`\n2. Run `pnpm auth:db:generate` to create the `better-auth` drizzle schema file `./database/auth-schema.ts` \n3. Run `pnpm db:generate` to create migration files\n4. Run `pnpm db:migrate` to apply the migration files to your local database\n\n---\n\nBuilt with ❤️ by [Matt](https://mattlynch.dev)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatthewlynch%2Fbetter-auth-react-router-cloudflare-d1","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatthewlynch%2Fbetter-auth-react-router-cloudflare-d1","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatthewlynch%2Fbetter-auth-react-router-cloudflare-d1/lists"}