# 0gis0/docker-sandboxes architecture

> Architecture diagram of the GitHub repository 0gis0/docker-sandboxes, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/0gis0/docker-sandboxes
- Repository: https://github.com/0gis0/docker-sandboxes

## Overview

This repository is a Docker Sandboxes learning guide, with a reusable Bun kit, a custom-template example, and a small Bun static-file server. The documented user workflow is to install and authenticate with sbx, launch an agent, then manage sandboxes and customize them with network policies, kits, or templates. The README documents sbx behavior; sampled server code shows only HTTP routing and file serving, so no deeper connection between the server and the sandbox examples is asserted.

Main entry points: [`src/server.ts`](https://github.com/0gis0/docker-sandboxes/blob/main/src/server.ts) (Bun HTTP server), [`sandbox-kit/spec.yaml`](https://github.com/0gis0/docker-sandboxes/blob/main/sandbox-kit/spec.yaml) (Bun toolkit), [`sandbox-kit/files`](https://github.com/0gis0/docker-sandboxes/tree/main/sandbox-kit/files) (Kit files), [`Dockerfile`](https://github.com/0gis0/docker-sandboxes/blob/main/Dockerfile) (Custom template)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_sandbox["Sandbox workflow"]
  node_sbx["sbx CLI"]
  node_agents["AI agents"]
  node_dashboard["Sandbox dashboard"]
  node_policies["Network policies"]
end

subgraph group_custom["Customization artifacts"]
  node_kit["Bun toolkit<br/>[spec.yaml]"]
  node_kitfiles["Kit files"]
  node_template["Custom template"]
end

subgraph group_web["Bun example server"]
  node_server["Bun HTTP server<br/>[server.ts]"]
  node_page["Web page<br/>[index.html]"]
  node_styles["Stylesheet<br/>[styles.css]"]
end

node_user(("Developer"))
node_browser(("Browser client"))

node_user -->|"runs commands"| node_sbx
node_sbx -->|"launches"| node_agents
node_user -->|"opens"| node_dashboard
node_user -->|"manages"| node_policies
node_sbx -->|"applies kit"| node_kit
node_kit -->|"copies files"| node_kitfiles
node_sbx -->|"runs template"| node_template
node_user -->|"requests page"| node_browser
node_browser -.->|"sends HTTP request"| node_server
node_server -->|"serves file"| node_page
node_server -->|"serves file"| node_styles

click node_kit "https://github.com/0gis0/docker-sandboxes/blob/main/sandbox-kit/spec.yaml"
click node_kitfiles "https://github.com/0gis0/docker-sandboxes/tree/main/sandbox-kit/files"
click node_template "https://github.com/0gis0/docker-sandboxes/blob/main/Dockerfile"
click node_server "https://github.com/0gis0/docker-sandboxes/blob/main/src/server.ts"
click node_page "https://github.com/0gis0/docker-sandboxes/blob/main/src/public/index.html"
click node_styles "https://github.com/0gis0/docker-sandboxes/blob/main/src/public/styles.css"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_sbx,node_agents,node_dashboard,node_policies,node_browser toneBlue
class node_kit,node_kitfiles,node_template toneAmber
class node_server,node_page,node_styles toneMint
class node_user toneIndigo
```

## Components

### Sandbox workflow

- **sbx CLI**
- **AI agents**
- **Sandbox dashboard**
- **Network policies**

### Customization artifacts

- [Bun toolkit](https://github.com/0gis0/docker-sandboxes/blob/main/sandbox-kit/spec.yaml): `sandbox-kit/spec.yaml`
- [Kit files](https://github.com/0gis0/docker-sandboxes/tree/main/sandbox-kit/files): `sandbox-kit/files`
- [Custom template](https://github.com/0gis0/docker-sandboxes/blob/main/Dockerfile): `Dockerfile`

### Bun example server

- [Bun HTTP server](https://github.com/0gis0/docker-sandboxes/blob/main/src/server.ts): `src/server.ts`
- [Web page](https://github.com/0gis0/docker-sandboxes/blob/main/src/public/index.html): `src/public/index.html`
- [Stylesheet](https://github.com/0gis0/docker-sandboxes/blob/main/src/public/styles.css): `src/public/styles.css`

### Other components

- **Developer**
- **Browser client**

## Connections

- Developer → sbx CLI: runs commands (evidence: `README.md`)
- sbx CLI → AI agents: launches (evidence: `README.md`)
- Developer → Sandbox dashboard: opens (evidence: `README.md`)
- Developer → Network policies: manages (evidence: `README.md`)
- sbx CLI → Bun toolkit: applies kit (evidence: `README.md`)
- Bun toolkit → Kit files: copies files (evidence: `README.md`)
- sbx CLI → Custom template: runs template (evidence: `README.md`)
- Developer → Browser client: requests page
- Browser client → Bun HTTP server: sends HTTP request
- Bun HTTP server → Web page: serves file (evidence: `src/server.ts`)
- Bun HTTP server → Stylesheet: serves file (evidence: `src/server.ts`)
