# evgenyps/tinybots architecture

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

- Interactive diagram: https://gitdiagram.com/evgenyps/tinybots
- Repository: https://github.com/evgenyps/tinybots

## Overview

TinyBots is a local, loopback-only control panel for configured bots, not a bot-hosting API. The main workflow is: an owner configures projects and bots, views launcher status, then sends briefs or chats; API-bot replies may produce status notes. Owners can also inspect project files/docs and Git, and review/apply code proposals or merge decisions. The graph combines shown calls with README-documented capabilities; unsampled route internals are not inferred beyond those documented links.

Main entry points: [`apps/server/src/server.ts`](https://github.com/evgenyps/tinybots/blob/main/apps/server/src/server.ts) (HTTP router), [`apps/server/src/store/read.ts`](https://github.com/evgenyps/tinybots/blob/main/apps/server/src/store/read.ts) (Local data files), [`apps/web/src/App.tsx`](https://github.com/evgenyps/tinybots/blob/main/apps/web/src/App.tsx) (Page gate), [`apps/server/src/launcher/view.ts`](https://github.com/evgenyps/tinybots/blob/main/apps/server/src/launcher/view.ts) (Launcher assembly)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Owner interface"]
  node_app["Page gate<br/>[App.tsx]"]
  node_dashboard["Launcher UI<br/>[v6-shell.tsx]"]
  node_setup_ui["Setup wizard<br/>[setup-wizard.tsx]"]
  node_panels["Project panels<br/>[files-panel.tsx]"]
  node_proposal_ui["Proposal review<br/>[proposal-modal.tsx]"]
end

subgraph group_server["Local control server"]
  node_server["HTTP router<br/>[server.ts]"]
  node_config["Config loading<br/>[load.ts]"]
  node_setup["Config setup<br/>[setup.ts]"]
  node_launcher["Launcher assembly<br/>[view.ts]"]
end

subgraph group_bot["Bot and project workflows"]
  node_briefs["Brief workflow"]
  node_chat["Bot chat"]
  node_tools["Project tools<br/>[sandbox.ts]"]
  node_files["Files and docs<br/>[index.ts]"]
  node_git["Git summary"]
  node_proposals["Proposal engine<br/>[engine.ts]"]
  node_merge["Merge decisions"]
end

subgraph group_contracts["Contracts and state"]
  node_schema["Shared schemas<br/>[common.ts]"]
  node_state[("Local data files<br/>[read.ts]")]
end

node_owner(("Local owner"))
node_provider{{"LLM provider"}}

node_owner -->|"opens panel"| node_app
node_app -->|"checks setup"| node_server
node_app -->|"shows wizard"| node_setup_ui
node_app -->|"shows dashboard"| node_dashboard
node_owner -->|"configures bots"| node_setup_ui
node_setup_ui -->|"writes config"| node_server
node_server -->|"serves setup"| node_setup
node_setup -->|"validates config"| node_schema
node_setup -->|"writes atomically"| node_state
node_dashboard -->|"loads launcher"| node_server
node_server -->|"builds launcher"| node_launcher
node_launcher -->|"loads config"| node_config
node_launcher -->|"reads status"| node_state
node_dashboard -->|"renders panels"| node_panels
node_server -->|"routes files/docs"| node_files
node_server -->|"routes Git"| node_git
node_server -->|"serves briefs"| node_briefs
node_server -->|"routes chat"| node_chat
node_chat -->|"calls model"| node_provider
node_chat -->|"stores chat"| node_state
node_chat -->|"writes valid notes"| node_state
node_tools -->|"reads project files"| node_files
node_owner -->|"reviews proposal"| node_proposal_ui
node_proposal_ui -->|"submits decision"| node_server
node_server -->|"routes proposals"| node_proposals
node_proposals -->|"stores proposal"| node_state
node_proposals -->|"checks transitions"| node_schema
node_proposals -->|"uses Git tools"| node_tools
node_server -->|"routes decisions"| node_merge
node_launcher -->|"reads merges"| node_state
node_server -->|"loads config"| node_config

click node_app "https://github.com/evgenyps/tinybots/blob/main/apps/web/src/App.tsx"
click node_dashboard "https://github.com/evgenyps/tinybots/blob/main/apps/web/src/ui/v6-shell.tsx"
click node_setup_ui "https://github.com/evgenyps/tinybots/blob/main/apps/web/src/ui/setup-wizard.tsx"
click node_panels "https://github.com/evgenyps/tinybots/blob/main/apps/web/src/ui/files-panel.tsx"
click node_proposal_ui "https://github.com/evgenyps/tinybots/blob/main/apps/web/src/ui/proposal-modal.tsx"
click node_server "https://github.com/evgenyps/tinybots/blob/main/apps/server/src/server.ts"
click node_config "https://github.com/evgenyps/tinybots/blob/main/apps/server/src/config/load.ts"
click node_setup "https://github.com/evgenyps/tinybots/blob/main/apps/server/src/config/setup.ts"
click node_launcher "https://github.com/evgenyps/tinybots/blob/main/apps/server/src/launcher/view.ts"
click node_briefs "https://github.com/evgenyps/tinybots/tree/main/apps/server/src/briefs"
click node_chat "https://github.com/evgenyps/tinybots/tree/main/apps/server/src/llm"
click node_tools "https://github.com/evgenyps/tinybots/blob/main/apps/server/src/tools/sandbox.ts"
click node_files "https://github.com/evgenyps/tinybots/blob/main/apps/server/src/files/index.ts"
click node_git "https://github.com/evgenyps/tinybots/tree/main/apps/server/src/git"
click node_proposals "https://github.com/evgenyps/tinybots/blob/main/apps/server/src/proposals/engine.ts"
click node_merge "https://github.com/evgenyps/tinybots/tree/main/apps/server/src/merge"
click node_schema "https://github.com/evgenyps/tinybots/blob/main/packages/schema/src/common.ts"
click node_state "https://github.com/evgenyps/tinybots/blob/main/apps/server/src/store/read.ts"

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_app,node_dashboard,node_setup_ui,node_panels,node_proposal_ui toneBlue
class node_server,node_config,node_setup,node_launcher toneAmber
class node_briefs,node_chat,node_tools,node_files,node_git,node_proposals,node_merge toneMint
class node_schema,node_state toneRose
class node_owner,node_provider toneIndigo
```

## Components

### Owner interface

- [Page gate](https://github.com/evgenyps/tinybots/blob/main/apps/web/src/App.tsx): `apps/web/src/App.tsx`
- [Launcher UI](https://github.com/evgenyps/tinybots/blob/main/apps/web/src/ui/v6-shell.tsx): `apps/web/src/ui/v6-shell.tsx`
- [Setup wizard](https://github.com/evgenyps/tinybots/blob/main/apps/web/src/ui/setup-wizard.tsx): `apps/web/src/ui/setup-wizard.tsx`
- [Project panels](https://github.com/evgenyps/tinybots/blob/main/apps/web/src/ui/files-panel.tsx): `apps/web/src/ui/files-panel.tsx`
- [Proposal review](https://github.com/evgenyps/tinybots/blob/main/apps/web/src/ui/proposal-modal.tsx): `apps/web/src/ui/proposal-modal.tsx`

### Local control server

- [HTTP router](https://github.com/evgenyps/tinybots/blob/main/apps/server/src/server.ts): `apps/server/src/server.ts`
- [Config loading](https://github.com/evgenyps/tinybots/blob/main/apps/server/src/config/load.ts): `apps/server/src/config/load.ts`
- [Config setup](https://github.com/evgenyps/tinybots/blob/main/apps/server/src/config/setup.ts): `apps/server/src/config/setup.ts`
- [Launcher assembly](https://github.com/evgenyps/tinybots/blob/main/apps/server/src/launcher/view.ts): `apps/server/src/launcher/view.ts`

### Bot and project workflows

- [Brief workflow](https://github.com/evgenyps/tinybots/tree/main/apps/server/src/briefs): `apps/server/src/briefs`
- [Bot chat](https://github.com/evgenyps/tinybots/tree/main/apps/server/src/llm): `apps/server/src/llm`
- [Project tools](https://github.com/evgenyps/tinybots/blob/main/apps/server/src/tools/sandbox.ts): `apps/server/src/tools/sandbox.ts`
- [Files and docs](https://github.com/evgenyps/tinybots/blob/main/apps/server/src/files/index.ts): `apps/server/src/files/index.ts`
- [Git summary](https://github.com/evgenyps/tinybots/tree/main/apps/server/src/git): `apps/server/src/git`
- [Proposal engine](https://github.com/evgenyps/tinybots/blob/main/apps/server/src/proposals/engine.ts): `apps/server/src/proposals/engine.ts`
- [Merge decisions](https://github.com/evgenyps/tinybots/tree/main/apps/server/src/merge): `apps/server/src/merge`

### Contracts and state

- [Shared schemas](https://github.com/evgenyps/tinybots/blob/main/packages/schema/src/common.ts): `packages/schema/src/common.ts`
- [Local data files](https://github.com/evgenyps/tinybots/blob/main/apps/server/src/store/read.ts): `apps/server/src/store/read.ts`

### Other components

- **Local owner**
- **LLM provider**

## Connections

- Local owner → Page gate: opens panel (evidence: `apps/web/src/App.tsx`)
- Page gate → HTTP router: checks setup (evidence: `apps/web/src/App.tsx`)
- Page gate → Setup wizard: shows wizard (evidence: `apps/web/src/App.tsx`)
- Page gate → Launcher UI: shows dashboard (evidence: `apps/web/src/App.tsx`)
- Local owner → Setup wizard: configures bots (evidence: `README.md`)
- Setup wizard → HTTP router: writes config (evidence: `README.md`)
- HTTP router → Config setup: serves setup (evidence: `apps/server/src/server.ts`)
- Config setup → Shared schemas: validates config (evidence: `apps/server/src/config/setup.ts`)
- Config setup → Local data files: writes atomically (evidence: `apps/server/src/config/setup.ts`)
- Launcher UI → HTTP router: loads launcher (evidence: `apps/web/src/ui/v6-shell.tsx`)
- HTTP router → Launcher assembly: builds launcher (evidence: `apps/server/src/server.ts`)
- Launcher assembly → Config loading: loads config (evidence: `apps/server/src/launcher/view.ts`)
- Launcher assembly → Local data files: reads status (evidence: `apps/server/src/launcher/view.ts`)
- Launcher UI → Project panels: renders panels (evidence: `apps/web/src/ui/v6-shell.tsx`)
- HTTP router → Files and docs: routes files/docs (evidence: `apps/server/src/server.ts`)
- HTTP router → Git summary: routes Git (evidence: `apps/server/src/server.ts`)
- HTTP router → Brief workflow: serves briefs (evidence: `README.md`)
- HTTP router → Bot chat: routes chat (evidence: `apps/server/src/server.ts`)
- Bot chat → LLM provider: calls model (evidence: `README.md`)
- Bot chat → Local data files: stores chat (evidence: `README.md`)
- Bot chat → Local data files: writes valid notes (evidence: `README.md`)
- Project tools → Files and docs: reads project files (evidence: `README.md`)
- Local owner → Proposal review: reviews proposal (evidence: `README.md`)
- Proposal review → HTTP router: submits decision (evidence: `README.md`)
- HTTP router → Proposal engine: routes proposals (evidence: `apps/server/src/server.ts`)
- Proposal engine → Local data files: stores proposal (evidence: `apps/server/src/proposals/engine.ts`)
- Proposal engine → Shared schemas: checks transitions (evidence: `apps/server/src/proposals/engine.ts`)
- Proposal engine → Project tools: uses Git tools (evidence: `apps/server/src/proposals/engine.ts`)
- HTTP router → Merge decisions: routes decisions (evidence: `apps/server/src/server.ts`)
- Launcher assembly → Local data files: reads merges (evidence: `apps/server/src/launcher/view.ts`)
- HTTP router → Config loading: loads config (evidence: `README.md`)
