System Overview
The SuperBox backend is composed of three runtime components that work together:- Go API (Gin) - handles all REST requests from the frontend and CLI; delegates storage and security work to Python subprocess helpers
- Python helpers -
s3_helper.py(R2 IPC bridge) andsecurity_helper.py(5-stage scan runner), invoked by the Go API viaexec.Command - Cloudflare Worker + Durable Object - stateless edge proxy + stateful session runtime for MCP execution
Go API Layer
Framework: Gin (Go 1.26)Auth: Firebase JWT middleware on all write endpoints
Route groups
Middleware stack
- CORS
- Logger (request / response)
- Recovery (panic to 500)
- Firebase auth (write endpoints)
- Rate limiter
Python Subprocess Helpers
The Go API delegates R2 operations to Python subprocesses (via boto3), since the Go S3-compat SDK does not fully support Cloudflare R2 quirks.s3_helper.py
Handles all R2 operations:get_object, put_object, delete_object, list_objects.
CLOUDFLARE_R2_ENDPOINT, CLOUDFLARE_R2_ACCESS_KEY_ID, CLOUDFLARE_R2_SECRET_ACCESS_KEY, CLOUDFLARE_R2_BUCKET_NAME.
security_helper.py
Runs the 5-stage security pipeline on a given repository URL:- SonarCloud analysis
- Tool discovery (clone repo, regex scan for
@*.tool()decorators) - Snyk dependency scan
- GitGuardian secret detection
- Bandit Python scan
Data Models
Server metadata (stored in R2 as {server-name}.json)
Authentication Flow
Device flow (for CLIsuperbox auth login):