Docs
Local Setup

Local Setup

Clone, install, fill in the environment, run the app and the tests on your own machine.

Prerequisites

Node 20 or newer, npm (the repository tracks package-lock.json; do not use Bun or pnpm here), Git, and access to the repository, Vercel, Supabase and Clerk.

Steps

Clone and install

git clone https://github.com/shaun-mo/impacthub.git
cd impacthub
npm install

Create the environment file

cp .env.example .env.local

Fill in the values from Vercel (Settings, Environment Variables) or from each service's dashboard. .env.local is ignored by Git and must stay so. Names only ever go in .env.example.

Run the app

npm run dev

Open http://localhost:3000. The sign-in page uses the Clerk instance your keys point at.

Run the gate

npx tsc --noEmit
npm test

Every change passes both before it is pushed.

Which Services to Point At

Use the Clerk development instance and a development Supabase project for anything that writes. Pointing at production is possible for read-only work but every write goes to real members, so do not.

Clerk webhooks need a public address to reach your machine. Run a tunnel (for example ngrok http 3000) and add the tunnel URL as a webhook endpoint in the development Clerk instance.

Useful Commands

CommandWhat it does
npm run devDevelopment server with hot reload
npm run buildProduction build, the same as Vercel runs
npm testVitest, every lib/**/*.test.ts
npm run lintESLint, including the design-system lint rules
npx tsc --noEmitType check
npm run role -- --email x --role adminChange a role from the command line
npm run nexus:syncBulk sync members to Nexus
npm run reseed:profilesRe-fill profiles from application answers (gaps only)

Scripts under scripts/ run with npx tsx --env-file=.env.local scripts/<name>.ts.

This Docs Site

cd docs-site
npm install
npm run dev

Open http://localhost:3333. Pages are MDX under docs-site/content/docs/; the sidebar is docs-site/config/docs.ts.