# mughesh03/team-simulation-platform architecture

> Architecture diagram of the GitHub repository mughesh03/team-simulation-platform, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mughesh03/team-simulation-platform
- Repository: https://github.com/mughesh03/team-simulation-platform

## Overview

Team Simulation Platform supports configurable AI-only batch studies and human-in-the-loop (HITL) team sessions, with researcher setup and result review. The main runtime entry is `app/main.py`: it routes study requests into batch orchestration or interactive sessions, which use the agent backend and persistence layer. The README documents builders, progress, dashboards, participant links, exports, and interdependence reference pages. The graph distinguishes those capabilities, but several route-to-template and dashboard details are documented rather than visible in the sampled source.

Main entry points: [`app/main.py`](https://github.com/mughesh03/team-simulation-platform/blob/main/app/main.py) (Web and API routes), [`app/storage.py`](https://github.com/mughesh03/team-simulation-platform/blob/main/app/storage.py) (JSONL and config storage), [`app/agents.py`](https://github.com/mughesh03/team-simulation-platform/blob/main/app/agents.py) (Agent backend), [`app/templates`](https://github.com/mughesh03/team-simulation-platform/tree/main/app/templates) (Study builders)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_study_design["Study design"]
  node_study_builders["Study builders"]
  node_builder_logic["Builder logic<br/>[app.js]"]
  node_task_library["Task library<br/>[task_library.html]"]
  node_participant_ui["Participant interface<br/>[participant.html]"]
end

subgraph group_simulation["Simulation runtime"]
  node_batch_orchestrator["Batch orchestration<br/>[main.py]"]
  node_team_rounds["Team structure rounds<br/>[main.py]"]
  node_agent_backend["Agent backend<br/>[agents.py]"]
  node_llm_service["Live model service"]
  node_hitl_session["HITL session runtime<br/>[main.py]"]
end

subgraph group_review["Review and reference"]
  node_researcher_dashboards["Researcher dashboards"]
  node_experiment_history["Experiment history<br/>[experiments.html]"]
  node_interdependence_viz["Interdependence diagrams<br/>[interdependence.js]"]
  node_result_exports["Result exports<br/>[storage.py]"]
end

subgraph group_platform["Platform services"]
  node_web_routes["Web and API routes<br/>[main.py]"]
  node_researcher_auth["Researcher auth<br/>[auth.py]"]
  node_persistence[("JSONL and config storage<br/>[storage.py]")]
end

node_researcher(("Researcher"))
node_participant(("Participant"))

node_researcher -->|"configures studies"| node_study_builders
node_study_builders -.->|"uses"| node_builder_logic
node_builder_logic -->|"submits studies"| node_web_routes
node_researcher -->|"browses tasks"| node_task_library
node_web_routes -->|"checks access"| node_researcher_auth
node_web_routes -->|"starts batches"| node_batch_orchestrator
node_batch_orchestrator -->|"runs simulations"| node_team_rounds
node_team_rounds -->|"requests turns"| node_agent_backend
node_agent_backend -.->|"calls live models"| node_llm_service
node_batch_orchestrator -->|"logs results"| node_persistence
node_web_routes -->|"creates sessions"| node_hitl_session
node_hitl_session -->|"requests turns"| node_agent_backend
node_hitl_session -->|"logs events"| node_persistence
node_participant -->|"joins session"| node_participant_ui
node_participant_ui -->|"intervenes"| node_hitl_session
node_researcher -->|"reviews results"| node_researcher_dashboards
node_researcher_dashboards -.->|"requests results"| node_web_routes
node_web_routes -.->|"reads records"| node_persistence
node_researcher -->|"views history"| node_experiment_history
node_persistence -->|"provides records"| node_result_exports
node_researcher -->|"downloads exports"| node_result_exports
node_researcher -->|"views diagrams"| node_interdependence_viz

click node_study_builders "https://github.com/mughesh03/team-simulation-platform/tree/main/app/templates"
click node_builder_logic "https://github.com/mughesh03/team-simulation-platform/blob/main/app/static/app.js"
click node_task_library "https://github.com/mughesh03/team-simulation-platform/blob/main/app/templates/task_library.html"
click node_web_routes "https://github.com/mughesh03/team-simulation-platform/blob/main/app/main.py"
click node_researcher_auth "https://github.com/mughesh03/team-simulation-platform/blob/main/app/auth.py"
click node_batch_orchestrator "https://github.com/mughesh03/team-simulation-platform/blob/main/app/main.py"
click node_team_rounds "https://github.com/mughesh03/team-simulation-platform/blob/main/app/main.py"
click node_agent_backend "https://github.com/mughesh03/team-simulation-platform/blob/main/app/agents.py"
click node_hitl_session "https://github.com/mughesh03/team-simulation-platform/blob/main/app/main.py"
click node_participant_ui "https://github.com/mughesh03/team-simulation-platform/blob/main/app/templates/participant.html"
click node_researcher_dashboards "https://github.com/mughesh03/team-simulation-platform/tree/main/app/templates"
click node_experiment_history "https://github.com/mughesh03/team-simulation-platform/blob/main/app/templates/experiments.html"
click node_interdependence_viz "https://github.com/mughesh03/team-simulation-platform/blob/main/app/static/interdependence.js"
click node_persistence "https://github.com/mughesh03/team-simulation-platform/blob/main/app/storage.py"
click node_result_exports "https://github.com/mughesh03/team-simulation-platform/blob/main/app/storage.py"

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_study_builders,node_builder_logic,node_task_library,node_participant_ui toneBlue
class node_batch_orchestrator,node_team_rounds,node_agent_backend,node_llm_service,node_hitl_session toneAmber
class node_researcher_dashboards,node_experiment_history,node_interdependence_viz,node_result_exports toneMint
class node_web_routes,node_researcher_auth,node_persistence toneRose
class node_researcher,node_participant toneIndigo
```

## Components

### Study design

- [Study builders](https://github.com/mughesh03/team-simulation-platform/tree/main/app/templates): `app/templates`
- [Builder logic](https://github.com/mughesh03/team-simulation-platform/blob/main/app/static/app.js): `app/static/app.js`
- [Task library](https://github.com/mughesh03/team-simulation-platform/blob/main/app/templates/task_library.html): `app/templates/task_library.html`
- [Participant interface](https://github.com/mughesh03/team-simulation-platform/blob/main/app/templates/participant.html): `app/templates/participant.html`

### Simulation runtime

- [Batch orchestration](https://github.com/mughesh03/team-simulation-platform/blob/main/app/main.py): `app/main.py`
- [Team structure rounds](https://github.com/mughesh03/team-simulation-platform/blob/main/app/main.py): `app/main.py`
- [Agent backend](https://github.com/mughesh03/team-simulation-platform/blob/main/app/agents.py): `app/agents.py`
- **Live model service**
- [HITL session runtime](https://github.com/mughesh03/team-simulation-platform/blob/main/app/main.py): `app/main.py`

### Review and reference

- [Researcher dashboards](https://github.com/mughesh03/team-simulation-platform/tree/main/app/templates): `app/templates`
- [Experiment history](https://github.com/mughesh03/team-simulation-platform/blob/main/app/templates/experiments.html): `app/templates/experiments.html`
- [Interdependence diagrams](https://github.com/mughesh03/team-simulation-platform/blob/main/app/static/interdependence.js): `app/static/interdependence.js`
- [Result exports](https://github.com/mughesh03/team-simulation-platform/blob/main/app/storage.py): `app/storage.py`

### Platform services

- [Web and API routes](https://github.com/mughesh03/team-simulation-platform/blob/main/app/main.py): `app/main.py`
- [Researcher auth](https://github.com/mughesh03/team-simulation-platform/blob/main/app/auth.py): `app/auth.py`
- [JSONL and config storage](https://github.com/mughesh03/team-simulation-platform/blob/main/app/storage.py): `app/storage.py`

### Other components

- **Researcher**
- **Participant**

## Connections

- Researcher → Study builders: configures studies (evidence: `README.md`)
- Study builders → Builder logic: uses
- Builder logic → Web and API routes: submits studies (evidence: `app/static/app.js`)
- Researcher → Task library: browses tasks (evidence: `README.md`)
- Web and API routes → Researcher auth: checks access (evidence: `app/main.py`)
- Web and API routes → Batch orchestration: starts batches (evidence: `app/main.py`)
- Batch orchestration → Team structure rounds: runs simulations (evidence: `app/main.py`)
- Team structure rounds → Agent backend: requests turns (evidence: `app/main.py`)
- Agent backend → Live model service: calls live models
- Batch orchestration → JSONL and config storage: logs results (evidence: `app/main.py`)
- Web and API routes → HITL session runtime: creates sessions (evidence: `app/main.py`)
- HITL session runtime → Agent backend: requests turns (evidence: `README.md`)
- HITL session runtime → JSONL and config storage: logs events (evidence: `README.md`)
- Participant → Participant interface: joins session (evidence: `README.md`)
- Participant interface → HITL session runtime: intervenes (evidence: `README.md`)
- Researcher → Researcher dashboards: reviews results (evidence: `README.md`)
- Researcher dashboards → Web and API routes: requests results
- Web and API routes → JSONL and config storage: reads records (evidence: `app/main.py`)
- Researcher → Experiment history: views history (evidence: `README.md`)
- JSONL and config storage → Result exports: provides records (evidence: `app/storage.py`)
- Researcher → Result exports: downloads exports (evidence: `README.md`)
- Researcher → Interdependence diagrams: views diagrams (evidence: `README.md`)
