# anushka2503769/ctrl-alt-codejam-2026 architecture

> Architecture diagram of the GitHub repository anushka2503769/ctrl-alt-codejam-2026, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/anushka2503769/ctrl-alt-codejam-2026
- Repository: https://github.com/anushka2503769/ctrl-alt-codejam-2026

## Overview

#### Purpose and entry points
Volc Agent Launchpad is a single-user proof-of-concept platform for creating agents, giving each a persistent workspace, and executing multi-turn Codex CLI tasks backed by Volcengine Ark’s Responses API. The server starts from `apps/server/src/index.ts`; its Fastify application is assembled in `apps/server/src/app.ts`. The browser client starts at `apps/web/src/main.tsx` and renders `apps/web/src/App.tsx`.

#### Web control surface
The React/Vite frontend implements agent lifecycle management and the chat Playground. It calls the server through a small API boundary in `apps/web/src/api.ts`, using shared UI-domain shapes in `apps/web/src/types.ts`. The web app is a control client; execution and persistence remain server-side.

#### HTTP control plane
Fastify routes in `apps/server/src/app.ts` expose agent CRUD, lifecycle controls, and asynchronous turn/run state. `apps/server/src/agent-service.ts` owns application-level orchestration: it validates lifecycle transitions, retrieves agent state, starts work, and coordinates persistence and runtime invocation. Error translation is centralized in `apps/server/src/errors.ts`.

#### Durable agent state and workspaces
`apps/server/src/store.ts` persists agent metadata, conversations/run state, and Codex session/thread identifiers in JSON-backed local storage. `apps/server/src/workspace.ts` creates and resolves per-agent filesystem workspaces; deleted agents are archived rather than immediately destroyed. This separates durable user/task context from disposable turn execution environments.

#### Runtime abstraction and Codex execution
`apps/server/src/runner-factory.ts` selects the configured execution provider. `apps/server/src/codex-runner.ts` executes Codex CLI directly in the application runtime, suitable for ECS/container deployment. `apps/server/src/container-codex-runner.ts` instead creates a disposable Docker-, Colima-, or Podman-backed container for each local turn while mounting persistent workspace/session state. First turns create a Codex session; subsequent turns resume its stored thread.

#### External model boundary and configuration
Codex is configured to call the OpenAI-compatible Volcengine Ark Responses API using `ARK_API_KEY`, `ARK_MODEL`, and optional base URL settings. Server configuration, paths, runtime provider, sandbox mode, timeouts, and resource settings are collected in `apps/server/src/config.ts`. The core runtime images are defined by `Dockerfile` and `Dockerfile.runtime`; the latter packages Codex for isolated local execution.

#### Deployment and operational topology
`docker-compose.yml` runs the web/API application with persistent mounted state and environment-provided Ark credentials. For cloud deployment, `deploy/volcengine/main.tf` provisions Volcengine infrastructure, with bootstrap configuration in `deploy/volcengine/cloud-init.yaml.tftpl`. The deployed ECS profile runs Codex in the application container, while local POC mode favors per-turn runtime containers. The platform intentionally lacks identity, audit, tracing, and hardened sandbox middleware.

Main entry points: [`apps/server/src/app.ts`](https://github.com/anushka2503769/ctrl-alt-codejam-2026/blob/main/apps/server/src/app.ts) (HTTP routes), [`apps/server/src/agent-service.ts`](https://github.com/anushka2503769/ctrl-alt-codejam-2026/blob/main/apps/server/src/agent-service.ts) (Agent orchestration), [`apps/server/src/runner-factory.ts`](https://github.com/anushka2503769/ctrl-alt-codejam-2026/blob/main/apps/server/src/runner-factory.ts) (Runner selection), [`apps/server/src/container-codex-runner.ts`](https://github.com/anushka2503769/ctrl-alt-codejam-2026/blob/main/apps/server/src/container-codex-runner.ts) (Isolated Codex runner)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web client"]
  node_web_entry["Web entry<br/>React bootstrap<br/>[main.tsx]"]
  node_web_app["Agent control UI<br/>React app<br/>[App.tsx]"]
  node_web_api["Server API client<br/>API boundary<br/>[api.ts]"]
  node_web_types["UI domain types<br/>shared shapes<br/>[types.ts]"]
end

subgraph group_server["API control plane"]
  node_server_entry["Server entry<br/>Fastify bootstrap<br/>[index.ts]"]
  node_fastify_app["HTTP routes<br/>Fastify app<br/>[app.ts]"]
  node_agent_service["Agent orchestration<br/>application service<br/>[agent-service.ts]"]
  node_state_store[("Durable agent state<br/>JSON local store<br/>[store.ts]")]
  node_workspace["Agent workspaces<br/>filesystem manager<br/>[workspace.ts]"]
  node_errors["Error translation<br/>error boundary<br/>[errors.ts]"]
  node_config["Runtime configuration<br/>[config.ts]"]
end

subgraph group_runtime["Execution runtime"]
  node_runner_factory{{"Runner selection<br/>provider factory<br/>[runner-factory.ts]"}}
  node_codex_direct["Direct Codex runner<br/>application runtime<br/>[codex-runner.ts]"]
  node_codex_container["Isolated Codex runner<br/>per-turn container runtime"]
  node_codex_cli{{"Codex CLI<br/>task executor"}}
  node_ark_api{{"Volcengine Ark Responses API<br/>external model API"}}
end

subgraph group_ops["Deployment"]
  node_compose["Compose deployment<br/>local deployment<br/>[docker-compose.yml]"]
  node_runtime_image["Isolated runtime image<br/>container image<br/>[Dockerfile.runtime]"]
  node_ecs_iac["Volcengine ECS infrastructure<br/>Terraform deployment<br/>[main.tf]"]
  node_cloud_init["ECS bootstrap<br/>cloud-init template"]
end

node_web_entry -->|"renders"| node_web_app
node_web_app -->|"uses"| node_web_api
node_web_app -->|"uses"| node_web_types
node_web_api -->|"HTTP control requests"| node_fastify_app
node_server_entry -->|"starts"| node_fastify_app
node_fastify_app -->|"dispatches"| node_agent_service
node_fastify_app -->|"translates failures"| node_errors
node_agent_service -->|"reads and persists"| node_state_store
node_agent_service -->|"manages"| node_workspace
node_agent_service -->|"starts turns through"| node_runner_factory
node_config -->|"selects provider"| node_runner_factory
node_runner_factory -.->|"ECS mode"| node_codex_direct
node_runner_factory -.->|"local isolated mode"| node_codex_container
node_codex_direct -->|"executes"| node_codex_cli
node_codex_container -->|"executes in container"| node_codex_cli
node_workspace -->|"mounts persistent workspace"| node_codex_container
node_state_store -->|"supplies session/thread"| node_codex_cli
node_codex_cli -->|"Responses API calls"| node_ark_api
node_compose -->|"runs"| node_fastify_app
node_runtime_image -->|"provides image"| node_codex_container
node_ecs_iac -->|"bootstraps with"| node_cloud_init
node_ecs_iac -->|"deploys"| node_codex_direct

click node_web_entry "https://github.com/anushka2503769/ctrl-alt-codejam-2026/blob/main/apps/web/src/main.tsx"
click node_web_app "https://github.com/anushka2503769/ctrl-alt-codejam-2026/blob/main/apps/web/src/App.tsx"
click node_web_api "https://github.com/anushka2503769/ctrl-alt-codejam-2026/blob/main/apps/web/src/api.ts"
click node_web_types "https://github.com/anushka2503769/ctrl-alt-codejam-2026/blob/main/apps/web/src/types.ts"
click node_server_entry "https://github.com/anushka2503769/ctrl-alt-codejam-2026/blob/main/apps/server/src/index.ts"
click node_fastify_app "https://github.com/anushka2503769/ctrl-alt-codejam-2026/blob/main/apps/server/src/app.ts"
click node_agent_service "https://github.com/anushka2503769/ctrl-alt-codejam-2026/blob/main/apps/server/src/agent-service.ts"
click node_state_store "https://github.com/anushka2503769/ctrl-alt-codejam-2026/blob/main/apps/server/src/store.ts"
click node_workspace "https://github.com/anushka2503769/ctrl-alt-codejam-2026/blob/main/apps/server/src/workspace.ts"
click node_errors "https://github.com/anushka2503769/ctrl-alt-codejam-2026/blob/main/apps/server/src/errors.ts"
click node_config "https://github.com/anushka2503769/ctrl-alt-codejam-2026/blob/main/apps/server/src/config.ts"
click node_runner_factory "https://github.com/anushka2503769/ctrl-alt-codejam-2026/blob/main/apps/server/src/runner-factory.ts"
click node_codex_direct "https://github.com/anushka2503769/ctrl-alt-codejam-2026/blob/main/apps/server/src/codex-runner.ts"
click node_codex_container "https://github.com/anushka2503769/ctrl-alt-codejam-2026/blob/main/apps/server/src/container-codex-runner.ts"
click node_compose "https://github.com/anushka2503769/ctrl-alt-codejam-2026/blob/main/docker-compose.yml"
click node_runtime_image "https://github.com/anushka2503769/ctrl-alt-codejam-2026/blob/main/Dockerfile.runtime"
click node_ecs_iac "https://github.com/anushka2503769/ctrl-alt-codejam-2026/blob/main/deploy/volcengine/main.tf"
click node_cloud_init "https://github.com/anushka2503769/ctrl-alt-codejam-2026/blob/main/deploy/volcengine/cloud-init.yaml.tftpl"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_web_entry,node_web_app,node_web_api,node_web_types toneBlue
class node_server_entry,node_fastify_app,node_agent_service,node_state_store,node_workspace,node_errors,node_config toneAmber
class node_runner_factory,node_codex_direct,node_codex_container,node_codex_cli,node_ark_api toneMint
class node_compose,node_runtime_image,node_ecs_iac,node_cloud_init toneRose
```

## Components

### Web client

- [Web entry](https://github.com/anushka2503769/ctrl-alt-codejam-2026/blob/main/apps/web/src/main.tsx): React bootstrap · `apps/web/src/main.tsx`
- [Agent control UI](https://github.com/anushka2503769/ctrl-alt-codejam-2026/blob/main/apps/web/src/App.tsx): React app · Agent lifecycle management and chat Playground. · `apps/web/src/App.tsx`
- [Server API client](https://github.com/anushka2503769/ctrl-alt-codejam-2026/blob/main/apps/web/src/api.ts): API boundary · `apps/web/src/api.ts`
- [UI domain types](https://github.com/anushka2503769/ctrl-alt-codejam-2026/blob/main/apps/web/src/types.ts): shared shapes · `apps/web/src/types.ts`

### API control plane

- [Server entry](https://github.com/anushka2503769/ctrl-alt-codejam-2026/blob/main/apps/server/src/index.ts): Fastify bootstrap · `apps/server/src/index.ts`
- [HTTP routes](https://github.com/anushka2503769/ctrl-alt-codejam-2026/blob/main/apps/server/src/app.ts): Fastify app · Exposes agent CRUD, lifecycle, and asynchronous turn state. · `apps/server/src/app.ts`
- [Agent orchestration](https://github.com/anushka2503769/ctrl-alt-codejam-2026/blob/main/apps/server/src/agent-service.ts): application service · Validates transitions and coordinates state with execution. · `apps/server/src/agent-service.ts`
- [Durable agent state](https://github.com/anushka2503769/ctrl-alt-codejam-2026/blob/main/apps/server/src/store.ts): JSON local store · Stores agents, conversations, runs, and Codex session identifiers. · `apps/server/src/store.ts`
- [Agent workspaces](https://github.com/anushka2503769/ctrl-alt-codejam-2026/blob/main/apps/server/src/workspace.ts): filesystem manager · Creates persistent workspaces and archives deleted agents. · `apps/server/src/workspace.ts`
- [Error translation](https://github.com/anushka2503769/ctrl-alt-codejam-2026/blob/main/apps/server/src/errors.ts): error boundary · `apps/server/src/errors.ts`
- [Runtime configuration](https://github.com/anushka2503769/ctrl-alt-codejam-2026/blob/main/apps/server/src/config.ts): configuration · Collects provider, sandbox, paths, resources, timeouts, and Ark settings. · `apps/server/src/config.ts`

### Execution runtime

- [Runner selection](https://github.com/anushka2503769/ctrl-alt-codejam-2026/blob/main/apps/server/src/runner-factory.ts): provider factory · `apps/server/src/runner-factory.ts`
- [Direct Codex runner](https://github.com/anushka2503769/ctrl-alt-codejam-2026/blob/main/apps/server/src/codex-runner.ts): application runtime · Runs Codex CLI in the application container for ECS deployment. · `apps/server/src/codex-runner.ts`
- [Isolated Codex runner](https://github.com/anushka2503769/ctrl-alt-codejam-2026/blob/main/apps/server/src/container-codex-runner.ts): per-turn container runtime · Launches a disposable Docker, Colima, or Podman container per local turn. · `apps/server/src/container-codex-runner.ts`
- **Codex CLI**: task executor · Creates or resumes sessions using persisted thread state.
- **Volcengine Ark Responses API**: external model API · OpenAI-compatible API configured by ARK credentials and model settings.

### Deployment

- [Compose deployment](https://github.com/anushka2503769/ctrl-alt-codejam-2026/blob/main/docker-compose.yml): local deployment · Runs web/API with mounted persistent state and Ark environment credentials. · `docker-compose.yml`
- [Isolated runtime image](https://github.com/anushka2503769/ctrl-alt-codejam-2026/blob/main/Dockerfile.runtime): container image · Packages Codex for local isolated execution. · `Dockerfile.runtime`
- [Volcengine ECS infrastructure](https://github.com/anushka2503769/ctrl-alt-codejam-2026/blob/main/deploy/volcengine/main.tf): Terraform deployment · Provisions cloud infrastructure for direct application-container execution. · `deploy/volcengine/main.tf`
- [ECS bootstrap](https://github.com/anushka2503769/ctrl-alt-codejam-2026/blob/main/deploy/volcengine/cloud-init.yaml.tftpl): cloud-init template · `deploy/volcengine/cloud-init.yaml.tftpl`

## Connections

- Web entry → Agent control UI: renders
- Agent control UI → Server API client: uses
- Agent control UI → UI domain types: uses
- Server API client → HTTP routes: HTTP control requests
- Server entry → HTTP routes: starts
- HTTP routes → Agent orchestration: dispatches
- HTTP routes → Error translation: translates failures
- Agent orchestration → Durable agent state: reads and persists
- Agent orchestration → Agent workspaces: manages
- Agent orchestration → Runner selection: starts turns through
- Runtime configuration → Runner selection: selects provider
- Runner selection → Direct Codex runner: ECS mode
- Runner selection → Isolated Codex runner: local isolated mode
- Direct Codex runner → Codex CLI: executes
- Isolated Codex runner → Codex CLI: executes in container
- Agent workspaces → Isolated Codex runner: mounts persistent workspace
- Durable agent state → Codex CLI: supplies session/thread
- Codex CLI → Volcengine Ark Responses API: Responses API calls
- Compose deployment → HTTP routes: runs
- Isolated runtime image → Isolated Codex runner: provides image
- Volcengine ECS infrastructure → ECS bootstrap: bootstraps with
- Volcengine ECS infrastructure → Direct Codex runner: deploys
