Skip to main content

Infrastructure Overview

This page provides a conceptual overview of the Shokunin Platform’s cloud infrastructure. It is intended to help contributors understand the deployment topology without requiring access to vendor dashboards or credentials. For operational procedures, deployment steps, or secret management, refer to terraform/README.md in the repository.

Infrastructure at a Glance

The Shokunin Platform uses two hosting providers:
ProviderRole
VercelHosts the Next.js frontend (serverless, edge-distributed)
GCP (Google Cloud Platform)Provides data persistence, compute, storage, and AI model access

Architecture Diagram

The diagram below shows how the major components connect. It is derived from terraform/README.md. Platform Infrastructure Diagram

Component Overview

Vercel — Frontend Hosting

The Next.js app (v0-shokunin-ai-platform) is deployed to Vercel. Vercel provides:
  • Serverless Next.js runtime (App Router, API routes)
  • Global CDN for static assets
  • Preview deployments for pull requests
The frontend communicates with GCP services via HTTPS — it never talks to Dolt directly.

GCP Cloud Run — Backend Services

Two backend services run on Cloud Run in a private VPC:
ServiceDescriptionPort
Beads APIREST API wrapper for the Beads task-tracking system. Bridges HTTPS requests from the frontend/CLI to the Dolt MySQL database.8080
Dolt ServerDolt SQL Server — the persistent data store for Beads. Configured with max-instances=1 (stateful).3306
Both services are containerized and their images are stored in GCP Artifact Registry.

GCP Filestore — Persistent Storage for Dolt

Dolt requires persistent storage to survive Cloud Run cold starts. GCP Filestore provides an NFS volume mounted into the Dolt Server container at /var/lib/dolt. Without Filestore, Dolt data would be lost on container restart.

Firebase / Firestore — Application Data

The platform uses Firebase services for application data:
ServiceDescription
FirestorePrimary application database. Stores: projects, workshops, agents, workflow nodes/edges, audit logs, user profiles.
Firebase AuthAuthentication provider (planned: will be wired through the shokunin-auth adapter).
The Next.js app connects to Firestore and Firebase Auth directly via the Firebase SDK (no backend proxy).

GCP Secret Manager — Secrets

Production secrets (API keys, database passwords) are stored in GCP Secret Manager. The platform services read secrets at runtime. Never store secrets in code or environment files committed to the repo.

GCP Artifact Registry — Container Images

Docker images for the Beads API and Dolt Server are stored in Artifact Registry. CI/CD (GitHub Actions) pushes new images on merge; Cloud Run pulls from this registry.

GCP IAM — Access Control

Service accounts and IAM roles control access between GCP services:
  • The platform service account (shokunin-dev-platform-sa) manages all Terraform-provisioned resources.
  • The GitHub Actions service account has Workload Identity Federation configured for CI/CD.

Connectivity Summary

Users


Vercel (Next.js app)
  │ HTTPS
  ├──► GCP Cloud Run: Beads API ──MySQL──► Dolt Server ──NFS──► Filestore

  ├──► Firebase (Firestore SDK)

  └──► Firebase (Auth SDK)

Terraform

All GCP resources are managed with Terraform. Infrastructure as code lives in terraform/. Key files:
FileDescription
terraform/platform/environments/dev/main.tfProvider config and GCP backend
terraform/platform/environments/dev/networking.tfVPC, subnet, VPC connector
terraform/platform/environments/dev/filestore.tfNFS persistent storage for Dolt
terraform/platform/environments/dev/cloud-run-dolt.tfDolt SQL Server Cloud Run service
terraform/platform/environments/dev/cloud-run-beads-api.tfBeads REST API Cloud Run service
terraform/platform/environments/dev/artifact-registry.tfDocker image registry
terraform/platform/environments/dev/secrets.tfSecret Manager secrets
terraform/platform/environments/dev/iam.tfService accounts, IAM bindings
Run Terraform via the wrapper script to use the correct service account:
./terraform/scripts/tf plan
./terraform/scripts/tf apply
Terraform applies modify production infrastructure. Always run plan first and review the output before apply. Do not run terraform commands directly — always use the ./terraform/scripts/tf wrapper.

Local vs. Production

ComponentLocal DevProduction
Dolt/Beads backendDocker Compose (docker-compose.yml)GCP Cloud Run + Filestore
Next.js frontendbun run dev on localhost:3000Vercel (serverless)
FirestoreFirebase Emulator (optional)GCP Firestore
Secrets.env.localGCP Secret Manager

This overview is intentionally high-level. For detailed deployment instructions, secret values, or operational runbooks, refer to terraform/README.md and the internal team documentation.