Skip to content

Local setup & Day 1 ​

Three paths. Most designers and UI engineers only need Path 1.

Do not paste secrets into the wiki. Account IDs, SSO URLs, and connection strings live in private onboarding + bun run secrets:pull. This page names steps, not credentials.

Full detail: monorepo docs/getting-started.md and apps/control-plane/web/README.md (Path 1).

Prerequisites (all paths) ​

  • Bun 1.4.0 (pinned in root package.json packageManager)
  • Clone DaPulse/brilliant-ai, install once from the repo root:
bash
bun install --frozen-lockfile --backend=copyfile

The copyfile backend avoids macOS native-binary / code-signing issues.

Worktrees & agent installs (#320, merged) ​

Agents may run bun install in their own worktree as bun install --backend=copyfile. If that worktree’s node_modules was created by the link script (linked into main’s tree), remove the linked dirs first — an install through those links writes into main. New worktrees get modules via scripts/worktree-node-modules.sh <worktree>, never a plain symlink to main. No new dependencies without asking. Full wording: monorepo AGENTS.md and gotchas/testing-and-tooling.md. Landed in #320 (merged; docs-only split from #318).

Path 1 — Frontend only (studio UI against staging) ​

Run only Vite locally: UI hot-reloads; login, API, agent turns, and previews use deployed staging. No AWS credentials, Docker, local Worker, or backend secrets.

  1. Create apps/control-plane/web/.env.local once (gitignored) with all of these:
dotenv
BRILLIANT_WORKER_URL=https://app.brilliant.rocks
VITE_CONDUCTOR_URL=https://conductor.brilliant-ai-staging.workers.dev
VITE_PREVIEW_URL=https://conductor.brilliant-ai-staging.workers.dev
VITE_AGENTS_URL=https://brilliant-agents.brilliant-ai-staging.workers.dev
VITE_DISPATCH_URL=https://brilliant-dispatch.brilliant-ai-staging.workers.dev
VITE_LIVE_APP_DOMAIN=brilliant-app.rocks
  1. Start the frontend each time (keep --env-file so Vite’s config and the SPA both see the values; Wrangler .dev.vars is unused here):
bash
cd apps/control-plane/web
bun --env-file=.env.local run dev
  1. Open http://localhost:5173 and sign in with your own account. This is real staging data; agent turns incur real usage. Use your own test apps/workspaces — do not run destructive actions on someone else’s apps.

Set every URL above. BRILLIANT_WORKER_URL must be https://app.brilliant.rocks (not the bare apex). Bare https://brilliant.rocks is the marketing site now (#361); a 308 from the apex through Vite’s proxy lands sign-in on staging, and Chrome caches the wrong host — local login looks broken until the cache is cleared (#386, merged). BRILLIANT_WORKER_URL only configures the Vite API proxy. On main today, unset VITE_* values can still fall back to the retired Cloudflare account (monday-vibe-stg / brilliant-control-plane.monday-vibe-stg.workers.dev, Cloudflare 1042) or to obsolete brilliant.lighting hosts. Open #447 (closes #443) removes those fallbacks: studio previewOrigin() / vite build require VITE_PREVIEW_URL (and conductor / control plane / dispatch fail closed on missing preview or control-plane origins) — see Hosting — no lighting fallbacks. VITE_LIVE_APP_DOMAIN=brilliant-app.rocks makes live-app links open on each app’s own host (<script>.brilliant-app.rocks), as staging does (#416, merged 2026-10-04; pairs with #412/#413). The staging workers.dev control-plane host is VPN-blocked for many people (#249, merged). Stuck in a sign-in loop? Clear cookies for localhost and retry — Auth0 only returns to port 5173.

Marketing site locally (optional) ​

Landing, use-case, campaign (/lp/…), and other marketing pages live in apps/site, not the studio (#416, merged 2026-10-04).

bash
cd apps/site
bun run dev

Open http://localhost:5176. Content is under apps/site/src/content/; how to add a page, use case, or campaign is in apps/site/README.md. Locally /v1/suggestions answers 503 (no control plane behind the site dev server); the default suggestion cards still render. See Marketing site.

Cloud agents (Point Cloud / Cursor) ​

.cursor/environment.json installs Bun and starts a studio terminal at http://localhost:5173 with the same staging URLs. That terminal already owns 5173 — reuse it. Auth0 only allows localhost:5173, so a second Vite on another port cannot finish login. After #401 (merged 2026-10-04) a signed-out studio visitor is always sent to sign in (no in-studio landing); marketing landing is on the site apex. /me without a session is 401. A local Worker (wrangler dev) still needs AWS SSO and secrets:pull (Path 2).

Login prerequisite ​

A maintainer must allowlist the staging Auth0 application for:

  • Allowed Callback URLs: http://localhost:5173/auth/callback
  • Allowed Logout URLs: http://localhost:5173/

Use localhost (not 127.0.0.1) and keep port 5173 — the auth proxy announces that origin. If Vite picks another port, free 5173 rather than using the alternate URL.

Path 1 troubleshooting ​

SymptomCheck
Service temporarily unavailableProxy uses https://app.brilliant.rocks; https://app.brilliant.rocks/health reachable
Cloudflare 1042 on control-plane /me or /healthHitting retired monday-vibe-stg (or unset VITE_* falling back there) — switch to app.brilliant.rocks + all four VITE_* URLs (#249, #361)
Sign-in lands on staging / wrong host after local Vite loginBRILLIANT_WORKER_URL is bare brilliant.rocks (308 → marketing; proxy hands redirect to browser; Chrome caches it). Set https://app.brilliant.rocks, restart Vite, clear the cached redirect (#386, merged; #361)
UI works but preview / agent does notEvery VITE_* URL set; restart Vite after env changes; refresh browser
Auth0 redirect / invalid_stateAllowlists above; exact http://localhost:5173 URL; do not start a second Vite on another port
Sign-in loop on localhostClear cookies for localhost, stay on port 5173 (#416, merged)
Backend still unreachablePrefer app.brilliant.rocks (VPN often blocks brilliant-control-plane.brilliant-ai-staging.workers.dev); network must allow *.brilliant-ai-staging.workers.dev for conductor/agents/dispatch

Edit feature UI under apps/control-plane/web/src/, shared components under packages/studio-ui/src/, tokens under packages/design-tokens/. For backend or isolated full-stack work, use Path 2 or a side environment (Path 3).

Studio UI primitives: from repo root, bun run storybook:studio-ui → Storybook for @brilliant/studio-ui.

Source: merged #188 (apps/control-plane/web/README.md); staging hosts / cloud-agent studio terminal #249; studio host app.brilliant.rocks after #361; apex-308 local Vite trap clarified in merged #386; Path 1 VITE_LIVE_APP_DOMAIN + local marketing site on 5176 in merged #416.

Path 2 — Full local stack (Worker + studio) ​

Needed when changing Worker/API behaviour under wrangler dev.

  1. Cloudflare: bunx wrangler login (account brilliant-ai-staging — monday-vibe-stg is retired; #249).
  2. AWS SSO: request developer access via Apono → aws sso login --profile default (there is no named brilliant profile; SSO lives under default). Do not set AWS_PROFILE to another name. If stale static AWS_ACCESS_KEY_* / session tokens shadow SSO, clear them for the command with env -u AWS_ACCESS_KEY_ID -u AWS_SECRET_ACCESS_KEY -u AWS_SESSION_TOKEN -u AWS_CREDENTIAL_EXPIRATION … (#189, merged).
  3. Pull secrets into worker .dev.vars: bun run secrets:pull.
  4. Per-developer Hyperdrive local connection string (Ask lead until self-service exists) in control-plane .dev.vars.
  5. Run:
bash
cd apps/control-plane
bun run dev

Worker ~8787, Vite ~5173. Clear stale static AWS env vars if SSO mysteriously fails (see gotchas/aws-and-secrets.md / getting-started).

Path 3 — Side environment ​

Isolated cloud stack for multi-worker / container / queue work — do not verify feature branches on shared staging. Each side env is a Pulumi stack side-<name> (env:up / env:down); needs Pulumi CLI + AWS access to the staging Cloudflare secret and Pulumi state (see Side environments).

Branch envs are gone. #606 (merged 2026-10-07) removed branch:deploy, the x-brilliant-branch header routing and the Chrome switcher, because branch code couldn't reach Durable Objects, queues or named RPC, so it used staging state. Use env:up below, even for code-only changes to control-plane, dispatch or agents. Details.

bash
bun run env:up <name>
# deploy from each service with bun run deploy (bound via .brilliant-env/current)
bun scripts/e2e-smoke.ts --env <name>
bun run env:down <name>

Day-1 reading order ​

  1. This page + Path 1 smoke login
  2. Glossary
  3. Overview / Architecture skim
  4. AGENTS.md (task router + boundaries), then CODING_STANDARDS.md and docs/agent-workflow.md for repo rules and done-ness (#594)
  5. Relevant ADRs in ADR index
  6. Skim gotchas/ (area files) before your first nontrivial change

Where to ask ​

Team Slack / lead. Check gotchas/ before re-debugging known traps.