Cloud Hosting
Deploy PiggyBack to the cloud using Vercel and Supabase. Free tier, zero maintenance.
What You'll Need
An Up Bank account
You'll need a personal access token from the Up API developer portal
A GitHub account
To fork the repository and connect to Vercel
A Supabase account (free)
Sign up at supabase.com — free tier is sufficient
A Vercel account (free)
Sign up at vercel.com — Hobby plan works, connect with GitHub
Set Up Supabase
Create a New Project
- Go to supabase.com and sign in
- Click "New Project"
- Choose your organization, name it (e.g. "piggyback"), set a database password, and choose a region close to you
- Wait for the project to initialize (~2 minutes)
Run the Database Migration
- In your Supabase dashboard, go to SQL Editor
- Click "New query"
- Copy the entire contents of
supabase/migrations/00000000000000_initial_schema.sql - Paste it into the SQL Editor and click "Run"
- This creates all 35+ tables, functions, triggers, and Row Level Security policies in one go
supabase db push against your remote project instead of using the SQL Editor.Configure Authentication
- Go to Authentication → URL Configuration
- Set Site URL to your Vercel URL (you'll get this in Step 2 — you can come back to update it)
- Under Redirect URLs, add:
https://your-app.vercel.app/auth/callbackhttps://your-app.vercel.app/update-password
Get Your API Keys
- Go to Settings → API
- Copy these three values — you'll need them in Step 2:
- Project URL (starts with
https://...supabase.co) - anon/public key
- service_role key (click "Reveal" — keep this secret!)
- Project URL (starts with
Deploy to Vercel
One-Click Deploy
The fastest option — click the button and Vercel will fork the repo and set up the project for you:
Deploy with VercelManual Deploy
If you prefer to fork the repo yourself:
- Fork this repository on GitHub
- Go to vercel.com/new
- Import your forked repository
- Vercel will auto-detect Next.js — no build settings need to change
Set Environment Variables
In your Vercel project, go to Settings → Environment Variables and add:
| Variable | Required | Description |
|---|---|---|
| NEXT_PUBLIC_SUPABASE_URL | Yes | Your Supabase project URL |
| NEXT_PUBLIC_SUPABASE_ANON_KEY | Yes | Your Supabase anon key |
| SUPABASE_SERVICE_ROLE_KEY | Yes | Your Supabase service role key |
| UP_API_ENCRYPTION_KEY | Yes | A 32-character hex string (see below) |
| NEXT_PUBLIC_APP_URL | Yes | Your Vercel deployment URL |
| CRON_SECRET | Recommended | A random secret for cron auth |
| NEXT_PUBLIC_SKIP_LANDING | Optional | Set to 'true' to skip marketing page |
Generate Your Keys
# Generate encryption key (exactly 32 characters)
node -e "console.log(require('crypto').randomBytes(16).toString('hex'))"
# Generate cron secret
node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"Update Supabase Auth URLs
Now that you have your Vercel URL (e.g. https://piggyback-abc123.vercel.app):
- Go back to Supabase Authentication → URL Configuration
- Set Site URL to your Vercel URL
- Update the Redirect URLs with your actual Vercel URL:
https://piggyback-abc123.vercel.app/auth/callbackhttps://piggyback-abc123.vercel.app/update-password
Redeploy
After setting environment variables, trigger a redeployment from the Vercel dashboard to pick up your new values.
First-Time Setup
- Visit your deployed app
- Click Sign Up and create your account
- Check your email for the confirmation link and click it (check spam if you don't see it)
- Complete the onboarding flow
- Connect your Up Bank API token in Settings → Up Bank Connection
Optional Configuration
Change Region
The default Vercel region is syd1 (Sydney). Edit vercel.json to change it:
| Region | Code |
|---|---|
| Sydney, Australia | syd1 |
| US East (Virginia) | iad1 |
| US West (Oregon) | pdx1 |
| London, UK | lhr1 |
| Frankfurt, Germany | fra1 |
| Tokyo, Japan | hnd1 |
Enable Cron Jobs
PiggyBack has a daily cron job for payment reminders and AI-generated weekly summaries. Set the CRON_SECRET environment variable in Vercel. The cron is already configured in vercel.json to run daily at 9am UTC.
AI Assistant
No server-side API keys needed — each user configures their own in Settings → AI:
- Google Gemini — free tier available
- OpenAI — requires paid API access
- Anthropic — requires paid API access
API keys are encrypted and stored per-user. They never leave the server except to call the provider's API.
Up Bank Webhook (Real-Time Sync)
Configured automatically when you connect your Up Bank account in the app — no manual setup required. The webhook endpoint is /api/upbank/webhook on your deployed URL.
Custom Domain
- In Vercel, go to Settings → Domains
- Add your custom domain and follow the DNS instructions
- Update Supabase Site URL and Redirect URLs with your new domain
- Update
NEXT_PUBLIC_APP_URLin Vercel and redeploy
Troubleshooting
"Invalid login credentials" after signup
You need to confirm your email first. Check your inbox (and spam folder) for the confirmation link from Supabase.
Auth redirect goes to the wrong URL
Make sure your Supabase Site URL and Redirect URLs match your actual deployment URL exactly. The app has a safety net that catches misrouted auth codes, but correct configuration prevents the issue entirely.
Build fails on Vercel
Ensure all required environment variables are set. Check that NEXT_PUBLIC_SUPABASE_URL starts with https:// and UP_API_ENCRYPTION_KEY is exactly 32 characters.
Webhook not syncing transactions
Verify NEXT_PUBLIC_APP_URL is set to your deployment URL (including https://). The webhook URL must be publicly accessible. Try disconnecting and reconnecting your Up Bank account.
Cron job not running
Verify CRON_SECRET is set. The cron runs daily at 9am UTC. Cron jobs only run on production deployments (not preview deployments).
Database migration fails
Make sure you copy the entire migration file (~1,400 lines). Run it in a single query. If you get extension errors, enable uuid-ossp and pgcrypto manually in Database > Extensions.