This repo was generated from the react-router-cloudflare-d1 template
You can start a react-router project from this repo by running:
npx create-react-router@latest --template matthewlynch/better-auth-react-router-cloudflare-d1
- Run
cp .dev-example.vars .dev.varsto create an .env file you can use to override variables defined inwrangler.tomlor set secret values you don't want to check into source control - Update the
namefield inwranlger.toml - Install dependencies
pnpm install - Create a database by running
wrangler d1 create <name>and updatewranlger.tomlwith the UUID and name for the database - Add your GitHub OAuth Client ID/Secret & 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) - Run
pnpm typegenany time you make changes towranlger.tomlto ensure types from bindings and module rules are up to date for type safety - Run
pnpm db:warmto ensure wrangler has created a local database - Run
pnpm db:migrateto apply the migration files to your local database - Run
pnpm devto start the app
- Make changes to the
better-authconfig in./app/auth/auth.server.ts - Run
pnpm auth:db:generateto create thebetter-authdrizzle schema file./database/auth-schema.ts - Run
pnpm db:generateto create migration files - Run
pnpm db:migrateto apply the migration files to your local database
Built with ❤️ by Matt