# wogud98/aleph architecture

> Architecture diagram of the GitHub repository wogud98/aleph, 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/wogud98/aleph
- Repository: https://github.com/wogud98/aleph

## Overview

ALEPH is a collection of challenge applications rather than one unified runtime. Two substantial products are visible in the supplied sources: T04 collects and replays daily USD/KRW readings, and T06 is a plan–do–review diary. T06’s browser UI calls an HTTP API that dispatches to service operations backed by PostgreSQL; startup also migrates and optionally seeds the database. Other challenge pages are present in the tree, but their behavior is not established by the supplied excerpts, so they are omitted. Relationships are limited to excerpted or documented evidence.

Main entry points: [`challenge/T06/src/app.js`](https://github.com/wogud98/aleph/blob/main/challenge/T06/src/app.js) (HTTP handler), [`challenge/T06/src/db.js`](https://github.com/wogud98/aleph/blob/main/challenge/T06/src/db.js) (Database access), [`challenge/T06/src/service.js`](https://github.com/wogud98/aleph/blob/main/challenge/T06/src/service.js) (Plan management), [`challenge/T04/collector/collect.js`](https://github.com/wogud98/aleph/blob/main/challenge/T04/collector/collect.js) (Live collector)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_t04["T04 Exchange Tracker"]
  node_collector["Live collector<br/>[collect.js]"]
  node_normalize["Normalize and replay<br/>[lib.js]"]
  node_t04data[("Collector data files")]
  node_t04screen["Public replay screen<br/>[index.html]"]
end

subgraph group_t06web["T06 Diary Interface"]
  node_ui["Diary UI<br/>[app.js]"]
  node_http["HTTP handler<br/>[app.js]"]
end

subgraph group_t06domain["T06 Diary Workflow"]
  node_plans["Plan management<br/>[service.js]"]
  node_tasks["Task tracking<br/>[service.js]"]
  node_worklogs["Work logs<br/>[service.js]"]
  node_review["Review and evidence<br/>[service.js]"]
  node_retros["Retrospectives<br/>[service.js]"]
  node_export["Data export<br/>[service.js]"]
end

subgraph group_t06infra["T06 Runtime and Storage"]
  node_server["Server startup<br/>[server.js]"]
  node_validation["Input validation<br/>[validate.js]"]
  node_seed["Initial seed<br/>[seed.js]"]
  node_dbaccess["Database access<br/>[db.js]"]
  node_postgres[("PostgreSQL<br/>[schema.sql]")]
end

node_reader(("Diary user"))
node_rateapi{{"Exchange-rate API"}}
node_browser(("Browser"))

node_collector -->|"uses shared logic"| node_normalize
node_collector -->|"fetches readings"| node_rateapi
node_collector -->|"writes status and records"| node_t04data
node_t04screen -->|"replays fixtures"| node_normalize
node_browser -.->|"opens replay"| node_t04screen
node_reader -.->|"uses diary"| node_ui
node_ui -->|"sends API requests"| node_http
node_server -->|"creates handler"| node_http
node_http -->|"dispatches plan routes"| node_plans
node_http -->|"dispatches task routes"| node_tasks
node_http -->|"dispatches log routes"| node_worklogs
node_http -->|"dispatches review routes"| node_review
node_http -->|"dispatches retrospective routes"| node_retros
node_http -->|"dispatches export"| node_export
node_plans -->|"validates input"| node_validation
node_tasks -->|"validates input"| node_validation
node_worklogs -->|"validates input"| node_validation
node_retros -->|"captures review snapshot"| node_review
node_server -->|"creates pool and migrates"| node_dbaccess
node_server -->|"runs optional seeding"| node_seed
node_seed -->|"uses service functions"| node_plans
node_plans -->|"queries database"| node_dbaccess
node_tasks -->|"queries database"| node_dbaccess
node_worklogs -->|"queries database"| node_dbaccess
node_review -->|"queries database"| node_dbaccess
node_retros -->|"queries database"| node_dbaccess
node_export -->|"reads records"| node_dbaccess
node_dbaccess -->|"runs SQL"| node_postgres

click node_collector "https://github.com/wogud98/aleph/blob/main/challenge/T04/collector/collect.js"
click node_normalize "https://github.com/wogud98/aleph/blob/main/challenge/T04/collector/lib.js"
click node_t04data "https://github.com/wogud98/aleph/tree/main/challenge/T04/data"
click node_t04screen "https://github.com/wogud98/aleph/blob/main/challenge/T04/index.html"
click node_ui "https://github.com/wogud98/aleph/blob/main/challenge/T06/public/app.js"
click node_http "https://github.com/wogud98/aleph/blob/main/challenge/T06/src/app.js"
click node_server "https://github.com/wogud98/aleph/blob/main/challenge/T06/server.js"
click node_plans "https://github.com/wogud98/aleph/blob/main/challenge/T06/src/service.js"
click node_tasks "https://github.com/wogud98/aleph/blob/main/challenge/T06/src/service.js"
click node_worklogs "https://github.com/wogud98/aleph/blob/main/challenge/T06/src/service.js"
click node_review "https://github.com/wogud98/aleph/blob/main/challenge/T06/src/service.js"
click node_retros "https://github.com/wogud98/aleph/blob/main/challenge/T06/src/service.js"
click node_export "https://github.com/wogud98/aleph/blob/main/challenge/T06/src/service.js"
click node_validation "https://github.com/wogud98/aleph/blob/main/challenge/T06/src/validate.js"
click node_seed "https://github.com/wogud98/aleph/blob/main/challenge/T06/src/seed.js"
click node_dbaccess "https://github.com/wogud98/aleph/blob/main/challenge/T06/src/db.js"
click node_postgres "https://github.com/wogud98/aleph/blob/main/challenge/T06/db/schema.sql"

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_collector,node_normalize,node_t04data,node_t04screen,node_reader,node_browser toneBlue
class node_ui,node_http toneAmber
class node_plans,node_tasks,node_worklogs,node_review,node_retros,node_export,node_rateapi toneMint
class node_server,node_validation,node_seed,node_dbaccess,node_postgres toneRose
```

## Components

### T04 Exchange Tracker

- [Live collector](https://github.com/wogud98/aleph/blob/main/challenge/T04/collector/collect.js): `challenge/T04/collector/collect.js`
- [Normalize and replay](https://github.com/wogud98/aleph/blob/main/challenge/T04/collector/lib.js): `challenge/T04/collector/lib.js`
- [Collector data files](https://github.com/wogud98/aleph/tree/main/challenge/T04/data): `challenge/T04/data`
- [Public replay screen](https://github.com/wogud98/aleph/blob/main/challenge/T04/index.html): `challenge/T04/index.html`

### T06 Diary Interface

- [Diary UI](https://github.com/wogud98/aleph/blob/main/challenge/T06/public/app.js): `challenge/T06/public/app.js`
- [HTTP handler](https://github.com/wogud98/aleph/blob/main/challenge/T06/src/app.js): `challenge/T06/src/app.js`

### T06 Diary Workflow

- [Plan management](https://github.com/wogud98/aleph/blob/main/challenge/T06/src/service.js): `challenge/T06/src/service.js`
- [Task tracking](https://github.com/wogud98/aleph/blob/main/challenge/T06/src/service.js): `challenge/T06/src/service.js`
- [Work logs](https://github.com/wogud98/aleph/blob/main/challenge/T06/src/service.js): `challenge/T06/src/service.js`
- [Review and evidence](https://github.com/wogud98/aleph/blob/main/challenge/T06/src/service.js): `challenge/T06/src/service.js`
- [Retrospectives](https://github.com/wogud98/aleph/blob/main/challenge/T06/src/service.js): `challenge/T06/src/service.js`
- [Data export](https://github.com/wogud98/aleph/blob/main/challenge/T06/src/service.js): `challenge/T06/src/service.js`

### T06 Runtime and Storage

- [Server startup](https://github.com/wogud98/aleph/blob/main/challenge/T06/server.js): `challenge/T06/server.js`
- [Input validation](https://github.com/wogud98/aleph/blob/main/challenge/T06/src/validate.js): `challenge/T06/src/validate.js`
- [Initial seed](https://github.com/wogud98/aleph/blob/main/challenge/T06/src/seed.js): `challenge/T06/src/seed.js`
- [Database access](https://github.com/wogud98/aleph/blob/main/challenge/T06/src/db.js): `challenge/T06/src/db.js`
- [PostgreSQL](https://github.com/wogud98/aleph/blob/main/challenge/T06/db/schema.sql): `challenge/T06/db/schema.sql`

### Other components

- **Diary user**
- **Exchange-rate API**
- **Browser**

## Connections

- Live collector → Normalize and replay: uses shared logic (evidence: `challenge/T04/collector/collect.js`)
- Live collector → Exchange-rate API: fetches readings (evidence: `challenge/T04/collector/collect.js`)
- Live collector → Collector data files: writes status and records (evidence: `challenge/T04/collector/collect.js`)
- Public replay screen → Normalize and replay: replays fixtures (evidence: `challenge/T04/collector/lib.js`)
- Browser → Public replay screen: opens replay
- Diary user → Diary UI: uses diary
- Diary UI → HTTP handler: sends API requests (evidence: `challenge/T06/public/app.js`)
- Server startup → HTTP handler: creates handler (evidence: `challenge/T06/server.js`)
- HTTP handler → Plan management: dispatches plan routes (evidence: `challenge/T06/src/app.js`)
- HTTP handler → Task tracking: dispatches task routes (evidence: `challenge/T06/src/app.js`)
- HTTP handler → Work logs: dispatches log routes (evidence: `challenge/T06/src/app.js`)
- HTTP handler → Review and evidence: dispatches review routes (evidence: `challenge/T06/src/app.js`)
- HTTP handler → Retrospectives: dispatches retrospective routes (evidence: `challenge/T06/src/app.js`)
- HTTP handler → Data export: dispatches export (evidence: `challenge/T06/src/app.js`)
- Plan management → Input validation: validates input (evidence: `challenge/T06/src/service.js`)
- Task tracking → Input validation: validates input (evidence: `challenge/T06/src/service.js`)
- Work logs → Input validation: validates input (evidence: `challenge/T06/src/service.js`)
- Retrospectives → Review and evidence: captures review snapshot (evidence: `challenge/T06/src/service.js`)
- Server startup → Database access: creates pool and migrates (evidence: `challenge/T06/server.js`)
- Server startup → Initial seed: runs optional seeding (evidence: `challenge/T06/server.js`)
- Initial seed → Plan management: uses service functions (evidence: `challenge/T06/src/seed.js`)
- Plan management → Database access: queries database (evidence: `challenge/T06/src/service.js`)
- Task tracking → Database access: queries database (evidence: `challenge/T06/src/service.js`)
- Work logs → Database access: queries database (evidence: `challenge/T06/src/service.js`)
- Review and evidence → Database access: queries database (evidence: `challenge/T06/src/service.js`)
- Retrospectives → Database access: queries database (evidence: `challenge/T06/src/service.js`)
- Data export → Database access: reads records (evidence: `challenge/T06/src/service.js`)
- Database access → PostgreSQL: runs SQL (evidence: `challenge/T06/src/db.js`)
