Skip to main content

coditect.ai IDE - Technical Analysis & Architecture

Date: November 24, 2025 Status: ✅ Production Operational (Build #32) URL: https://coditect.ai Purpose: Deep-dive analysis of deployed IDE for design system and architecture reference


Executive Summary

coditect.ai is a production cloud-based AI-powered IDE built on Eclipse Theia 1.65 with React 18 frontend, Rust backend, and FoundationDB 7.1+ for persistence. Deployed on GKE with hybrid StatefulSet architecture achieving 75% storage cost reduction ($291.60/year savings).

Key Metrics:

  • Status: Production operational (Build #32, deployed Oct 29, 2025)
  • Pods: 3/3 running (coditect-combined-hybrid StatefulSet)
  • Storage: 45 GB total (10 GB workspace + 5 GB config per pod)
  • URL: https://coditect.ai (frontend), https://coditect.ai/theia (IDE)
  • Backend: Rust + Actix-web + JWT + FoundationDB
  • Frontend: React 18 + TypeScript 5.3 + Vite 5.4 + Chakra UI 2.8

Architecture Overview

Deployment Topology

Internet

└─▶ GKE Ingress (34.8.51.57)

├─ coditect.ai → coditect-combined-service-hybrid
├─ www.coditect.ai → coditect-combined-service-hybrid
└─ api.coditect.ai → coditect-api-v5-service

GKE Cluster: coditect-cluster
├─ StatefulSet: coditect-combined-hybrid (3 pods)
│ ├─ React 18 frontend (dist/)
│ ├─ Eclipse Theia 1.65 IDE
│ ├─ NGINX reverse proxy
│ │ ├─ / → Frontend (React)
│ │ └─ /theia → IDE (Theia)
│ └─ PVCs (per pod):
│ ├─ workspace (10 GB) - User files, projects
│ └─ theia-config (5 GB) - Settings, extensions

├─ Deployment: coditect-api-v5 (3 pods)
│ ├─ Rust (Actix-web 4.x)
│ ├─ JWT authentication
│ └─ FoundationDB client

└─ StatefulSet: FoundationDB (5 pods)
├─ 3 coordinators (coordination layer)
└─ 2 proxies (client connections)

Technology Stack

Frontend (React 18 Wrapper):

{
"react": "^18.3.1",
"typescript": "^5.3.3",
"vite": "^5.4.0",
"@chakra-ui/react": "^2.8.0",
"@emotion/react": "^11.11.0"
}

IDE (Eclipse Theia 1.65):

  • Monaco Editor (VS Code editor component)
  • xterm.js (terminal emulation)
  • 20+ VS Code extensions (ESLint, Prettier, GitLens)
  • Icon themes: vs-seti, vscode-icons
  • Custom branding and theming

Backend (Rust V5):

[dependencies]
actix-web = "4.x"
tokio = { version = "1.x", features = ["full"] }
foundationdb = "0.8"
jsonwebtoken = "9.x"
serde = { version = "1.0", features = ["derive"] }

Database (FoundationDB 7.1+):

  • ACID transactions (serializable isolation)
  • Sub-10ms latency
  • Multi-model: key-value core with document/graph layers
  • Strong consistency guarantees
  • Fault-tolerant, self-healing

Infrastructure:

  • GKE (Google Kubernetes Engine)
  • NGINX (reverse proxy, routing)
  • GCE Persistent Disk SSD (storage)
  • Google-managed SSL certificates

FoundationDB Architecture

Data Model

/az1ai-ide/
├── sessions/
│ ├── {session-id}/
│ │ ├── metadata # Session info, timestamps
│ │ ├── editor-tabs/ # Open files, cursor positions
│ │ ├── llm-messages/ # Conversation history
│ │ └── config/ # Session-specific settings

├── files/
│ ├── {file-path}/
│ │ ├── content # File contents
│ │ ├── metadata # Language, encoding, timestamps
│ │ └── versions/ # Version history (future)

├── settings/
│ ├── global/ # Global preferences
│ └── workspace/ # Workspace-specific settings

└── models/
└── {model-id}/ # LLM model configurations

Subspace Design

// Directory layer structure
const az1aiDirectory = new DirectoryLayer();

const sessionsSubspace = az1aiDirectory.createOrOpen(db, ['sessions']);
const filesSubspace = az1aiDirectory.createOrOpen(db, ['files']);
const settingsSubspace = az1aiDirectory.createOrOpen(db, ['settings']);

Why FoundationDB Was Chosen

ADR-004 Decision Rationale:

  1. ACID Transactions: Full ACID compliance with serializable isolation
  2. Multi-Model: Key-value core with document/graph layers
  3. Performance: Sub-10ms latency, millions of operations/sec
  4. Scalability: Distributed architecture, horizontal scaling
  5. Consistency: Strong consistency guarantees
  6. Fault Tolerance: Self-healing, automatic replication
  7. Open Source: Apache 2.0 license, active community

Alternatives Rejected:

  • IndexedDB: Limited to single browser, no multi-client sync
  • PostgreSQL: Relational overhead, less performance than FDB
  • MongoDB: Eventual consistency not sufficient
  • Redis: In-memory only, no ACID guarantees

Key Features for IDE:

  • Session isolation (each session in separate subspace)
  • Atomic updates (file saves, state changes in transactions)
  • Watch API (real-time updates for collaborative features)
  • Conflict resolution (automatic handling of concurrent edits)
  • Backup/Restore (point-in-time recovery)

Hybrid Storage Architecture

Storage Evolution

Original (Build #1-31):

  • 6 pods × 30 GB = 180 GB total
  • Per-pod Docker image storage + user data
  • Cost: $388.80/year

Hybrid (Build #32+):

  • 3 pods × 15 GB = 45 GB total (75% reduction)
  • Shared Docker layers (read-only)
  • User-specific PVCs (workspace + config)
  • Cost: $97.20/year
  • Savings: $291.60/year

StatefulSet Configuration

k8s/theia-statefulset-hybrid.yaml:

apiVersion: apps/v1
kind: StatefulSet
metadata:
name: coditect-combined-hybrid
spec:
serviceName: coditect-combined-service-hybrid
replicas: 3
volumeClaimTemplates:
- metadata:
name: workspace
spec:
accessModes: ["ReadWriteOnce"]
resources:
requests:
storage: 10Gi
storageClassName: standard-rwo

- metadata:
name: theia-config
spec:
accessModes: ["ReadWriteOnce"]
resources:
requests:
storage: 5Gi
storageClassName: standard-rwo

Volume Mounts:

volumeMounts:
- name: workspace
mountPath: /workspace
- name: theia-config
mountPath: /home/theia/.theia

UI Design System

Header Specifications

Height: 40px (optimized Oct 2025) Location: src/components/Header.tsx:66

<Box
as="header"
position="sticky"
top={0}
zIndex={1000}
bg={headerBg}
borderBottom="1px"
borderColor={borderColor}
height="40px" // Optimized from 56px
>
{/* Logo */}
<Image src="/logo.svg" alt="CODITECT" height="24px" />

{/* Navigation */}
<HStack spacing={8}>
<Link to="/ai-studio">AI Studio</Link>
<Link to="/workspace">Workspace</Link>
<Link to="/theia">Theia IDE</Link>
</HStack>

{/* User Menu */}
<Menu>
<MenuButton>
<Avatar size="sm" name={user.name} src={user.avatar} />
</MenuButton>
<MenuList>
<MenuItem icon={<FiUser />}>Profile</MenuItem>
<MenuItem icon={<FiSettings />}>Settings</MenuItem>
<MenuItem icon={<FiLogOut />}>Logout</MenuItem>
</MenuList>
</Menu>
</Box>

Padding: py={2} (compact) Location: src/components/Footer.tsx:94

<Box
as="footer"
bg={footerBg}
borderTop="1px"
borderColor={borderColor}
py={2} // Optimized from py={4}
px={4}
>
<Container maxW="container.xl">
<Flex justify="space-between" align="center">
<Text fontSize="sm" color="gray.600">
© 2025 AZ1.AI INC. All rights reserved.
</Text>
<HStack spacing={4}>
<Link fontSize="sm">Privacy</Link>
<Link fontSize="sm">Terms</Link>
<Link fontSize="sm">Support</Link>
</HStack>
</Flex>
</Container>
</Box>

Color System

Chakra UI Theme:

const theme = extendTheme({
colors: {
brand: {
50: '#f0f9ff',
100: '#e0f2fe',
200: '#bae6fd',
300: '#7dd3fc',
400: '#38bdf8',
500: '#0ea5e9', // Primary
600: '#0284c7',
700: '#0369a1',
800: '#075985',
900: '#0c4a6e',
}
},
fonts: {
body: `-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif`,
heading: `-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif`,
mono: `'Fira Code', 'Courier New', monospace`,
},
config: {
initialColorMode: 'light',
useSystemColorMode: true,
}
})

Typography

System Font Stack:

font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto',
'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans',
'Droid Sans', 'Helvetica Neue', sans-serif;

Monospace (Code/Terminal):

font-family: 'Fira Code', ui-monospace, SFMono-Regular, 'SF Mono',
Menlo, Consolas, 'Liberation Mono', monospace;

Rust Backend Architecture

Actix-web Service Structure

// src/main.rs
use actix_web::{web, App, HttpServer};
use actix_cors::Cors;

#[actix_web::main]
async fn main() -> std::io::Result<()> {
// Initialize FoundationDB
let fdb = init_fdb().await?;

// HTTP Server
HttpServer::new(move || {
App::new()
.app_data(web::Data::new(fdb.clone()))
.wrap(Cors::permissive())
.wrap(Logger::default())
.service(
web::scope("/api/v1")
.service(auth_routes())
.service(session_routes())
.service(file_routes())
)
})
.bind(("0.0.0.0", 8001))?
.run()
.await
}

JWT Authentication

// src/middleware/auth.rs
use jsonwebtoken::{decode, DecodingKey, Validation};

pub async fn verify_jwt(token: &str) -> Result<Claims, AuthError> {
let validation = Validation::default();
let key = DecodingKey::from_secret(SECRET_KEY.as_ref());

decode::<Claims>(token, &key, &validation)
.map(|data| data.claims)
.map_err(|_| AuthError::InvalidToken)
}

FoundationDB Integration

// src/db/fdb.rs
use foundationdb::{Database, Transaction};

pub async fn save_session(
db: &Database,
session_id: &str,
data: SessionData,
) -> Result<(), FdbError> {
let trx = db.create_trx()?;

let key = format!("sessions/{}/metadata", session_id);
let value = serde_json::to_vec(&data)?;

trx.set(&key.as_bytes(), &value);
trx.commit().await?;

Ok(())
}

Build & Deployment Process

Cloud Build Configuration

cloudbuild-combined.yaml:

steps:
# Build frontend
- name: 'node:18'
entrypoint: 'bash'
args:
- '-c'
- |
export NODE_OPTIONS="--max-old-space-size=8192"
npm install
npm run build

# Build Docker image
- name: 'gcr.io/cloud-builders/docker'
args:
- 'build'
- '-t'
- 'gcr.io/$PROJECT_ID/coditect-combined:$SHORT_SHA'
- '.'

# Push to GCR
- name: 'gcr.io/cloud-builders/docker'
args:
- 'push'
- 'gcr.io/$PROJECT_ID/coditect-combined:$SHORT_SHA'

# Deploy to GKE
- name: 'gcr.io/cloud-builders/kubectl'
args:
- 'set'
- 'image'
- 'statefulset/coditect-combined-hybrid'
- 'combined=gcr.io/$PROJECT_ID/coditect-combined:$SHORT_SHA'
env:
- 'CLOUDSDK_COMPUTE_REGION=us-central1'
- 'CLOUDSDK_CONTAINER_CLUSTER=coditect-cluster'

options:
machineType: 'E2_HIGHCPU_32'
diskSizeGb: 100

NGINX Routing

nginx-combined.conf:

server {
listen 80;
server_name _;

# Frontend (React)
location / {
root /workspace/dist;
try_files $uri $uri/ /index.html;

# Cache static assets
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2)$ {
expires 1y;
add_header Cache-Control "public, immutable";
}
}

# IDE (Theia)
location /theia {
proxy_pass http://localhost:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
}

# Backend API
location /api/v1 {
proxy_pass http://localhost:8001;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
}

Extension Marketplace Integration

Open VSX Registry

Configuration:

{
"extensions": {
"autoInstall": true,
"marketplace": {
"url": "https://open-vsx.org/vscode/gallery",
"itemUrl": "https://open-vsx.org/vscode/item"
}
}
}

Bundled Extensions:

  • ESLint (dbaeumer.vscode-eslint)
  • Prettier (esbenp.prettier-vscode)
  • GitLens (eamodio.gitlens)
  • Python (ms-python.python)
  • TypeScript (vscode.typescript-language-features)
  • Docker (ms-azuretools.vscode-docker)
  • Rust Analyzer (rust-lang.rust-analyzer)
  • Live Share (ms-vsliveshare.vsliveshare)

Known Issue:

  • Rate limiting (HTTP 429) from open-vsx.org during peak hours
  • Non-blocking (core IDE functional)
  • Workaround: Pre-bundle extensions in Docker image

Sprint History

Sprint 1: Backend + Auth (Oct 14-16, 2025) ✅

  • Rust backend with Actix-web
  • JWT authentication implementation
  • FoundationDB integration
  • User registration and login endpoints

Sprint 2: Frontend + Theia (Oct 17-19, 2025) ✅

  • React 18 wrapper with TypeScript
  • Eclipse Theia 1.65 integration
  • NGINX routing configuration
  • GKE deployment
  • Icon themes and branding

Sprint 2.5: Hybrid Storage Migration (Oct 29, 2025) ✅

  • Phase 1: Config migration (standard → hybrid)
  • Phase 2: Pod recreation (3/3 hybrid pods)
  • Phase 3: Ingress routing update
  • Phase 4: Verification and testing
  • Phase 5: Standard cleanup (pending, after 48h stability)
  • Result: 75% storage reduction, $291.60/year savings

Build #32: UI Optimization (Oct 29, 2025) ✅

  • Header: 56px → 40px (28% reduction)
  • Footer: py={4} → py={2} (50% reduction)
  • Vertical space gain: ~32px (~3-4% on 1080p)
  • Deployed to 3/3 hybrid pods

Sprint 3: AI Integrations (NOT STARTED)

  • LM Studio multi-LLM integration (16+ models)
  • MCP (Model Context Protocol) integration
  • A2A (Agent-to-Agent) protocol
  • Multi-session workspace architecture

Performance Metrics

Latency

OperationTargetActual (Build #32)
Page Load (Frontend)< 2s~1.2s
Theia IDE Load< 5s~3.8s
API Response (Auth)< 200ms~120ms
FDB Read< 10ms~5-8ms
FDB Write< 20ms~12-15ms

Resource Usage

ResourcePer Pod3 Pods Total
CPU Request500m1,500m (1.5 cores)
CPU Limit2000m6,000m (6 cores)
Memory Request1Gi3Gi
Memory Limit4Gi12Gi
Storage (workspace)10Gi30Gi
Storage (config)5Gi15Gi

Cost Analysis

Monthly Costs (GKE + Storage):

  • GKE Cluster: ~$150/month (3 nodes, n1-standard-2)
  • Persistent Storage: $8.10/month (45 GB SSD)
  • Load Balancer: ~$20/month
  • FoundationDB Storage: ~$10/month
  • Total: ~$188/month

Annual Costs:

  • Before Hybrid: ~$580/year (180 GB storage)
  • After Hybrid: ~$288/year (45 GB storage)
  • Savings: $292/year (50% reduction)

Security Measures

Authentication & Authorization

JWT Token Structure:

{
"sub": "user-id",
"email": "user@example.com",
"role": "user",
"tenant_id": "tenant-uuid",
"exp": 1698765432,
"iat": 1698679032
}

Role-Based Access Control (RBAC):

  • admin: Full system access
  • user: Standard user access (own data only)
  • guest: Read-only access (limited)

Network Security

Kubernetes Network Policies:

apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: coditect-combined-policy
spec:
podSelector:
matchLabels:
app: coditect-combined-hybrid
policyTypes:
- Ingress
- Egress
ingress:
- from:
- podSelector:
matchLabels:
app: ingress-controller
ports:
- protocol: TCP
port: 80

CORS Configuration:

let cors = Cors::default()
.allowed_origin("https://coditect.ai")
.allowed_origin("https://www.coditect.ai")
.allowed_methods(vec!["GET", "POST", "PUT", "DELETE"])
.allowed_headers(vec![header::AUTHORIZATION, header::CONTENT_TYPE])
.max_age(3600);

Monitoring & Observability

Health Checks

Liveness Probe:

livenessProbe:
httpGet:
path: /health
port: 80
initialDelaySeconds: 30
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 3

Readiness Probe:

readinessProbe:
httpGet:
path: /ready
port: 80
initialDelaySeconds: 10
periodSeconds: 5
timeoutSeconds: 3
failureThreshold: 3

Logging

Structured Logging (Rust):

use tracing::{info, warn, error};

#[tracing::instrument]
async fn handle_request(req: HttpRequest) -> Result<HttpResponse> {
info!("Handling request: {} {}", req.method(), req.uri());

match process_request(req).await {
Ok(resp) => {
info!("Request successful");
Ok(resp)
}
Err(e) => {
error!("Request failed: {}", e);
Err(e)
}
}
}

Metrics (Future)

Prometheus Integration (Planned):

  • HTTP request duration histogram
  • HTTP request count by status code
  • FoundationDB operation latency
  • Active WebSocket connections
  • Pod resource usage (CPU, memory)

Documentation Location

Primary Documentation:

  • CLAUDE.md - AI assistant context and quick reference
  • docs/DEFINITIVE-V5-architecture.md - Complete V5 architecture
  • docs/07-adr/ADR-004-use-foundationdb-for-persistence.md - FDB decision
  • docs/10-execution-plans/BUILD-COMPLETION-SUMMARY.md - Build history
  • docs/10-execution-plans/2025-10-29T09-35-44Z-PROJECT-STATUS-HYBRID-PRODUCTION-UI-OPTIMIZED.md - Latest status

Configuration Files:

  • cloudbuild-combined.yaml - Cloud Build config
  • k8s/theia-statefulset-hybrid.yaml - Hybrid StatefulSet
  • nginx-combined.conf - NGINX routing
  • start-combined.sh - Container startup script

Source Code:

  • src/ - React 18 frontend (28 pages)
  • backend/src/ - Rust backend (Actix-web)
  • theia-app/src/browser/ - Custom Theia branding

Key Takeaways for License Management Platform

What to Adopt

  1. UI Design Patterns:

    • Header height: 40px (compact, efficient)
    • Footer padding: py={2} (minimal footprint)
    • System font stack (native rendering)
    • Chakra UI theme configuration
  2. Deployment Strategy:

    • Hybrid StatefulSet for cost optimization
    • NGINX reverse proxy for routing
    • Google-managed SSL certificates
    • Health checks and readiness probes
  3. Security Practices:

    • JWT authentication with role-based access
    • CORS configuration
    • Kubernetes network policies
    • Structured logging
  4. Cost Optimization:

    • Shared Docker layers
    • User-specific PVCs only
    • Right-sized resource requests/limits

What to Avoid

  1. Over-provisioning storage (learn from 180 GB → 45 GB optimization)
  2. Tight coupling between frontend and backend
  3. Missing health checks (caused deployment issues)
  4. Inadequate logging (debugging was difficult early on)

What to Adapt

  1. Database Choice:

    • IDE uses FoundationDB (key-value, real-time)
    • License platform should use PostgreSQL (relational, django-multitenant)
  2. Backend Framework:

    • IDE uses Rust + Actix-web (performance-critical)
    • License platform should use Django (rapid development, admin interface)
  3. Frontend Framework:

    • IDE uses Chakra UI (component library)
    • License platform should use Tailwind + Shadcn/ui (consistent with workflow.coditect.ai)

Conclusion

coditect.ai IDE demonstrates a production-ready architecture with:

  • ✅ High-performance persistence (FoundationDB)
  • ✅ Modern frontend (React 18 + TypeScript)
  • ✅ Efficient backend (Rust + Actix-web)
  • ✅ Cost-optimized storage (hybrid StatefulSet)
  • ✅ Professional UI/UX (40px header, compact footer)

Key lessons for License Management Platform:

  • Follow established design patterns (colors, typography, layout)
  • Use proven deployment strategies (GKE, StatefulSet, NGINX)
  • Prioritize cost optimization (hybrid storage model)
  • Implement comprehensive health checks and logging
  • Choose technologies based on use case (PostgreSQL > FoundationDB for relational data)

Document Version: 1.0 Last Updated: November 24, 2025 Status: APPROVED ✅ Maintained By: CODITECT Infrastructure Team