SplitSimple is a billsplitting app with a Vercel-hosted Next.js frontend and a Cloudflare Worker backend for shared bill persistence.
- Frontend: Next.js on Vercel
- Shared bill backend: Cloudflare Worker
- Database: Cloudflare D1
- Local drafts: browser storage
pnpm install
cp .env.example .env.local
cp cloudflare/.dev.vars.example cloudflare/.dev.varsSet these values before running the app:
ADMIN_PASSWORDCLOUDFLARE_BACKEND_URLBACKEND_SHARED_SECRET
Then start the frontend and backend in separate terminals:
pnpm dev
pnpm backend:devpnpm dev- Next.js dev serverpnpm build- Build the frontendpnpm start- Start the Next.js production serverpnpm backend:dev- Run the Cloudflare backend locallypnpm backend:deploy- Deploy the Cloudflare backendpnpm backend:db:migrations:apply:local- Apply D1 migrations locallypnpm backend:db:migrations:apply:remote- Apply D1 migrations to remote D1pnpm lint- ESLintpnpm typecheck- TypeScriptpnpm test- Jest
- Deploy the Cloudflare Worker backend.
- Set
CLOUDFLARE_BACKEND_URLandBACKEND_SHARED_SECRETin Vercel. - Set the same
BACKEND_SHARED_SECRETincloudflare/.dev.varsfor local development and in the Worker environment for production. - Deploy the Next.js app on Vercel as usual.
- Old Redis storage is not used anymore.
- Shared bills live in D1 through the backend worker.
- The frontend talks to the backend through the app's API routes, not directly from the browser.