Skip to main content

Local Development

This is the canonical “Setting Up Terra” guide. If onboarding notes conflict with this page, use this page.

Who This Is For

  • New engineers joining Terra development
  • Existing engineers setting up a new laptop
  • Engineers troubleshooting local environment drift

Prerequisites

  • macOS or Linux shell access
  • Node.js 20+
  • pnpm 9+
  • Access to Terra GitHub repo (scholarfund/terra)
  • Doppler access for the unify-platform project

Fast Setup (macOS)

Environment Setup

Terra scripts are designed to run with Doppler-managed secrets.

Local .env fallback

Use only when Doppler is unavailable.
  1. Copy apps/terra/.env.example to apps/terra/.env.local.
  2. Populate required values (Supabase, WorkOS, encryption key, integrations).
  3. Run with local env.

Supabase CLI

Useful for local DB operations, policy checks, and migration work.

Vercel CLI

Useful for debugging deployment behavior and environment issues.

Daily Commands

Quick Verification Checklist

  • pnpm --dir apps/terra dev starts without missing-env crashes
  • pnpm --dir apps/terra test runs locally
  • pnpm --dir apps/terra tsc --noEmit passes
  • You can open /status locally and get HTTP 200

Migrations

Terra SQL migrations live in apps/terra/migrations/. When adding a migration:
  1. Create the next sequential migration file.
  2. Run verification/tests locally.
  3. Include rollback notes in your PR/release context.

Contributing

PR workflow and expectations

Testing

Test commands and quality gates