Self-hosting
import { Steps, Aside } from ‘@astrojs/starlight/components’;
Paisa is designed to self-host cheaply. The API runs on Cloudflare Workers (free tier handles personal use easily). The web app is a static Vite build — host it anywhere.
Prerequisites
Section titled “Prerequisites”- A Cloudflare account (free)
- A PostgreSQL database — Neon free tier works well
- Bun installed locally
-
Clone the repo
Terminal window git clone https://github.com/nimit9/paisacd paisabun install -
Configure the API
Copy and fill in the environment variables:
Terminal window cp apps/api/.env.example apps/api/.envRequired variables:
DATABASE_URL=postgresql://user:pass@host/dbBETTER_AUTH_SECRET=your-random-32-char-secretWEB_URL=https://your-web-app-url.comGOOGLE_CLIENT_ID=...GOOGLE_CLIENT_SECRET=... -
Run migrations
Terminal window bun run db:migrate -
Deploy the API to Cloudflare Workers
Terminal window cd apps/apibunx wrangler deploySet secrets in Cloudflare:
Terminal window bunx wrangler secret put DATABASE_URLbunx wrangler secret put BETTER_AUTH_SECRET# ... etc -
Build and deploy the web app
Terminal window cd apps/webVITE_API_URL=https://your-worker.workers.dev bun run buildDeploy the
dist/folder to Cloudflare Pages, Vercel, or any static host. -
Whitelist your email
Paisa uses Google OAuth with an email whitelist. Add your email in
apps/api/src/auth.tsor configure theALLOWED_EMAILSenv var.
Cron jobs
Section titled “Cron jobs”The API includes Cloudflare cron triggers:
| Schedule | Job |
|---|---|
0 1 * * * | Zerodha portfolio sync |
0 0 1 * * | Monthly report generation |
These run automatically once deployed to Cloudflare Workers.