# oterator/bodex architecture

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

- Interactive diagram: https://gitdiagram.com/oterator/bodex
- Repository: https://github.com/oterator/bodex

## Overview

BodeX is a single-user desktop grading app. The grader creates or resumes a project, configures students and questions, grades the student-by-question grid, and saves or exports results. The graph also preserves roster management, question images, statistics, settings, and recovery. Some UI and persistence wiring is documented rather than visible in the excerpts; those links use README evidence, and uncertain links are omitted.

Main entry points: [`src/app/App.cpp`](https://github.com/oterator/bodex/blob/main/src/app/App.cpp) (App coordinator), [`src/ui/GradingTable.cpp`](https://github.com/oterator/bodex/blob/main/src/ui/GradingTable.cpp) (Grading grid), [`src/ui/ExportDialog.cpp`](https://github.com/oterator/bodex/blob/main/src/ui/ExportDialog.cpp) (Export dialog), [`src/model/Project.h`](https://github.com/oterator/bodex/blob/main/src/model/Project.h) (Project model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop application"]
  node_host["Windows UI host<br/>[main.cpp]"]
  node_app["App coordinator<br/>[App.cpp]"]
  node_home["Launch screen<br/>[HomeScreen.cpp]"]
  node_settings["App settings<br/>[SettingsScreen.cpp]"]
end

subgraph group_grading["Project and grading"]
  node_newproject["New project setup"]
  node_projectsettings["Project structure"]
  node_grid["Grading grid<br/>[GradingTable.cpp]"]
  node_celleditor["Cell editor<br/>[CellEditor.cpp]"]
  node_scoring["Scoring and stats<br/>[Scoring.cpp]"]
  node_questionimages["Question images<br/>[QuestionImages.cpp]"]
  node_imagestore["Image texture store<br/>[ImageStore.cpp]"]
  node_project["Project model<br/>[Project.h]"]
end

subgraph group_records["Persistence and rosters"]
  node_students["Student roster UI"]
  node_roster["Roster parsing<br/>[Roster.h]"]
  node_serialization["JSON project I/O<br/>[Serialization.cpp]"]
  node_config["App configuration<br/>[AppConfig.cpp]"]
  node_assets["Project image assets<br/>[Assets.cpp]"]
end

subgraph group_export["Spreadsheet export"]
  node_exportdialog["Export dialog<br/>[ExportDialog.cpp]"]
  node_export["Grade matching and export<br/>[Export.cpp]"]
  node_xlsx["Workbook reader<br/>[Xlsx.cpp]"]
  node_profiles["Export profiles<br/>[ExportProfile.cpp]"]
end

subgraph group_shared["Shared model and UI"]
  node_widgets["Shared UI widgets<br/>[widgets.cpp]"]
  node_bidi["Bidirectional text<br/>[Bidi.cpp]"]
end

node_grader(("Grader"))
node_workbook["Excel workbook"]
node_jsonfiles["Project JSON files"]

node_grader -->|"uses"| node_host
node_host -->|"renders"| node_app
node_app -.->|"shows"| node_home
node_app -.->|"opens"| node_newproject
node_app -.->|"renders"| node_grid
node_grader -->|"configures"| node_newproject
node_newproject -->|"creates"| node_project
node_grader -->|"grades"| node_grid
node_grid -->|"opens"| node_celleditor
node_celleditor -->|"uses"| node_scoring
node_grid -->|"computes stats"| node_scoring
node_grid -->|"edits"| node_project
node_grader -->|"attaches images"| node_questionimages
node_questionimages -->|"loads images"| node_imagestore
node_questionimages -->|"manages assets"| node_assets
node_grader -->|"reshapes project"| node_projectsettings
node_projectsettings -->|"updates structure"| node_project
node_grader -->|"changes preferences"| node_settings
node_settings -->|"opens section"| node_students
node_students -->|"parses lists"| node_roster
node_students -->|"saves roster"| node_config
node_app -->|"saves and loads"| node_serialization
node_serialization -->|"reads and writes"| node_jsonfiles
node_app -->|"tracks recovery"| node_config
node_grader -->|"exports grades"| node_exportdialog
node_exportdialog -->|"requests matching"| node_export
node_exportdialog -->|"reads workbook"| node_xlsx
node_xlsx -->|"reads bytes"| node_workbook
node_exportdialog -->|"loads profiles"| node_profiles
node_export -->|"matches students"| node_project
node_grid -->|"uses helpers"| node_widgets
node_widgets -->|"formats text"| node_bidi

click node_host "https://github.com/oterator/bodex/blob/main/src/main.cpp"
click node_app "https://github.com/oterator/bodex/blob/main/src/app/App.cpp"
click node_home "https://github.com/oterator/bodex/blob/main/src/ui/HomeScreen.cpp"
click node_newproject "https://github.com/oterator/bodex/blob/main/src/ui/NewProjectScreen.cpp"
click node_projectsettings "https://github.com/oterator/bodex/blob/main/src/ui/ProjectSettingsScreen.cpp"
click node_grid "https://github.com/oterator/bodex/blob/main/src/ui/GradingTable.cpp"
click node_celleditor "https://github.com/oterator/bodex/blob/main/src/ui/CellEditor.cpp"
click node_scoring "https://github.com/oterator/bodex/blob/main/src/model/Scoring.cpp"
click node_questionimages "https://github.com/oterator/bodex/blob/main/src/ui/QuestionImages.cpp"
click node_imagestore "https://github.com/oterator/bodex/blob/main/src/ui/ImageStore.cpp"
click node_settings "https://github.com/oterator/bodex/blob/main/src/ui/SettingsScreen.cpp"
click node_students "https://github.com/oterator/bodex/blob/main/src/ui/StudentsSection.cpp"
click node_roster "https://github.com/oterator/bodex/blob/main/src/model/Roster.h"
click node_project "https://github.com/oterator/bodex/blob/main/src/model/Project.h"
click node_serialization "https://github.com/oterator/bodex/blob/main/src/model/Serialization.cpp"
click node_config "https://github.com/oterator/bodex/blob/main/src/model/AppConfig.cpp"
click node_assets "https://github.com/oterator/bodex/blob/main/src/model/Assets.cpp"
click node_exportdialog "https://github.com/oterator/bodex/blob/main/src/ui/ExportDialog.cpp"
click node_export "https://github.com/oterator/bodex/blob/main/src/model/Export.cpp"
click node_xlsx "https://github.com/oterator/bodex/blob/main/src/model/Xlsx.cpp"
click node_profiles "https://github.com/oterator/bodex/blob/main/src/model/ExportProfile.cpp"
click node_widgets "https://github.com/oterator/bodex/blob/main/src/ui/widgets.cpp"
click node_bidi "https://github.com/oterator/bodex/blob/main/src/model/Bidi.cpp"

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_host,node_app,node_home,node_settings toneBlue
class node_newproject,node_projectsettings,node_grid,node_celleditor,node_scoring,node_questionimages,node_imagestore,node_project toneAmber
class node_students,node_roster,node_serialization,node_config,node_assets toneMint
class node_exportdialog,node_export,node_xlsx,node_profiles toneRose
class node_widgets,node_bidi,node_grader,node_workbook,node_jsonfiles toneIndigo
```

## Components

### Desktop application

- [Windows UI host](https://github.com/oterator/bodex/blob/main/src/main.cpp): `src/main.cpp`
- [App coordinator](https://github.com/oterator/bodex/blob/main/src/app/App.cpp): `src/app/App.cpp`
- [Launch screen](https://github.com/oterator/bodex/blob/main/src/ui/HomeScreen.cpp): `src/ui/HomeScreen.cpp`
- [App settings](https://github.com/oterator/bodex/blob/main/src/ui/SettingsScreen.cpp): `src/ui/SettingsScreen.cpp`

### Project and grading

- [New project setup](https://github.com/oterator/bodex/blob/main/src/ui/NewProjectScreen.cpp): `src/ui/NewProjectScreen.cpp`
- [Project structure](https://github.com/oterator/bodex/blob/main/src/ui/ProjectSettingsScreen.cpp): `src/ui/ProjectSettingsScreen.cpp`
- [Grading grid](https://github.com/oterator/bodex/blob/main/src/ui/GradingTable.cpp): `src/ui/GradingTable.cpp`
- [Cell editor](https://github.com/oterator/bodex/blob/main/src/ui/CellEditor.cpp): `src/ui/CellEditor.cpp`
- [Scoring and stats](https://github.com/oterator/bodex/blob/main/src/model/Scoring.cpp): `src/model/Scoring.cpp`
- [Question images](https://github.com/oterator/bodex/blob/main/src/ui/QuestionImages.cpp): `src/ui/QuestionImages.cpp`
- [Image texture store](https://github.com/oterator/bodex/blob/main/src/ui/ImageStore.cpp): `src/ui/ImageStore.cpp`
- [Project model](https://github.com/oterator/bodex/blob/main/src/model/Project.h): `src/model/Project.h`

### Persistence and rosters

- [Student roster UI](https://github.com/oterator/bodex/blob/main/src/ui/StudentsSection.cpp): `src/ui/StudentsSection.cpp`
- [Roster parsing](https://github.com/oterator/bodex/blob/main/src/model/Roster.h): `src/model/Roster.h`
- [JSON project I/O](https://github.com/oterator/bodex/blob/main/src/model/Serialization.cpp): `src/model/Serialization.cpp`
- [App configuration](https://github.com/oterator/bodex/blob/main/src/model/AppConfig.cpp): `src/model/AppConfig.cpp`
- [Project image assets](https://github.com/oterator/bodex/blob/main/src/model/Assets.cpp): `src/model/Assets.cpp`

### Spreadsheet export

- [Export dialog](https://github.com/oterator/bodex/blob/main/src/ui/ExportDialog.cpp): `src/ui/ExportDialog.cpp`
- [Grade matching and export](https://github.com/oterator/bodex/blob/main/src/model/Export.cpp): `src/model/Export.cpp`
- [Workbook reader](https://github.com/oterator/bodex/blob/main/src/model/Xlsx.cpp): `src/model/Xlsx.cpp`
- [Export profiles](https://github.com/oterator/bodex/blob/main/src/model/ExportProfile.cpp): `src/model/ExportProfile.cpp`

### Shared model and UI

- [Shared UI widgets](https://github.com/oterator/bodex/blob/main/src/ui/widgets.cpp): `src/ui/widgets.cpp`
- [Bidirectional text](https://github.com/oterator/bodex/blob/main/src/model/Bidi.cpp): `src/model/Bidi.cpp`

### Other components

- **Grader**
- **Excel workbook**
- **Project JSON files**

## Connections

- Grader → Windows UI host: uses (evidence: `README.md`)
- Windows UI host → App coordinator: renders (evidence: `src/main.cpp`)
- App coordinator → Launch screen: shows
- App coordinator → New project setup: opens
- App coordinator → Grading grid: renders
- Grader → New project setup: configures (evidence: `README.md`)
- New project setup → Project model: creates (evidence: `README.md`)
- Grader → Grading grid: grades (evidence: `README.md`)
- Grading grid → Cell editor: opens (evidence: `src/ui/GradingTable.cpp`)
- Cell editor → Scoring and stats: uses (evidence: `src/ui/CellEditor.cpp`)
- Grading grid → Scoring and stats: computes stats (evidence: `src/ui/GradingTable.cpp`)
- Grading grid → Project model: edits (evidence: `src/ui/GradingTable.cpp`)
- Grader → Question images: attaches images (evidence: `README.md`)
- Question images → Image texture store: loads images (evidence: `src/ui/QuestionImages.cpp`)
- Question images → Project image assets: manages assets (evidence: `src/ui/QuestionImages.cpp`)
- Grader → Project structure: reshapes project (evidence: `README.md`)
- Project structure → Project model: updates structure (evidence: `src/ui/ProjectSettingsScreen.cpp`)
- Grader → App settings: changes preferences (evidence: `README.md`)
- App settings → Student roster UI: opens section (evidence: `src/ui/SettingsScreen.cpp`)
- Student roster UI → Roster parsing: parses lists (evidence: `src/ui/StudentsSection.cpp`)
- Student roster UI → App configuration: saves roster (evidence: `src/ui/StudentsSection.cpp`)
- App coordinator → JSON project I/O: saves and loads (evidence: `README.md`)
- JSON project I/O → Project JSON files: reads and writes
- App coordinator → App configuration: tracks recovery (evidence: `README.md`)
- Grader → Export dialog: exports grades (evidence: `README.md`)
- Export dialog → Grade matching and export: requests matching (evidence: `src/ui/ExportDialog.cpp`)
- Export dialog → Workbook reader: reads workbook (evidence: `src/ui/ExportDialog.cpp`)
- Workbook reader → Excel workbook: reads bytes
- Export dialog → Export profiles: loads profiles (evidence: `src/ui/ExportDialog.cpp`)
- Grade matching and export → Project model: matches students (evidence: `src/model/Export.cpp`)
- Grading grid → Shared UI widgets: uses helpers (evidence: `src/ui/GradingTable.cpp`)
- Shared UI widgets → Bidirectional text: formats text (evidence: `src/ui/widgets.cpp`)
