Skip to main content

Local Dev Environment

After completing the Getting Started guide, this is what your development environment looks like. Use this page to understand what each component is, where it runs, and how it connects to everything else.

Architecture at a Glance

Local dev environment architecture Everything in your environment spans three zones: your local machine (Docker Compose services), GCP (shared cloud infrastructure), and third-party services (SaaS APIs). The dev container is the hub — it holds your authenticated gcloud session and is the trust anchor that connects all three.

Component Map

Local — Docker Compose

These services run on your machine via docker-compose up -d. No cloud required to start them.
ServicePortWhat it isKey dependency
platform-web3000Next.js app (hot reload via bun run dev)Firebase, BaseHub, Liveblocks, Beads API
docs-site3002Mintlify docs site (this site)None
beads-api8080Beads task-tracking HTTP APIbeads-backend
beads-backend3307Dolt SQL Server (local task data)Volume beads-data
redis6379Redis cacheNone
beads-backend is a local replica using a Dolt SQL Server running in Docker Compose. Team data for staging and production lives in dedicated GCP Dolt VMs — not accessible from local dev.

GCP — Shared Dev Infrastructure

These resources live in GCP project shokunin-480309 and are shared across the team. Your dev container connects to them via your authenticated gcloud session.
ResourceGCP ServiceHow you connectAuth
Firestore database (dev-<handle>)FirestoreFirebase SDKNEXT_PUBLIC_FIREBASE_*
Secret Manager (shokunin-dev-*)Secret Managergcloud CLI / env-syncApplication Default Credentials (ADC)
The dev-shared GCP environment does not run a Dolt VM or Beads API Cloud Run service — those exist in staging and production only. Local dev uses Docker Compose services (beads-api and beads-backend) exclusively.
Your personal Firestore database (dev-<handle>) was created by ./scripts/dev-setup when you applied your sandbox terraform. It is isolated from other developers’ databases.

Third-Party Integrations

These are SaaS APIs consumed by the platform. Tokens are stored in GCP Secret Manager and pulled into your .env by ./scripts/env-sync.
ServiceUsed byWhat forSecret
BaseHubplatform-webCMS content (documentation snippets, copy)BASEHUB_TOKEN
Liveblocksplatform-webReal-time multiplayer / presence in the canvasLIVEBLOCKS_SECRET_KEY
GitHubopencodeCode access, PR creation, issue managementGITHUB_TOKEN
EraseropencodeDiagram generation via MCPERASER_API_TOKEN

Connection Map

How the platform reaches each external system:

Secrets Reference

All secrets are populated into your .env by ./scripts/env-sync. This table shows where each one comes from and what uses it.
VariableSourceConsumerNotes
NEXT_PUBLIC_FIREBASE_API_KEYSecret Manager shokunin-dev-firebase-browser-api-keyplatform-web (browser)Public — safe to expose
NEXT_PUBLIC_FIREBASE_* (other).env.example (pre-filled)platform-web (browser)Non-secret config values
LIVEBLOCKS_SECRET_KEYSecret Manager shokunin-dev-liveblocks-secret-keyplatform-web (server)Server-side only
BASEHUB_TOKENSecret Manager shokunin-dev-basehub-tokenplatform-web (server)Server-side only
ERASER_API_TOKENSecret Manager shokunin-dev-eraser-api-tokenopencode MCPTeam-shared token
GITHUB_TOKENSet manually (GitHub PAT)opencode, GitHub CLIPersonal token — not in Secret Manager
GOOGLE_SERVICE_ACCOUNT_KEYSecret Manager shokunin-dev-vercel-caller-sa-keyplatform-web server-side GCP callsSingle-line JSON SA key
CGO_ENABLED=1.env.examplebd CLIRequired for native Go bindings

Identity & Access Summary

Who is authenticating as what when you work locally:
ActionYour identityHow
Running gcloud commandsYour GCP user accountgcloud auth login
Reading secrets (env-sync)Your GCP user accountApplication Default Credentials (ADC)
Running ./scripts/tf dev <handle>shokunin-dev-platform-sa (impersonated)gcloud auth print-access-token --impersonate-service-account
Firebase auth (app login)End-user (browser session)Firebase Authentication SDK
Calling GCP APIs from the app (infra status, provisioning)shokunin-dev-vercel-caller-saJSON key in GOOGLE_SERVICE_ACCOUNT_KEY
Your personal GCP user account has two roles on the project, both granted by your sandbox terraform (./scripts/dev-setup):
  • roles/secretmanager.secretAccessor — read secret values
  • roles/secretmanager.viewer — list secrets (required for env-sync to enumerate)
The serviceAccountTokenCreator binding (needed to impersonate the platform SA for terraform) is granted separately via foundation, before your sandbox is created.

Environment Variables Reference

For a complete list of all variables and their defaults, see .env.example in the repo root. To re-populate your .env at any time:
./scripts/env-sync   # safe to re-run; skips variables already set
To force-update a specific variable that was already set, delete its line from .env and re-run.