Skip to main content

CODITECT Development Studio - System Design Document (SDD)

Version: 1.0.0
Date: 2026-01-31
Status: Draft
Classification: Internal


1. Executive Summary

1.1 Purpose

This document describes the system design for the CODITECT Development Studio - a unified, multi-tenant web-based thin client that provides access to the CODITECT agent orchestration platform. The system enables organizations, teams, and individual users to interact with multiple LLM providers (Claude, Gemini, Codex, Kimi) through a browser-based interface.

1.2 Scope

  • In Scope: Browser-based thin client, real-time collaboration, multi-LLM orchestration, session management, project workspaces
  • Out of Scope: Native desktop applications, mobile apps (Phase 2), on-premises deployment (Phase 3)

1.3 Key Stakeholders

RoleResponsibility
Platform EngineeringCODITECT-CORE orchestrator, infrastructure
Frontend TeamThin client UI/UX
DevOpsDeployment, monitoring, scaling
SecurityAuthentication, authorization, compliance

2. System Overview

2.1 High-Level Architecture

┌─────────────────────────────────────────────────────────────────────────────────┐
│ CLIENT LAYER (Browser) │
│ ┌─────────────────────────────────────────────────────────────────────────┐ │
│ │ CODITECT Development Studio UI │ │
│ │ ┌──────────────┐ ┌────────────────────────────────────────────────┐ │ │
│ │ │ Chat Panel │ │ Visualization Panel │ │ │
│ │ │ ┌────────┐ │ │ ┌────────────┐ ┌────────────┐ ┌──────────┐ │ │ │
│ │ │ │ Agent │ │ │ │ Workflow │ │ Pitch │ │ Market │ │ │ │
│ │ │ │ Chat │ │ │ │ Diagram │ │ Deck │ │ Analysis│ │ │ │
│ │ │ └────────┘ │ │ └────────────┘ └────────────┘ └──────────┘ │ │ │
│ │ │ ┌────────┐ │ │ │ │ │
│ │ │ │Session │ │ │ Tabs: lims | pitch-deck | dev-tools | agents │ │ │
│ │ │ │History │ │ │ │ │ │
│ │ │ └────────┘ │ └─────────────────────────────────────────────────┘ │ │
│ │ └──────────────┘ │ │
│ └─────────────────────────────────────────────────────────────────────────┘ │
│ ▲ │
│ │ WebSocket / HTTPS │
└─────────┼───────────────────────────────────────────────────────────────────────┘

┌─────────▼───────────────────────────────────────────────────────────────────────┐
│ EDGE LAYER (Cloudflare) │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ┌─────────────────────────┐ │
│ │ CDN │ │ WAF │ │ Workers │ │ Durable Objects │ │
│ │ (Cache) │ │ (Security) │ │ (API) │ │ (Session Coordination) │ │
│ └─────────────┘ └─────────────┘ └──────┬──────┘ └─────────────────────────┘ │
└─────────────────────────────────────────────────────────────────────────────────┘

┌────────────────────────────────────────────┼────────────────────────────────────┐
│ SERVICE LAYER │ │
│ ┌──────────────────────────────────────────▼────────────────────────────────┐ │
│ │ CODITECT-CORE Orchestrator │ │
│ │ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────────────┐ │ │
│ │ │ Auth │ │ Tenant │ │ LLM │ │ Session │ │ State │ │ │
│ │ │ Service │ │ Resolver │ │ Router │ │ Manager │ │ Manager │ │ │
│ │ └────┬─────┘ └────┬─────┘ └────┬─────┘ └────┬─────┘ └────────┬─────────┘ │ │
│ │ └─────────────┴─────────────┴─────────────┴─────────────────┘ │ │
│ │ │ │
│ │ ┌─────────────────────────────────────────────────────────────────────┐ │ │
│ │ │ Provider Adapters (Claude | Gemini | Codex | Kimi) │ │ │
│ │ └─────────────────────────────────────────────────────────────────────┘ │ │
│ └────────────────────────────────────────────────────────────────────────────┘ │
└──────────────────────────────────────────────────────────────────────────────────┘

┌────────────────────────────────────────────┼────────────────────────────────────┐
│ COMPUTE LAYER │ │
│ ┌──────────────────────────────────────────▼────────────────────────────────┐ │
│ │ Ephemeral Sandbox Pool │ │
│ │ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │ │
│ │ │ Sandbox 1 │ │ Sandbox 2 │ │ Sandbox N │ │ Sandbox │ │ │
│ │ │ (Claude) │ │ (Gemini) │ │ (Kimi) │ │ (Codex) │ │ │
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ /home/dev │ │ /home/dev │ │ /home/dev │ │ /home/dev │ │ │
│ │ │ mounted │ │ mounted │ │ mounted │ │ mounted │ │ │
│ │ └──────┬───────┘ └──────┬───────┘ └──────┬───────┘ └──────┬───────┘ │ │
│ │ └─────────────────┴─────────────────┴─────────────────┘ │ │
│ └────────────────────────────────────────────────────────────────────────────┘ │
└──────────────────────────────────────────────────────────────────────────────────┘

┌────────────────────────────────────────────▼─────────────────────────────────────┐
│ STORAGE LAYER │
│ ┌─────────────────────┐ ┌─────────────────────┐ ┌──────────────────────────┐ │
│ │ R2 / GCS Buckets │ │ Durable Objects │ │ Git Remote (Backup) │ │
│ │ (Project Files) │ │ (Session State) │ │ (Version Control) │ │
│ │ │ │ │ │ │ │
│ │ /{org}/{team}/ │ │ /sessions/{id} │ │ github.com/... │ │
│ │ {user}/{project} │ │ │ │ │ │
│ └─────────────────────┘ └─────────────────────┘ └──────────────────────────┘ │
└──────────────────────────────────────────────────────────────────────────────────┘

2.2 Core Design Principles

PrincipleDescriptionImplementation
Thin ClientBrowser renders UI; all compute on serverNext.js SPA, WebSocket streams
Stateless SessionsEphemeral containers; state in R2/GCSMount home dirs from object storage
Multi-Tenant IsolationStrict org/team/user/project boundariesPath-based isolation, RBAC
LLM AgnosticRoute to best available providerAdapter pattern with circuit breaker
Git-NativeEvery session backed by version controlAuto-commit on checkpoint

3. System Components

3.1 Thin Client (Browser Application)

Technology Stack:

  • Framework: Next.js 14 (App Router)
  • Language: TypeScript 5.x
  • Styling: Tailwind CSS with custom design system
  • State: Zustand (client) + Server-sent events
  • Real-time: WebSocket (Socket.io)

Key Modules:

ModulePurposeKey Files
Chat InterfaceAgent communicationchat-panel.tsx, message-list.tsx
VisualizationWorkflow/pitch/market viewsviz-panel.tsx, workflow-diagram.tsx
Session ManagerActive session list, resumesession-list.tsx, session-card.tsx
Project ExplorerFile tree, navigationfile-tree.tsx, project-nav.tsx
Command PaletteQuick actions, shortcutscommand-palette.tsx

3.2 CODITECT-CORE Orchestrator

Responsibilities:

  1. Authentication & Authorization - JWT validation, API key management
  2. Tenant Resolution - Map requests to org/team/user/project context
  3. LLM Routing - Select provider based on task type, cost, availability
  4. Session Lifecycle - Spawn, monitor, terminate ephemeral sandboxes
  5. State Management - Coordinate between ephemeral compute and persistent storage

API Surface:

// Core API Routes
POST /api/v1/sessions // Create new session
GET /api/v1/sessions/:id // Get session status
DELETE /api/v1/sessions/:id // Terminate session
POST /api/v1/sessions/:id/exec // Execute command
GET /api/v1/sessions/:id/files // List files
POST /api/v1/chat // Send chat message
GET /api/v1/chat/:session/stream // Stream responses

// Management APIs
GET /api/v1/teams // List teams
GET /api/v1/projects // List projects
POST /api/v1/checkpoint // Create checkpoint
POST /api/v1/restore // Restore from checkpoint

3.3 Ephemeral Sandbox Pool

Sandbox Types:

TypeUse CaseLifecycle
InteractiveLive coding, chat sessions30-min idle timeout
BatchBackground jobs, buildsTask completion
PersistentLong-running services24-hour max

Resource Limits per Sandbox:

  • CPU: 2 vCPU (burst to 4)
  • Memory: 4GB (burst to 8GB)
  • Disk: 10GB ephemeral + mounted R2
  • Network: Outbound only, filtered

3.4 Storage Architecture

R2/GCS Bucket Structure:

bucket: coditect-{org-id}

├── teams/{team-id}/
│ ├── users/{user-id}/
│ │ ├── home/ # $HOME mount
│ │ │ ├── .coditect/ # CLI config
│ │ │ ├── .ssh/ # Git keys
│ │ │ └── .cache/ # Tool caches
│ │ │
│ │ └── projects/
│ │ ├── {project-id}/
│ │ │ ├── .git/ # Git repository
│ │ │ ├── src/ # Source code
│ │ │ └── .coditect/ # Project state
│ │
│ └── shared/ # Team resources
│ ├── templates/
│ └── assets/

├── sessions/
│ └── {session-id}/
│ ├── checkpoints/ # Session snapshots
│ └── logs/ # Execution logs

└── system/
└── cache/ # Shared tool cache

4. Data Flows

4.1 User Login & Session Initialization

4.2 Chat with Multi-LLM Routing

4.3 File Edit with Git Backup


5. Security Architecture

5.1 Authentication

MethodUse CaseImplementation
SSOEnterprise usersSAML 2.0, OIDC
API KeysService accountsHMAC-SHA256, rotation
OAuthThird-party integrationsGitHub, Google
Session JWTBrowser sessionsRS256, 1-hour expiry

5.2 Authorization (RBAC)

Role Hierarchy:

Organization Admin
├── Team Admin
│ ├── Project Lead
│ │ └── Developer
│ └── Analyst
└── Billing Admin

Permissions:

ResourceCreateReadUpdateDelete
Sessionsdeveloperallowneradmin
Projectsleadteamleadadmin
Teamsadminorgadminadmin
API Keysadminowner-owner

5.3 Data Isolation

  • Network: Sandboxes have no inter-container networking
  • Storage: Path-based isolation with strict prefix validation
  • Compute: VM-level isolation via Cloudflare Sandboxes
  • Memory: Encrypted at rest, TLS in transit

6. Scalability & Performance

6.1 Scaling Strategy

ComponentScaling MethodTrigger
CDNAutoGlobal edge
WorkersAutoRequest rate
SandboxesPool-basedQueue depth
R2N/A (serverless)N/A
Durable ObjectsShardingPer-object limits

6.2 Performance Targets

MetricTargetMeasurement
Page Load< 2sLighthouse
Session Start< 5sAPI latency
Chat Response< 1s TTFBLLM adapter
File List< 500msR2 LIST
Checkpoint< 3sGit commit + push

7. Deployment Architecture

7.1 Environments

EnvironmentPurposeSandbox Pool
ProductionLive usersIsolated, monitored
StagingPre-releaseShared, limited
DevelopmentFeature devLocal, ephemeral

7.2 CI/CD Pipeline

Developer Push


┌─────────────┐
│ Build │ → Next.js static export
└──────┬──────┘


┌─────────────┐
│ Test │ → Unit, integration, e2e
└──────┬──────┘


┌─────────────┐
│ Deploy │ → Cloudflare Pages (UI)
│ │ → Workers (API)
└─────────────┘

8. Appendix

8.1 Glossary

TermDefinition
Thin ClientBrowser-based UI with server-side compute
SandboxEphemeral isolated execution environment
CheckpointVersioned snapshot of session state
MOEMixture-of-Experts (multi-LLM routing)
FUSEFilesystem in Userspace (R2/GCS mounting)

8.2 References

  • ADR-141: Pitch Deck Studio Architecture
  • ADR-143: IN-PLACE Document Translation
  • MOE-Agents C4 Architecture
  • Cloudflare Workers Documentation
  • FAU Runway 11-Slide Framework

Document Owner: Platform Engineering Team
Review Cycle: Quarterly
Next Review: 2026-04-30