# white-devil-007/obsession-matrix architecture

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

- Interactive diagram: https://gitdiagram.com/white-devil-007/obsession-matrix
- Repository: https://github.com/white-devil-007/obsession-matrix

## Overview

Obsession Matrix is a desktop learning-management terminal for organizing hierarchical interests, tasks, progress logs, focus status, and settings. The primary workflow is a user entering commands in the terminal UI; the JavaScript bridge sends them to the Python API, which delegates command interpretation and domain operations to the parser and services, with records persisted in SQLite. The README documents dashboard, hierarchy navigation, settings, and recall features. The graph reflects shown calls and documented capabilities; unsampled frontend shell details are limited to the paths and roles stated in the README.

Main entry points: [`backend/services.py`](https://github.com/white-devil-007/obsession-matrix/blob/main/backend/services.py) (Domain services), [`frontend/app.js`](https://github.com/white-devil-007/obsession-matrix/blob/main/frontend/app.js) (Terminal controller), [`backend/app_api.py`](https://github.com/white-devil-007/obsession-matrix/blob/main/backend/app_api.py) (JavaScript API bridge), [`backend/notification_service.py`](https://github.com/white-devil-007/obsession-matrix/blob/main/backend/notification_service.py) (Notification daemon)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Desktop interface"]
  node_terminal["Terminal controller<br/>[app.js]"]
  node_window["Desktop window<br/>[index.html]"]
  node_styles["CRT themes<br/>[styles.css]"]
end

subgraph group_application["Application logic"]
  node_api["JavaScript API bridge<br/>[app_api.py]"]
  node_parser["Command navigation<br/>[command_parser.py]"]
end

subgraph group_learning["Learning domains"]
  node_service["Domain services<br/>[services.py]"]
  node_hierarchy["Interest hierarchy<br/>[services.py]"]
  node_tasks["Task lifecycle<br/>[services.py]"]
  node_progress["Progress history<br/>[services.py]"]
  node_dashboard["Dashboard summary<br/>[services.py]"]
  node_settings["Application settings<br/>[services.py]"]
  node_models["Domain models<br/>[models.py]"]
end

subgraph group_platform["Persistence and notifications"]
  node_database[("SQLite database<br/>[database.py]")]
  node_config["Runtime configuration<br/>[config.py]"]
  node_notifications["Notification daemon"]
end

node_learner(("Learner"))
node_toast["Desktop toast service"]
node_runtime["Desktop runtime"]

node_learner -->|"enters commands"| node_terminal
node_terminal -->|"calls bridge"| node_api
node_runtime -->|"opens window"| node_window
node_window -.->|"hosts interface"| node_terminal
node_terminal -.->|"applies themes"| node_styles
node_api -->|"executes commands"| node_parser
node_parser -->|"delegates operations"| node_service
node_api -->|"fetches and mutates"| node_service
node_service -->|"queries and updates"| node_database
node_service -->|"uses models"| node_models
node_service -->|"loads defaults"| node_config
node_database -->|"uses database path"| node_config
node_service -->|"manages interests"| node_hierarchy
node_service -->|"manages tasks"| node_tasks
node_service -->|"records commits"| node_progress
node_service -->|"summarizes activity"| node_dashboard
node_service -->|"reads settings"| node_settings
node_runtime -->|"starts daemon"| node_notifications
node_notifications -->|"reads focus summary"| node_service
node_notifications -->|"sends toast"| node_toast

click node_terminal "https://github.com/white-devil-007/obsession-matrix/blob/main/frontend/app.js"
click node_window "https://github.com/white-devil-007/obsession-matrix/blob/main/frontend/index.html"
click node_styles "https://github.com/white-devil-007/obsession-matrix/blob/main/frontend/styles.css"
click node_api "https://github.com/white-devil-007/obsession-matrix/blob/main/backend/app_api.py"
click node_parser "https://github.com/white-devil-007/obsession-matrix/blob/main/backend/command_parser.py"
click node_service "https://github.com/white-devil-007/obsession-matrix/blob/main/backend/services.py"
click node_hierarchy "https://github.com/white-devil-007/obsession-matrix/blob/main/backend/services.py"
click node_tasks "https://github.com/white-devil-007/obsession-matrix/blob/main/backend/services.py"
click node_progress "https://github.com/white-devil-007/obsession-matrix/blob/main/backend/services.py"
click node_dashboard "https://github.com/white-devil-007/obsession-matrix/blob/main/backend/services.py"
click node_settings "https://github.com/white-devil-007/obsession-matrix/blob/main/backend/services.py"
click node_models "https://github.com/white-devil-007/obsession-matrix/blob/main/backend/models.py"
click node_database "https://github.com/white-devil-007/obsession-matrix/blob/main/backend/database.py"
click node_config "https://github.com/white-devil-007/obsession-matrix/blob/main/backend/config.py"
click node_notifications "https://github.com/white-devil-007/obsession-matrix/blob/main/backend/notification_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_terminal,node_window,node_styles toneBlue
class node_api,node_parser toneAmber
class node_service,node_hierarchy,node_tasks,node_progress,node_dashboard,node_settings,node_models toneMint
class node_database,node_config,node_notifications toneRose
class node_learner,node_toast,node_runtime toneIndigo
```

## Components

### Desktop interface

- [Terminal controller](https://github.com/white-devil-007/obsession-matrix/blob/main/frontend/app.js): `frontend/app.js`
- [Desktop window](https://github.com/white-devil-007/obsession-matrix/blob/main/frontend/index.html): `frontend/index.html`
- [CRT themes](https://github.com/white-devil-007/obsession-matrix/blob/main/frontend/styles.css): `frontend/styles.css`

### Application logic

- [JavaScript API bridge](https://github.com/white-devil-007/obsession-matrix/blob/main/backend/app_api.py): `backend/app_api.py`
- [Command navigation](https://github.com/white-devil-007/obsession-matrix/blob/main/backend/command_parser.py): `backend/command_parser.py`

### Learning domains

- [Domain services](https://github.com/white-devil-007/obsession-matrix/blob/main/backend/services.py): `backend/services.py`
- [Interest hierarchy](https://github.com/white-devil-007/obsession-matrix/blob/main/backend/services.py): `backend/services.py`
- [Task lifecycle](https://github.com/white-devil-007/obsession-matrix/blob/main/backend/services.py): `backend/services.py`
- [Progress history](https://github.com/white-devil-007/obsession-matrix/blob/main/backend/services.py): `backend/services.py`
- [Dashboard summary](https://github.com/white-devil-007/obsession-matrix/blob/main/backend/services.py): `backend/services.py`
- [Application settings](https://github.com/white-devil-007/obsession-matrix/blob/main/backend/services.py): `backend/services.py`
- [Domain models](https://github.com/white-devil-007/obsession-matrix/blob/main/backend/models.py): `backend/models.py`

### Persistence and notifications

- [SQLite database](https://github.com/white-devil-007/obsession-matrix/blob/main/backend/database.py): `backend/database.py`
- [Runtime configuration](https://github.com/white-devil-007/obsession-matrix/blob/main/backend/config.py): `backend/config.py`
- [Notification daemon](https://github.com/white-devil-007/obsession-matrix/blob/main/backend/notification_service.py): `backend/notification_service.py`

### Other components

- **Learner**
- **Desktop toast service**
- **Desktop runtime**

## Connections

- Learner → Terminal controller: enters commands (evidence: `README.md`)
- Terminal controller → JavaScript API bridge: calls bridge (evidence: `frontend/app.js`)
- Desktop runtime → Desktop window: opens window
- Desktop window → Terminal controller: hosts interface (evidence: `README.md`)
- Terminal controller → CRT themes: applies themes (evidence: `README.md`)
- JavaScript API bridge → Command navigation: executes commands (evidence: `backend/app_api.py`)
- Command navigation → Domain services: delegates operations (evidence: `backend/command_parser.py`)
- JavaScript API bridge → Domain services: fetches and mutates (evidence: `backend/app_api.py`)
- Domain services → SQLite database: queries and updates (evidence: `backend/services.py`)
- Domain services → Domain models: uses models (evidence: `backend/services.py`)
- Domain services → Runtime configuration: loads defaults (evidence: `backend/services.py`)
- SQLite database → Runtime configuration: uses database path (evidence: `backend/database.py`)
- Domain services → Interest hierarchy: manages interests (evidence: `README.md`)
- Domain services → Task lifecycle: manages tasks (evidence: `README.md`)
- Domain services → Progress history: records commits (evidence: `README.md`)
- Domain services → Dashboard summary: summarizes activity (evidence: `README.md`)
- Domain services → Application settings: reads settings (evidence: `backend/services.py`)
- Desktop runtime → Notification daemon: starts daemon
- Notification daemon → Domain services: reads focus summary (evidence: `backend/notification_service.py`)
- Notification daemon → Desktop toast service: sends toast (evidence: `backend/notification_service.py`)
