- Install dependencies
bun install
- Generate database migrations
bun run db:generate
- Create the D1 Database
bunx wrangler d1 create movies-db
- Add D1 database credentials to wrangler.toml
- Run the local SQLite database
bun run db:up
- Apply migrations to local database
bunx wrangler d1 execute movies-db --local --file=./drizzle/migrations/<migration file name here>
- Create a .dev.vars file in the root folder which looks like this
CLERK_SECRET_KEY=<You-secret-key>
CLERK_PUBLISHABLE_KEY=<Your-publishable-key>
- Start development server
bun run dev
- Apply migrations to D1 database on Cloudflare
bunx wrangler d1 execute movies-db --remote --file=./drizzle/migrations/<migration file name here>
- Deploy the application
bun run deploy