System Architecture

arcx.run is a cloud-first AI development environment. This document describes the system components, data flow, and security model.

High-Level Overview


  Browser / CLI / Agent
        |
        | HTTPS (TLS 1.3)
        v
  +------------------+
  |  Cloudflare CDN  |  WAF, DDoS protection, TLS termination
  +------------------+
        |
        v
  +------------------+
  |    Traefik        |  Reverse proxy, routing, rate limiting
  +------------------+
        |
   +----+------+------+
   |           |      |
   v           v      v
+--------+ +-------+ +----------+
| Orch.  | | Proxy | | Team     |
| :3000  | | :3002 | | State    |
|        | |       | | :3001    |
+--------+ +-------+ +----------+
   |           |           |
   v           v           v
+------+   +------+   +------+
|Docker|   | PG   |   |  WS  |
|Engine|   | + PG |   | (ws) |
+------+   +------+   +------+
   |
   v
+-----------------------------+
| Workspace Containers        |
| (code-server + arcx-agent)  |
| per-user, isolated          |
+-----------------------------+
    

Components

ComponentPortRole
orchestrator3000Core API server. Handles auth, workspace lifecycle, billing, admin, webhooks, workflow engine. Serves the landing page, dashboard, and docs.
arc-proxy3002Secret-scrubbing reverse proxy. Sits between workspace containers and external APIs. Intercepts outbound requests and redacts secrets from logs and responses.
team-state3001Real-time collaboration service. WebSocket server for live cursor positions, file edits, and team presence. Backed by PostgreSQL.
PostgreSQL5432Primary data store. Users, sessions, workspaces, teams, audit log, billing, invite codes, waitlist.
Traefik80/443Edge proxy. Routes *.arcx.run to workspace containers, main domain to orchestrator. Handles TLS via Let's Encrypt.
Prometheus9090Metrics collection. Scrapes /metrics from all services.
Grafana3003Dashboards and alerting. Visualizes Prometheus data.
NATS4222Internal message bus for async events between services.

Data Flow: User Request to Workspace

1. Authentication

Browser --> GET /auth/github --> 302 to GitHub OAuth
GitHub  --> GET /auth/callback?code=xxx
Orch    --> exchanges code for access_token
Orch    --> fetches GitHub user profile
Orch    --> upserts user in PostgreSQL
Orch    --> creates HMAC-signed session token (arc_session cookie)
Orch    --> 302 to /dashboard

2. Workspace Creation

Browser --> POST /dashboard/workspace { name: "my-project" }
Orch    --> validates session cookie (HMAC verification)
Orch    --> checks tier limits (free: 1 workspace, pro: 5, team: 20)
Orch    --> docker.createContainer({
              Image: WORKSPACE_IMAGE,
              Labels: { "traefik.http.routers...": "my-project.arcx.run" },
              HostConfig: {
                Memory: 8GB, NanoCpus: 4 cores,
                PidsLimit: 512, SecurityOpt: [seccomp profile],
                NetworkMode: "arc-net"
              }
           })
Orch    --> stores workspace record in PostgreSQL
Orch    --> returns { url: "https://my-project.arcx.run" }

3. Workspace Access

Browser --> https://my-project.arcx.run
Traefik --> routes to workspace container (code-server)
User    --> full IDE with arcx-agent, MCP servers, terminal

Security Model

Authentication and Sessions

Secret Scrubbing (arc-proxy)

Container Isolation

Network Security

Monitoring and Audit