Skip to main content

Getting Started

This guide walks you through setting up the Shokunin Platform on your local machine. All steps are derived from actual repo files — any step based on inference is labeled [based on repo evidence]. The fastest way to start is with the pre-configured dev container. It eliminates manual toolchain setup. What the dev container provides (from .devcontainer/README.md):
  • Node.js 20
  • Docker-in-Docker (so you can run docker-compose inside the container)
  • GitHub CLI

Option A: GitHub Codespaces

  1. Open the repository on GitHub.
  2. Click Code → Codespaces → Create codespace on main.
  3. Wait for the container to build (first time ~2–3 minutes).
  4. Once inside, jump directly to Step 3: Configure Environment Variables.

Option B: VS Code Dev Container

  1. Install the Dev Containers extension.
  2. Clone the repository locally:
    git clone <repo-url>
    cd v0-shokunin-ai-platform
    
  3. Open in VS Code, then click Reopen in Container when prompted.
  4. Once inside, jump to Step 3.

Manual Setup (Without Dev Container)

If you prefer to run locally without the dev container:

Step 1: Prerequisites

Ensure you have the following installed:
  • Node.js 20 (check: node --version)
  • Bun package manager: npm install -g bun
  • Docker and Docker Compose (for the Beads backend)
  • GitHub CLI (gh) for authentication [based on repo evidence]
  • gcloud CLI authenticated to the GCP project [based on repo evidence]

Step 2: Clone and Install

git clone <repo-url>
cd v0-shokunin-ai-platform
bun install

Step 3: Configure Environment Variables

Copy the example env file and fill in your values:
cp .env.example .env.local

Required Environment Variables

All variables below are from .env.example. Variables marked required must be set before the platform starts.
VariableRequiredDescription
CGO_ENABLEDRequiredMust be 1 for native Go bindings used by Beads CLI. Set to 1.
NEXT_PUBLIC_FIREBASE_API_KEYRequiredFirebase Web API key
NEXT_PUBLIC_FIREBASE_AUTH_DOMAINRequiredFirebase auth domain (e.g. shokunin-480309.firebaseapp.com)
NEXT_PUBLIC_FIREBASE_PROJECT_IDRequiredFirebase project ID (e.g. shokunin-480309)
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKETRequiredFirebase Storage bucket
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_IDRequiredFirebase Messaging sender ID
NEXT_PUBLIC_FIREBASE_APP_IDRequiredFirebase App ID
NEXT_PUBLIC_FIREBASE_DATABASE_IDRequiredFirestore database ID (usually (default))
GITHUB_TOKENRequiredGitHub personal access token for API calls
ERASER_API_TOKENOptionalEraser MCP API token (for diagram generation)
BASEHUB_TOKENOptionalBaseHub CMS token
LIVEBLOCKS_SECRET_KEYOptionalLiveblocks real-time collaboration key
GOOGLE_SERVICE_ACCOUNT_KEYProduction onlyGCP service account key JSON (single line) for Cloud Run OIDC auth
DOCS_MODEOptionalControls /docs route: placeholder (default), redirect, embed
DOCS_URLOptionalExternal Mintlify docs URL (used when DOCS_MODE=embed or redirect)
TF_VAR_dolt_db_passwordTerraform onlyDolt DB password for Terraform applies
TF_VAR_beads_api_keyTerraform onlyBeads API key for Terraform applies
CGO_ENABLED=1 must be set. The Beads CLI (bd) uses native Go bindings and will fail without it.

Firebase Credentials

Contact the team for Firebase project credentials. For local-only development, the Firebase emulator can be used instead (see Local Dolt + Firebase Emulators).

Step 4: Start the Beads Backend

The platform uses a local Dolt database as the Beads (task tracking) backend. Start it with Docker Compose:
docker-compose up -d beads-backend beads-api
This starts two services (from docker-compose.yml):
ServiceContainerPortDescription
beads-backendbeads-backend3307 (host) → 3306 (container)Dolt SQL Server — the Beads data store
beads-apibeads-api8080Beads HTTP API — used by the bd CLI
The Beads API runs in open/dev auth mode locally (BEADS_API_KEY is intentionally unset in docker-compose.yml). No authentication is required for local Beads operations.
For detailed Dolt backend configuration, see infrastructure/beads-backend/README.md.

Step 5: Configure Beads CLI

After starting the Docker services, configure the bd CLI to connect to your local Dolt backend [based on repo evidence from infrastructure/beads-backend/README.md]:
# Set mode to server
bd dolt set mode server

# Connect to the local container (mapped to port 3307)
bd dolt set host 127.0.0.1
bd dolt set port 3307
bd dolt set user root

# Verify the connection
bd dolt show
bd status

Step 6: Start the Development Server

bun run dev
The platform will be available at http://localhost:3000.

Step 7: (Optional) Full Stack via Docker Compose

To run the entire platform stack in Docker (including the Next.js frontend):
docker-compose up -d
This starts all three services: beads-backend, beads-api, and platform-web (Next.js on port 3000).
For active development, running bun run dev directly (Step 6) is faster since it supports hot reload. Use the full Docker Compose stack only when you want to test the containerized production build.

Optional: Firebase Emulators

For fully offline development without a real Firebase project, uncomment these variables in .env.local:
NEXT_PUBLIC_FIREBASE_USE_EMULATOR=true
NEXT_PUBLIC_FIREBASE_EMULATOR_HOST=localhost
NEXT_PUBLIC_FIREBASE_EMULATOR_PORT=8080
Then start the Firebase emulators [based on repo evidence — Firebase CLI required]:
firebase emulators:start

Development Scripts

ScriptCommandDescription
Dev serverbun run devStarts Next.js development server with hot reload
Buildbun run buildProduction build (includes TypeScript type checking)
Lintbun run lintRun ESLint across the project
Startbun run startStart the compiled production build

Troubleshooting

Build fails with TypeScript errors Run bun run build and address the reported type errors before committing. All commits must pass the build. bd command fails with CGO errors Ensure CGO_ENABLED=1 is set in your .env.local or shell environment. Firebase auth errors Ensure Firebase credentials are set in .env.local. If using emulators, confirm NEXT_PUBLIC_FIREBASE_USE_EMULATOR=true. Port 3000 already in use
lsof -ti:3000 | xargs kill -9
Beads API unreachable Check Docker Compose services are running: docker-compose ps. The beads-api container must be healthy. Port 3307 already in use Another MySQL/Dolt process may be running locally. Stop it or change the mapped port in docker-compose.yml.