A Next.js todo app with authentication (better-auth) and Prisma (PostgreSQL). Built for deployment on Deno Deploy.
Create a .env file in the project root with:
DATABASE_URL=postgresql://USER:PASSWORD@HOST:5432/DB?sslmode=require
BETTER_AUTH_SECRET=replace-with-strong-secret
BETTER_AUTH_URL=http://localhost:3000
For production (e.g. Deno Deploy), set these in your deployment dashboard. Use your production URL for BETTER_AUTH_URL (e.g. https://your-app.deno.dev).
- Install deps:
pnpm install - Generate Prisma client:
pnpm run db:generate - Apply migrations:
pnpm run db:migrate - Dev server:
pnpm run dev - Build:
pnpm run build - Start (production):
pnpm run start
This app uses Next.js with output: "standalone" for Deno Deploy.
-
GitHub integration: Connect your repo at dash.deno.com. Deno Deploy will detect the Next.js app and configure the build. Set
DATABASE_URL,BETTER_AUTH_SECRET, andBETTER_AUTH_URLin the project Environment Variables. -
Pre-deploy: Ensure the build runs
prisma generateso the Prisma client (undersrc/generated/prisma) is available. Theprebuildscript inpackage.jsonrunsdb:generatebeforenext build. -
CLI deploy (optional):
pnpm run build deployctl deploy --include=.next --include=public jsr:@deno/nextjs-start/v15
This project uses Tailwind CSS v4 with PostCSS.