# revive101/aurorium architecture

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

- Interactive diagram: https://gitdiagram.com/revive101/aurorium
- Repository: https://github.com/revive101/aurorium

## Overview

Aurorium is a persistent asset-tracking and file-serving service. Its main workflow polls the patch server for revision metadata, retrieves and parses manifests, records changed assets, downloads them, and serves tracked revisions and files over HTTP. The README documents the parallel revision-checker and file-server tasks and the API capabilities; sampled source confirms their orchestration and several route and fetcher behaviors. Some route and database internals were not excerpted, so those relationships are cited to the README where documented.

Main entry points: [`src/main.rs`](https://github.com/revive101/aurorium/blob/main/src/main.rs) (Task orchestration), [`src/db.rs`](https://github.com/revive101/aurorium/blob/main/src/db.rs) (SQLite tracking), [`src/fetcher/manifest_fetcher.rs`](https://github.com/revive101/aurorium/blob/main/src/fetcher/manifest_fetcher.rs) (Manifest retrieval), [`src/fetcher/asset_fetcher.rs`](https://github.com/revive101/aurorium/blob/main/src/fetcher/asset_fetcher.rs) (Asset downloads)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_revision["Revision discovery"]
  node_wizard["Revision handshake<br/>[wizard_patcher.rs]"]
  node_manifest["Manifest retrieval"]
  node_xml["Manifest parsing<br/>[xml_parser.rs]"]
  node_asset_fetch["Asset downloads<br/>[asset_fetcher.rs]"]
  node_fetcher["Streamed file writes<br/>[fetcher.rs]"]
end

subgraph group_storage["Asset tracking"]
  node_revision_model["Revision and asset model<br/>[mod.rs]"]
  node_database[("SQLite tracking<br/>[db.rs]")]
end

subgraph group_serving["HTTP file service"]
  node_file_route["Asset file route<br/>[file.rs]"]
  node_latest_route["Latest revision route<br/>[latest.rs]"]
  node_revisions_route["Revision list route<br/>[revisions.rs]"]
end

subgraph group_runtime["Runtime foundation"]
  node_main["Task orchestration<br/>[main.rs]"]
  node_config["Runtime configuration<br/>[config.rs]"]
end

node_client(("HTTP clients"))
node_patch_server{{"Patch server"}}
node_service(("Aurorium service"))

node_main -->|"loads settings"| node_config
node_main -->|"initializes"| node_database
node_main -->|"checks revisions"| node_wizard
node_wizard -->|"handshakes with"| node_patch_server
node_main -->|"retrieves manifests"| node_manifest
node_manifest -.->|"downloads manifests"| node_patch_server
node_manifest -->|"parses XML with"| node_xml
node_xml -->|"produces assets"| node_revision_model
node_main -->|"records revision assets"| node_database
node_main -->|"starts downloads"| node_asset_fetch
node_asset_fetch -.->|"downloads assets"| node_patch_server
node_asset_fetch -->|"streams files with"| node_fetcher
node_main -->|"registers route"| node_file_route
node_main -->|"registers route"| node_latest_route
node_main -->|"registers route"| node_revisions_route
node_client -->|"requests files"| node_service
node_service -->|"routes file requests"| node_file_route
node_service -->|"routes latest requests"| node_latest_route
node_service -->|"routes revision requests"| node_revisions_route
node_file_route -->|"resolves file owner"| node_database
node_latest_route -->|"reads latest revision"| node_database
node_revisions_route -.->|"lists tracked revisions"| node_database

click node_main "https://github.com/revive101/aurorium/blob/main/src/main.rs"
click node_config "https://github.com/revive101/aurorium/blob/main/src/config.rs"
click node_wizard "https://github.com/revive101/aurorium/blob/main/src/wizard_patcher.rs"
click node_manifest "https://github.com/revive101/aurorium/blob/main/src/fetcher/manifest_fetcher.rs"
click node_xml "https://github.com/revive101/aurorium/blob/main/src/xml_parser.rs"
click node_asset_fetch "https://github.com/revive101/aurorium/blob/main/src/fetcher/asset_fetcher.rs"
click node_fetcher "https://github.com/revive101/aurorium/blob/main/src/fetcher/fetcher.rs"
click node_revision_model "https://github.com/revive101/aurorium/blob/main/src/revision/mod.rs"
click node_database "https://github.com/revive101/aurorium/blob/main/src/db.rs"
click node_file_route "https://github.com/revive101/aurorium/blob/main/src/routes/file.rs"
click node_latest_route "https://github.com/revive101/aurorium/blob/main/src/routes/latest.rs"
click node_revisions_route "https://github.com/revive101/aurorium/blob/main/src/routes/revisions.rs"

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_wizard,node_manifest,node_xml,node_asset_fetch,node_fetcher,node_client toneBlue
class node_revision_model,node_database toneAmber
class node_file_route,node_latest_route,node_revisions_route,node_patch_server toneMint
class node_main,node_config toneRose
class node_service toneIndigo
```

## Components

### Revision discovery

- [Revision handshake](https://github.com/revive101/aurorium/blob/main/src/wizard_patcher.rs): `src/wizard_patcher.rs`
- [Manifest retrieval](https://github.com/revive101/aurorium/blob/main/src/fetcher/manifest_fetcher.rs): `src/fetcher/manifest_fetcher.rs`
- [Manifest parsing](https://github.com/revive101/aurorium/blob/main/src/xml_parser.rs): `src/xml_parser.rs`
- [Asset downloads](https://github.com/revive101/aurorium/blob/main/src/fetcher/asset_fetcher.rs): `src/fetcher/asset_fetcher.rs`
- [Streamed file writes](https://github.com/revive101/aurorium/blob/main/src/fetcher/fetcher.rs): `src/fetcher/fetcher.rs`

### Asset tracking

- [Revision and asset model](https://github.com/revive101/aurorium/blob/main/src/revision/mod.rs): `src/revision/mod.rs`
- [SQLite tracking](https://github.com/revive101/aurorium/blob/main/src/db.rs): `src/db.rs`

### HTTP file service

- [Asset file route](https://github.com/revive101/aurorium/blob/main/src/routes/file.rs): `src/routes/file.rs`
- [Latest revision route](https://github.com/revive101/aurorium/blob/main/src/routes/latest.rs): `src/routes/latest.rs`
- [Revision list route](https://github.com/revive101/aurorium/blob/main/src/routes/revisions.rs): `src/routes/revisions.rs`

### Runtime foundation

- [Task orchestration](https://github.com/revive101/aurorium/blob/main/src/main.rs): `src/main.rs`
- [Runtime configuration](https://github.com/revive101/aurorium/blob/main/src/config.rs): `src/config.rs`

### Other components

- **HTTP clients**
- **Patch server**
- **Aurorium service**

## Connections

- Task orchestration → Runtime configuration: loads settings (evidence: `src/main.rs`)
- Task orchestration → SQLite tracking: initializes (evidence: `src/main.rs`)
- Task orchestration → Revision handshake: checks revisions (evidence: `src/main.rs`)
- Revision handshake → Patch server: handshakes with (evidence: `src/wizard_patcher.rs`)
- Task orchestration → Manifest retrieval: retrieves manifests (evidence: `src/main.rs`)
- Manifest retrieval → Patch server: downloads manifests (evidence: `README.md`)
- Manifest retrieval → Manifest parsing: parses XML with (evidence: `src/fetcher/manifest_fetcher.rs`)
- Manifest parsing → Revision and asset model: produces assets (evidence: `src/xml_parser.rs`)
- Task orchestration → SQLite tracking: records revision assets (evidence: `src/main.rs`)
- Task orchestration → Asset downloads: starts downloads (evidence: `src/main.rs`)
- Asset downloads → Patch server: downloads assets (evidence: `README.md`)
- Asset downloads → Streamed file writes: streams files with (evidence: `src/fetcher/asset_fetcher.rs`)
- Task orchestration → Asset file route: registers route (evidence: `src/main.rs`)
- Task orchestration → Latest revision route: registers route (evidence: `src/main.rs`)
- Task orchestration → Revision list route: registers route (evidence: `src/main.rs`)
- HTTP clients → Aurorium service: requests files (evidence: `README.md`)
- Aurorium service → Asset file route: routes file requests
- Aurorium service → Latest revision route: routes latest requests
- Aurorium service → Revision list route: routes revision requests
- Asset file route → SQLite tracking: resolves file owner (evidence: `src/routes/file.rs`)
- Latest revision route → SQLite tracking: reads latest revision (evidence: `src/routes/latest.rs`)
- Revision list route → SQLite tracking: lists tracked revisions (evidence: `README.md`)
