Skip to main content

Prerequisites

  • Node.js 20+
  • npm 10+
  • A Supabase project (US region, pgvector extension enabled)
If you just want to try Verity without cloud dependencies, skip to the Docker demo — no Supabase or API keys needed.

Setup

1

Clone the repository

git clone <repo-url>
cd verity
2

Install dependencies

npm install
The project is a monorepo using npm workspaces. Dependencies are hoisted to the root node_modules/.
3

Configure environment variables

cp frontend/.env.example frontend/.env.local
Edit frontend/.env.local with your credentials:
DATABASE_URL=postgresql://...        # Supabase Postgres connection string
SUPABASE_URL=https://xxx.supabase.co # Supabase project URL
SUPABASE_ANON_KEY=eyJ...             # Supabase anonymous key
SUPABASE_SERVICE_KEY=eyJ...          # Supabase service role key
BETTER_AUTH_SECRET=...               # Random secret for BetterAuth
INNGEST_EVENT_KEY=...                # Inngest event key
INNGEST_SIGNING_KEY=...              # Inngest signing key
VOYAGE_API_KEY=pa-...                # Voyage AI — embeddings (voyage-law-2)
OPENAI_API_KEY=sk-...                # LLM provider API key (via Vercel AI SDK)
Optional variables:
RESEND_API_KEY=re_...                # Resend — transactional email (emails are no-ops without it)
EMAIL_FROM=...                       # Defaults to "Verity <noreply@verityaml.com>"
4

Run database migrations

npm run db:migrate
5

Seed the regulatory knowledge base

npm run db:seed
This populates the FFIEC sections, FinCEN advisories, deficiency patterns, and red flags. Embedding generation is rate-limited for the Voyage AI free tier (~22s between calls).
6

Start the dev server

npm run dev
The app will be running at http://localhost:3000.

Project structure

verity/
├── frontend/          # Next.js app — UI pages and API routes
│   ├── src/
│   │   ├── app/       # App Router (pages + API routes)
│   │   ├── components/
│   │   ├── lib/       # Auth, supabase client, utilities
│   │   └── proxy.ts   # Session gate (Next.js 16)
│   └── e2e/           # Playwright E2E tests

├── backend/           # Shared library — schema, config, jobs
│   └── src/
│       ├── config/    # REGULATION_CONFIG
│       ├── db/        # Drizzle schema + migrations + seed
│       ├── inngest/   # Background job definitions
│       └── lib/       # Embeddings, knowledge search

└── docker/            # Self-contained demo environment
The frontend/ package is the Next.js application with all API routes. The backend/ package is a shared library — not a server. Both packages share types and config at build time via npm workspaces.

Commands

CommandDescription
npm run devStart Next.js dev server
npm run buildBuild both packages for production
npm testRun all unit tests (backend + frontend)
npm run lintLint the frontend
npm run db:generateGenerate Drizzle migration files
npm run db:migrateApply pending migrations
npm run db:seedSeed the regulatory knowledge base
npm run test:e2eRun Playwright E2E tests (headless)
npm run test:e2e:uiRun E2E tests with Playwright UI