Quick Start Guide - Local Development
This guide will help you get UnifiedCron running locally for testing with Supabase.
Prerequisites
- Node.js 20+
- pnpm (or npm)
- PostgreSQL running locally (or Docker)
- A Supabase project (cloud or local)
Step 1: Set Up Environment Variables
-
Copy the example environment file:
cp env.example .env.local -
Generate an encryption key:
openssl rand -base64 32Copy the output.
-
Edit
.env.localand set:DATABASE_URL=postgres://user:password@localhost:5432/unifiedcron ENCRYPTION_KEY=<paste the generated key here> API_PORT=3001 NODE_ENV=development NEXT_PUBLIC_API_URL=http://localhost:3001
Step 2: Set Up Database
For detailed database setup instructions, see Database Setup
Quick setup:
-
Start PostgreSQL (if not already running):
brew services start postgresql@15 # or brew services start postgresql@14 -
Run the automated setup script:
./scripts/setup-database.shOr manually create the database and run migrations:
# Create database psql -d postgres -c "CREATE DATABASE unifiedcron;" # Update DATABASE_URL in .env.local (the script does this automatically) # DATABASE_URL=postgres://$(whoami)@localhost:5432/unifiedcron # Run migrations: cd packages/database pnpm build cd ../.. node packages/database/dist/migrate.jsOr use the pnpm script (if configured):
pnpm db:migrate
Step 3: Start Development Servers
-
Install dependencies (if not already done):
pnpm install -
Build shared packages:
pnpm --filter @unifiedcron/shared build pnpm --filter @unifiedcron/database build pnpm --filter @unifiedcron/integrations build -
Start the servers:
pnpm devThis starts:
Step 4: Set Up a Secure Supabase Connection
For hosted Supabase, follow the signed-push section of the secure Supabase setup guide. Configure a public
HTTPS API origin with INGEST_PUBLIC_URL, create the connection using its project reference, and install
the generated sender SQL in that project's SQL Editor. No database password or API key is needed.
A local-only HTTP dashboard cannot receive cloud pushes; use an HTTPS-reachable test deployment.
Restricted databases without managed pg_net grants may use the direct reader with verified TLS instead.
Anonymous/service-role API keys are not supported.
If you used the previous public cron views, run the legacy cleanup SQL before switching the connection.
Troubleshooting
API Won't Start
Error: "ENCRYPTION_KEY environment variable is required"
- Make sure
.env.localexists in the root directory - Verify
ENCRYPTION_KEYis set in.env.local - Restart the API server
Database Connection Issues
Error: "connection refused" or similar
- Verify PostgreSQL is running:
pg_isready - Check DATABASE_URL in
.env.localis correct - Ensure database exists:
psql -l | grep unifiedcron
Frontend Can't Connect to API
Error: "Failed to fetch" or connection errors
- Verify API is running: Check http://localhost:3001/health (opens in a new tab)
- Check browser console for CORS errors
- Verify
NEXT_PUBLIC_API_URLin.env.localmatches API port
Form Submits But Nothing Happens
- Check browser console for errors
- Check API logs for errors
- Verify the API is running and accessible
- Try the health endpoint: http://localhost:3001/health (opens in a new tab)
Connection Test Fails
- Verify private reader views and permissions using the secure Supabase setup guide
- Check Project URL is correct (should end with
.supabase.co) - Verify reader credentials, private views and the TLS certificate
- Check API logs for detailed error messages
Next Steps
Once connected:
- Go to Dashboard to see discovered jobs
- Click "Refresh Jobs" on a connection to discover cron jobs
- View job details and schedules
Getting Help
- Check API logs: Look at the terminal where
pnpm devis running - Check browser console: Open Developer Tools → Console
- Verify all services are running: Check both API and Web processes