Quick Start

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

  1. Copy the example environment file:

    cp env.example .env.local
  2. Generate an encryption key:

    openssl rand -base64 32

    Copy the output.

  3. Edit .env.local and 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:

  1. Start PostgreSQL (if not already running):

    brew services start postgresql@15
    # or
    brew services start postgresql@14
  2. Run the automated setup script:

    ./scripts/setup-database.sh

    Or 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.js

    Or use the pnpm script (if configured):

    pnpm db:migrate

Step 3: Start Development Servers

  1. Install dependencies (if not already done):

    pnpm install
  2. Build shared packages:

    pnpm --filter @unifiedcron/shared build
    pnpm --filter @unifiedcron/database build
    pnpm --filter @unifiedcron/integrations build
  3. Start the servers:

    pnpm dev

    This 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.local exists in the root directory
  • Verify ENCRYPTION_KEY is 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.local is correct
  • Ensure database exists: psql -l | grep unifiedcron

Frontend Can't Connect to API

Error: "Failed to fetch" or connection errors

Form Submits But Nothing Happens

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 dev is running
  • Check browser console: Open Developer Tools → Console
  • Verify all services are running: Check both API and Web processes