# dmholy/spectre architecture

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

- Interactive diagram: https://gitdiagram.com/dmholy/spectre
- Repository: https://github.com/dmholy/spectre

## Overview

Spectre is a web application for managing a team’s process experiments, from defining a simulated structure through tracking wafers and recording measurements to a conclusion. Users work within permissioned microprojects, which sit in a corporate-project and thematic hierarchy. The application assembles plugin-provided pages and APIs; experiment history and versioning are delegated to Follow, structure simulation to StructureForge, and characterization data to PRISM. The README documents the major workflow and capabilities; source excerpts are partial, so unsampled subsystem connections are included only where documented.

Main entry points: [`spectre/plugins/experiments/service.py`](https://github.com/dmholy/spectre/blob/main/spectre/plugins/experiments/service.py) (Experiments), [`spectre/plugins/microprojects/service.py`](https://github.com/dmholy/spectre/blob/main/spectre/plugins/microprojects/service.py) (Microprojects), [`spectre/kernel/app.py`](https://github.com/dmholy/spectre/blob/main/spectre/kernel/app.py) (Web app), [`spectre/plugins/notebook/service.py`](https://github.com/dmholy/spectre/blob/main/spectre/plugins/notebook/service.py) (Data notebook)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_platform["Web platform"]
  node_web["Web app<br/>[app.py]"]
  node_accounts["Accounts<br/>[service.py]"]
end

subgraph group_governance["Teams and strategy"]
  node_teams["Teams<br/>[service.py]"]
  node_strategy["Corporate strategy<br/>[service.py]"]
  node_microprojects["Microprojects<br/>[service.py]"]
end

subgraph group_experiment["Experiment lifecycle"]
  node_experiments["Experiments<br/>[service.py]"]
  node_history[("Version history<br/>[repository.py]")]
  node_references[("Structure references<br/>[service.py]")]
  node_wafers["Tracked wafers<br/>[service.py]"]
  node_conclusion["Experiment conclusion<br/>[service.py]"]
end

subgraph group_process["Structures and libraries"]
  node_structures["Structure builder<br/>[kinds.py]"]
  node_simulation["Process simulation<br/>[simulation.py]"]
  node_process_library[("Process library<br/>[service.py]")]
end

subgraph group_data["Measurements and insights"]
  node_notebook["Data notebook<br/>[service.py]"]
  node_characterization["Characterization data<br/>[service.py]"]
  node_kpis["KPIs and insights<br/>[service.py]"]
  node_attachments[("Attachments<br/>[store.py]")]
end

node_user(("Team member"))
node_structureforge{{"StructureForge"}}
node_follow{{"Follow"}}
node_prism{{"PRISM"}}

node_user -->|"uses"| node_web
node_web -->|"serves pages"| node_accounts
node_web -->|"serves pages"| node_microprojects
node_microprojects -->|"checks membership"| node_teams
node_microprojects -->|"attaches to"| node_strategy
node_user -->|"steers objectives"| node_strategy
node_microprojects -->|"contains studies"| node_experiments
node_experiments -->|"reads and writes"| node_history
node_history -->|"stores versions"| node_follow
node_experiments -->|"uses structure data"| node_structures
node_structures -->|"simulates process"| node_simulation
node_simulation -->|"delegates simulation"| node_structureforge
node_experiments -->|"tracks entities"| node_wafers
node_experiments -->|"publishes versions"| node_references
node_user -->|"reuses process models"| node_process_library
node_experiments -->|"records measurements"| node_notebook
node_notebook -->|"views data types"| node_characterization
node_characterization -->|"queries data"| node_prism
node_notebook -->|"links files"| node_attachments
node_experiments -->|"records conclusion"| node_conclusion
node_experiments -->|"supports insights"| node_kpis

click node_web "https://github.com/dmholy/spectre/blob/main/spectre/kernel/app.py"
click node_accounts "https://github.com/dmholy/spectre/blob/main/spectre/plugins/accounts/service.py"
click node_teams "https://github.com/dmholy/spectre/blob/main/spectre/plugins/teams/service.py"
click node_strategy "https://github.com/dmholy/spectre/blob/main/spectre/plugins/areas/service.py"
click node_microprojects "https://github.com/dmholy/spectre/blob/main/spectre/plugins/microprojects/service.py"
click node_experiments "https://github.com/dmholy/spectre/blob/main/spectre/plugins/experiments/service.py"
click node_history "https://github.com/dmholy/spectre/blob/main/spectre/plugins/experiments/repository.py"
click node_references "https://github.com/dmholy/spectre/blob/main/spectre/plugins/references/service.py"
click node_wafers "https://github.com/dmholy/spectre/blob/main/spectre/plugins/wafers/service.py"
click node_structures "https://github.com/dmholy/spectre/blob/main/spectre/plugins/structures/kinds.py"
click node_simulation "https://github.com/dmholy/spectre/blob/main/spectre/plugins/structures/simulation.py"
click node_process_library "https://github.com/dmholy/spectre/blob/main/spectre/plugins/process_library/service.py"
click node_notebook "https://github.com/dmholy/spectre/blob/main/spectre/plugins/notebook/service.py"
click node_characterization "https://github.com/dmholy/spectre/blob/main/spectre/plugins/characterization/service.py"
click node_kpis "https://github.com/dmholy/spectre/blob/main/spectre/plugins/kpis/service.py"
click node_attachments "https://github.com/dmholy/spectre/blob/main/spectre/plugins/attachments/store.py"
click node_conclusion "https://github.com/dmholy/spectre/blob/main/spectre/plugins/experiments/service.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_web,node_accounts toneBlue
class node_teams,node_strategy,node_microprojects toneAmber
class node_experiments,node_history,node_references,node_wafers,node_conclusion toneMint
class node_structures,node_simulation,node_process_library toneRose
class node_notebook,node_characterization,node_kpis,node_attachments,node_user,node_structureforge,node_follow,node_prism toneIndigo
```

## Components

### Web platform

- [Web app](https://github.com/dmholy/spectre/blob/main/spectre/kernel/app.py): `spectre/kernel/app.py`
- [Accounts](https://github.com/dmholy/spectre/blob/main/spectre/plugins/accounts/service.py): `spectre/plugins/accounts/service.py`

### Teams and strategy

- [Teams](https://github.com/dmholy/spectre/blob/main/spectre/plugins/teams/service.py): `spectre/plugins/teams/service.py`
- [Corporate strategy](https://github.com/dmholy/spectre/blob/main/spectre/plugins/areas/service.py): `spectre/plugins/areas/service.py`
- [Microprojects](https://github.com/dmholy/spectre/blob/main/spectre/plugins/microprojects/service.py): `spectre/plugins/microprojects/service.py`

### Experiment lifecycle

- [Experiments](https://github.com/dmholy/spectre/blob/main/spectre/plugins/experiments/service.py): `spectre/plugins/experiments/service.py`
- [Version history](https://github.com/dmholy/spectre/blob/main/spectre/plugins/experiments/repository.py): `spectre/plugins/experiments/repository.py`
- [Structure references](https://github.com/dmholy/spectre/blob/main/spectre/plugins/references/service.py): `spectre/plugins/references/service.py`
- [Tracked wafers](https://github.com/dmholy/spectre/blob/main/spectre/plugins/wafers/service.py): `spectre/plugins/wafers/service.py`
- [Experiment conclusion](https://github.com/dmholy/spectre/blob/main/spectre/plugins/experiments/service.py): `spectre/plugins/experiments/service.py`

### Structures and libraries

- [Structure builder](https://github.com/dmholy/spectre/blob/main/spectre/plugins/structures/kinds.py): `spectre/plugins/structures/kinds.py`
- [Process simulation](https://github.com/dmholy/spectre/blob/main/spectre/plugins/structures/simulation.py): `spectre/plugins/structures/simulation.py`
- [Process library](https://github.com/dmholy/spectre/blob/main/spectre/plugins/process_library/service.py): `spectre/plugins/process_library/service.py`

### Measurements and insights

- [Data notebook](https://github.com/dmholy/spectre/blob/main/spectre/plugins/notebook/service.py): `spectre/plugins/notebook/service.py`
- [Characterization data](https://github.com/dmholy/spectre/blob/main/spectre/plugins/characterization/service.py): `spectre/plugins/characterization/service.py`
- [KPIs and insights](https://github.com/dmholy/spectre/blob/main/spectre/plugins/kpis/service.py): `spectre/plugins/kpis/service.py`
- [Attachments](https://github.com/dmholy/spectre/blob/main/spectre/plugins/attachments/store.py): `spectre/plugins/attachments/store.py`

### Other components

- **Team member**
- **StructureForge**
- **Follow**
- **PRISM**

## Connections

- Team member → Web app: uses (evidence: `README.md`)
- Web app → Accounts: serves pages (evidence: `spectre/kernel/app.py`)
- Web app → Microprojects: serves pages
- Microprojects → Teams: checks membership (evidence: `spectre/plugins/microprojects/service.py`)
- Microprojects → Corporate strategy: attaches to (evidence: `README.md`)
- Team member → Corporate strategy: steers objectives (evidence: `README.md`)
- Microprojects → Experiments: contains studies (evidence: `README.md`)
- Experiments → Version history: reads and writes (evidence: `spectre/plugins/experiments/service.py`)
- Version history → Follow: stores versions (evidence: `spectre/plugins/experiments/repository.py`)
- Experiments → Structure builder: uses structure data (evidence: `spectre/plugins/experiments/service.py`)
- Structure builder → Process simulation: simulates process (evidence: `spectre/plugins/structures/kinds.py`)
- Process simulation → StructureForge: delegates simulation (evidence: `spectre/plugins/structures/simulation.py`)
- Experiments → Tracked wafers: tracks entities (evidence: `README.md`)
- Experiments → Structure references: publishes versions (evidence: `spectre/plugins/references/service.py`)
- Team member → Process library: reuses process models (evidence: `README.md`)
- Experiments → Data notebook: records measurements (evidence: `spectre/plugins/notebook/service.py`)
- Data notebook → Characterization data: views data types (evidence: `spectre/plugins/notebook/service.py`)
- Characterization data → PRISM: queries data (evidence: `README.md`)
- Data notebook → Attachments: links files (evidence: `spectre/plugins/notebook/service.py`)
- Experiments → Experiment conclusion: records conclusion (evidence: `README.md`)
- Experiments → KPIs and insights: supports insights
