The Hackathon Organizer Node

THON - The Hackathon Organizer Node

Run multiple VS Code sandbox instances with nginx SSL, groups-based user management, and optional local LLM inference

THON

Run multiple VS Code sandbox instances concurrently with nginx SSL reverse proxy, groups-based user management, persistent workspaces, and optional local LLM inference via Lemonade Server.

Features

  • Unified CLI: thon init, thon setup, thon run — one config file (thon.yaml) for everything
  • Multi-Instance: Multiple concurrent VS Code sandboxes from a single command
  • Groups-Based: Define users and groups in YAML or manage via dashboard
  • Web Dashboard: Streamlit dashboard for instance, group, Lemonade, and gateway management
  • SSL/TLS: Automatic nginx reverse proxy with mkcert or openssl certificates
  • Persistent Workspaces: PVC Docker volumes or host bind mounts for workspace persistence
  • Local LLM: Optional Lemonade Server integration for local inference
  • Semantic Indexing: Embedding model for Kilo Code's semantic code search
  • AI Gateway: Optional APISIX gateway with per-user or per-group rate limiting and API keys
  • Authentication: Local password for dashboard; OIDC/OAuth2 (GitHub, GitLab, LinkedIn) for REST API
  • Config Files: Store and manage groups YAML, kilo.json, and VS Code settings in the database
  • Kilo Code Ready: Auto-generated config with experimental flags and indexing for Kilo Code

Quick Start

1. Prerequisites

# One-time host setup
bash ./scripts/setup.sh

Installs: python3, nginx, docker.io, mkcert, openssl

2. Build Docker Image

docker build -t waterpistol/thon:latest ./

3. Initialize Configuration

# Interactive setup wizard (recommended)
python -m thon init

# Or non-interactive (CI-friendly)
python -m thon init --non-interactive

This creates a thon.yaml config file with all settings.

4. Setup and Run

# Install prerequisites and configure all components
python -m thon setup

# Start VS Code instances
python -m thon run

Alternatively, use main.py directly:

python ./scripts/main.py --groups groups.yaml --external-ip 1.2.3.4

Each user gets their own VS Code sandbox at https://<ip>/<endpoint_path>/.

Architecture

┌─────────────────────────────────────────────────────────────┐
│                         Host Machine                         │
│  ┌─────────────────────────────────────────────────────┐    │
│  │                    nginx (443)                       │    │
│  │         SSL termination + WebSocket proxy           │    │
│  └──────────────────────┬──────────────────────────────┘    │
│                         │                                    │
│  ┌──────────────────────┼──────────────────────────────┐    │
│  │                Docker Network                        │    │
│  │  ┌─────────────┐  ┌─────────────┐  ┌─────────────┐ │    │
│  │  │  Sandbox 1  │  │  Sandbox 2  │  │  Sandbox 3  │ │    │
│  │  │ code-server │  │ code-server │  │ code-server │ │    │
│  │  │   :8443     │  │   :8444     │  │   :8445     │ │    │
│  │  └─────────────┘  └─────────────┘  └─────────────┘ │    │
│  └─────────────────────────────────────────────────────┘    │
│                                                              │
│  ┌─────────────────────────────────────────────────────┐    │
│  │           Lemonade Server (Optional)                 │    │
│  │    Chat model + Embedding model (semantic search)    │    │
│  │                   :13305                             │    │
│  └─────────────────────────────────────────────────────┘    │
│                                                              │
│  ┌─────────────────────────────────────────────────────┐    │
│  │         APISIX AI Gateway (Optional)                 │    │
│  │    Rate limiting + per-user/group API keys           │    │
│  │    Chat route + Embedding route                      │    │
│  │                   :9080                              │    │
│  └─────────────────────────────────────────────────────┘    │
└─────────────────────────────────────────────────────────────┘

Components

ComponentRole
thon CLIUnified entry point: thon init, thon setup, thon run, thon config
main.pyOrchestrates sandbox creation, nginx configs, workspace setup
Streamlit DashboardWeb UI for instance, group, Lemonade, and gateway management (:8501)
FastAPI REST APIProgrammatic API for instances, groups, Lemonade, gateway, auth (:8100)
nginxSSL termination + WebSocket proxy (per-port server blocks)
code-serverVS Code in the browser, runs HTTP inside each sandbox
Lemonade ServerOptional local LLM inference (chat + embedding models)
APISIX GatewayOptional rate limiting with per-user or per-group API keys

Network Modes

Network mode is auto-detected from the server-returned endpoint format:

ModeEndpoint FormatDetection
Host127.0.0.1:8443No / after port
Bridge127.0.0.1:52322/proxy/8443/proxy/ in endpoint

Workspace Persistence

ModeStorageLifecycle
PVC VolumeDocker named volume (thon-workspace-*)Persists across instance recreations
Bind MountHost directory (--workspace-dir)Persists on host filesystem
EphemeralInside containerLost when container is removed

PVC volumes are created automatically when users are imported via the dashboard or thon.yaml. When a sandbox is recreated, the same PVC volume is reattached.

Next Steps

On this page