Neuron Runner is a React single-page app talking to a Django ASGI backend. The backend stores state in PostgreSQL and Redis and runs one Docker container per workspace.
text
text
React 19 + Vite web app
Chat | Files | Editor | Terminal | Git & PRs | Browser
│ HTTP (REST / SSE) + WebSocket
▼
Django 5.2 ASGI API (Daphne + Channels)
chat | sandbox | mcp | model | authentication | user
│ │ │
▼ ▼ ▼
PostgreSQL Redis Docker Engine ──► Preview proxy (:8090)
+ pgvector channels, cache, one container
WS tickets, per workspace
preview tokensBackend apps
| App | Responsibility |
|---|---|
authentication | JWT auth, email one-time codes, Google and GitHub OAuth, optional Turnstile |
chat | Streaming LLM chat, tool calling, memory, notes, attachments |
sandbox | Docker runtime, PTY terminal, port previews, Git, BYOK keys, secrets |
mcp | Model Context Protocol client, OAuth and tool execution |
model | Model catalog and reasoning settings |
user | User model, profiles, API keys |
core | Extension registry (see Extensions) |
Request flow
- The browser sends a chat message over HTTP; the reply streams back with Server-Sent Events.
- The chat agent calls tools (read file, run command, Git, MCP tools...). Sandbox tools execute inside the workspace container through the Docker API.
- The terminal is a WebSocket served by Django Channels. Each connection uses a one-time signed ticket stored in Redis.
- Port previews go through the separate preview proxy so sandbox apps never share an origin, cookies or storage with Neuron Runner itself.
Isolation
- Each workspace container runs with CPU, memory and PID limits (
--pids-limit 256) andno-new-privileges. - Files live in a persistent volume mounted at
/workspace; stopping a container does not delete them. - Workspace secrets are encrypted at rest and injected into the container as environment variables.