Local Development Setup
Run OpsDash on your machine in 15 minutes.
Prerequisites
| Tool | Version | Install |
|---|---|---|
| Node.js | ≥ 18 | https://nodejs.org |
| pnpm | ≥ 8 | npm install -g pnpm |
| Supabase CLI | ≥ 1.100 | npm install -g supabase |
| Docker | Latest | https://docker.com — required for local Supabase |
Steps
1. Clone and install
git clone <your-repo-url> opsdash
cd opsdash
pnpm install2. Start local Supabase
Docker must be running. This command starts a local Postgres, Auth, Storage, and Studio instance.
supabase startThe command prints your local keys:
API URL: http://127.0.0.1:54321
anon key: eyJhbGc...
service_role key: eyJhbGc...Keep this terminal open.
3. Create your environment file
cp ".env copy.example" .envOpen .env and paste the values from the previous step:
NEXT_PUBLIC_SUPABASE_URL=http://127.0.0.1:54321
NEXT_PUBLIC_SUPABASE_ANON_KEY=<anon key>
SUPABASE_SERVICE_ROLE_KEY=<service_role key>
NEXT_PUBLIC_APP_URL=http://localhost:3000Never commit
.envto git. Theservice_rolekey bypasses all Row-Level Security policies.
4. Apply all migrations
This creates all 57 tables, RLS policies, triggers, and PostgreSQL functions:
supabase db push5. (Optional) Load demo data
supabase db seedThe seed creates a Demo Company organization with contacts, deals, projects, forms, custom field definitions, automation triggers, and analytics-ready won deals.
6. Start the dev server
pnpm devOpen http://localhost:3000. Sign up with any email — your personal workspace is created automatically and you land on the dashboard.
Email confirmation is disabled in local mode. Sign up completes immediately. In production, configure email confirmation in Supabase Dashboard → Authentication → Email.
Connecting to Demo Seed Data
If you ran supabase db seed, the Demo Company org exists but is not linked to your user. To browse it:
-- Run in Supabase Studio (http://127.0.0.1:54323 → SQL Editor)
-- 1. Find your user UUID
SELECT id, email FROM auth.users;
-- 2. Link yourself as owner of the demo org
INSERT INTO public.org_members (user_id, org_id, role)
VALUES ('<your-user-uuid>', '00000000-0000-0000-0000-000000000001', 'owner');
-- 3. Switch your current org to the demo org
UPDATE public.users
SET current_org_id = '00000000-0000-0000-0000-000000000001'
WHERE id = '<your-user-uuid>';Refresh the browser — the org switcher now shows “Demo Company”.
Useful Local URLs
| URL | Purpose |
|---|---|
| http://localhost:3000 | The app |
| http://127.0.0.1:54323 | Supabase Studio — table editor, SQL editor, logs |
| http://127.0.0.1:54324 | Supabase email inbox (Inbucket) — captures all emails sent locally |
Common Commands
# Stop local Supabase
supabase stop
# Reset database — wipes all data, re-applies all migrations + seed
supabase db reset
# Push only new migrations to existing database
supabase db push
# Generate TypeScript types from the local schema
supabase gen types typescript --local > packages/database/src/types/database.ts
# Build all packages in the monorepo
pnpm build
# Run unit tests
pnpm test
# Type-check without building
pnpm typecheckHow Signup Works (Under the Hood)
When a user signs up, the handle_new_user() PostgreSQL trigger fires automatically:
No manual database inserts required — everything is automatic.