A Cloudflare-native expense tracker built with Next.js, Auth.js, D1, and OpenNext.
- Next.js 16 + React 19
- Auth.js 5 with Google OAuth
- Cloudflare Workers + OpenNext
- Cloudflare D1 with checked-in SQL migrations
- Vitest coverage + Playwright smoke tests
- Install dependencies:
pnpm install- Configure environment variables in
.env.local:
AUTH_SECRET="replace-me"
AUTH_GOOGLE_ID="replace-me"
AUTH_GOOGLE_SECRET="replace-me"
AUTH_ENABLE_TEST_PROVIDER="true"- Start local development:
pnpm devIn local development, the demo credentials login is enabled by default unless you set AUTH_ENABLE_TEST_PROVIDER="false". That gives you a reliable way into http://localhost:3000/login without depending on Google OAuth localhost configuration.
The app will use the local SQLite-compatible fallback database at .wrangler/state/expense-tracker.db during local development and tests. Production uses the DB Cloudflare D1 binding from wrangler.jsonc.
pnpm typecheckpnpm lintpnpm formatpnpm format:checkpnpm testpnpm test:coveragepnpm test:e2epnpm cf:buildpnpm cf:previewpnpm cf:deploy
Recurring rules stay editable, but historical periods are materialized into real transaction snapshots. Future periods remain virtual until reconciliation runs on demand when recurring-sensitive pages load, preserving accurate historical lookbacks without relying on cron as the primary mechanism.
- Pull requests run typecheck, lint, format check, coverage, Playwright smoke tests, and a Cloudflare production build.
- Pushes to
mainrun the deploy workflow after building and applying D1 migrations.