This document introduces XaresAICoder, its purpose as a browser-based AI-powered development environment, and the high-level capabilities of the system. It provides a technical overview of the major components and their roles in delivering isolated development workspaces with integrated AI coding tools.
For detailed information on specific subsystems, see:
Sources: README.md1-14
XaresAICoder is a self-hosted platform that provides isolated VS Code development environments running in web browsers. Each workspace executes inside a dedicated Docker container running code-server, providing developers with full-featured IDE access through HTTP/HTTPS without requiring local IDE installation.
The system integrates multiple AI coding assistants (Continue, Cline, Aider, Gemini CLI, Claude Code, Qwen Code, OpenCode SST) pre-configured within each workspace, enabling AI-powered code completion, chat-based assistance, and automated file editing capabilities.
Sources: README.md1-14 README.md29-38
The platform manages the complete lifecycle of development workspaces through these capabilities:
| Capability | Implementation | Configuration |
|---|---|---|
| Isolated Containers | Each workspace runs in separate Docker container with code-server:8082 | docker-compose.yml DockerService |
| Resource Allocation | Configurable CPU cores (1-8) and memory (1GB-16GB) per workspace | CPU_PER_WORKSPACE, MEMORY_PER_WORKSPACE_MB |
| Concurrent Limits | Maximum simultaneous running workspaces enforced | MAX_CONCURRENT_WORKSPACES |
| Port Forwarding | Subdomain-based routing (e.g., projectid-5000.localhost) | nginx.conf.template |
| Password Protection | Optional bcrypt-hashed password security | WorkspaceService |
| State Persistence | Project metadata stored in JSON file | /app/workspaces/projects.json |
Sources: README.md18-27 README.md236-309
Projects can be organized into custom groups with drag-and-drop functionality:
/app/workspaces/groups.json/api/groups/, /api/groups/create, /api/groups/rename, /api/groups/deleteSources: README.md49-66 README.md138-156
Diagram: Git Integration Architecture and Code Components
The system supports three Git integration modes:
Sources: README.md41-47 README.md67-73 README.md125-136 README.md310-327
Diagram: System Components with Code Entity Mapping
Frontend Components:
XaresAICoder class in frontend/app.js manages application state, UI rendering, and API communicationBackend Services:
WorkspaceService class in server/workspaceService.js orchestrates workspace lifecycle and maintains the projects MapDockerService class in server/dockerService.js wraps Docker API for container operationsGitService class in server/gitService.js interfaces with Forgejo API for Git repository managementAPI Routes:
/api/projects/* endpoints for workspace CRUD operations/api/groups/* endpoints for project organization/api/notes/* endpoints for project metadata storageInfrastructure:
xares-aicoder-network Docker bridge network enables container communication/var/run/docker.sock socket mount enables Docker API access from backend containerRuntime Environment:
xares-aicoder-codeserver:latest custom image based on codercom/code-server:latestworkspace_data volume persists user code, VS Code settings, and project metadataSources: README.md1-14 Diagram 1, Diagram 3, Diagram 4 from system diagrams
Diagram: Deployment Architecture with Code Entity References
The deploy.sh script orchestrates the deployment through five phases:
Image Building: build_code_server_image() function deploy.sh60-92 builds xares-aicoder-codeserver:latest from docker-image/Dockerfile
Environment Setup: setup_environment() function deploy.sh94-139 generates .env from .env.example with user-provided or default values
Network Creation: setup_network() function deploy.sh141-155 ensures xares-aicoder-network exists
Service Deployment: deploy_application() function deploy.sh157-185 executes docker compose up -d using docker-compose.yml
Optional Git Server: When --git-server flag is provided, Forgejo service is started via git-server profile
Environment variables from .env propagate to all services:
| Variable | Purpose | Default | Used By |
|---|---|---|---|
BASE_DOMAIN | Domain for subdomain routing | localhost | nginx, server |
BASE_PORT | External port for web interface | 80 | nginx |
MAX_CONCURRENT_WORKSPACES | Concurrent workspace limit | 3 | WorkspaceService |
CPU_PER_WORKSPACE | CPU cores per workspace | 1.0 | DockerService |
MEMORY_PER_WORKSPACE_MB | Memory limit per workspace | 4096 | DockerService |
ENABLE_GIT_SERVER | Enable Forgejo git-server profile | false | docker-compose |
ENABLE_GPU | GPU passthrough to containers | false | DockerService |
Sources: README.md80-104 README.md186-200 README.md236-309 deploy.sh .env.example docker-compose.yml
Each workspace container is created with specific Docker configuration enforced by DockerService:
Diagram: Container Security Configuration
Resource limits are enforced through Docker's cgroup controls:
HostConfig.Memory set to MEMORY_PER_WORKSPACE_MB * 1024 * 1024 bytesHostConfig.NanoCpus set to CPU_PER_WORKSPACE * 1e9 nanocpusHostConfig.PidsLimit prevents fork bombsSources: README.md18-27 README.md229-234 README.md236-309 Diagram 3 from system diagrams
The frontend implements PWA capabilities for offline access:
XaresAICoder class enables home screen installationSources: README.md1-14 frontend/manifest.json frontend/sw.js Diagram 4 from system diagrams
Pre-installed AI coding assistants within each workspace container:
| Tool | Type | Installation Location | Setup Command |
|---|---|---|---|
| Continue | VS Code Extension | .local/share/code-server/extensions/ | Pre-installed |
| Cline | VS Code Extension | .local/share/code-server/extensions/ | Pre-installed |
| Aider | CLI Tool | /usr/local/bin/aider | pip install aider-chat |
| Gemini CLI | CLI Tool | /usr/local/bin/gemini | Via npm global |
| Claude Code | CLI Tool | /usr/local/bin/claude-code | Via npm global |
| Qwen Code | CLI Tool | /usr/local/bin/qwen | Via pip |
| OpenCode SST | VS Code Extension | .local/share/code-server/extensions/ | Pre-installed |
The docker-image/workspace-init.sh script initializes tool configurations and the setup_ai_tools command provides detailed setup instructions within workspaces.
Sources: README.md29-39 README.md164-171 docker-image/Dockerfile docker-image/workspace-init.sh
Four project templates are available during workspace creation:
Template initialization occurs in docker-image/workspace-init.sh based on the PROJECT_TYPE environment variable passed during container creation.
Sources: README.md111-124 docker-image/workspace-init.sh
Nginx reverse proxy configuration in build/nginx.conf.template implements dynamic subdomain routing:
{projectId}-{port}.{BASE_DOMAIN}abc123-5000.localhost routes to container xares-workspace-abc123 port 5000proxy_pass to container networkThis enables VS Code's port forwarding feature to automatically generate accessible URLs for development servers running inside containers.
Sources: README.md218-227 build/nginx.conf.template Diagram 1 from system diagrams
This overview provides the foundational understanding of XaresAICoder's architecture and capabilities. For detailed information on specific subsystems, refer to the linked wiki pages throughout this document.
Refresh this wiki