# okami89aut/aiki-nikki architecture

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

- Interactive diagram: https://gitdiagram.com/okami89aut/aiki-nikki
- Repository: https://github.com/okami89aut/aiki-nikki

## Overview

Aikido Tracker is a Home Assistant integration paired with a browser-based kyu curriculum and training diary. A person opens the app, signs in or registers, and synchronizes training records and goals with the server; the integration validates requests and persists each person’s data. Other documented capabilities include delayed account deletion, an administrative person-deletion service, and a Home Assistant overview sensor. The app’s implementation was not excerpted, so its internal workflow is summarized rather than decomposed; QA and build tooling are excluded.

Main entry points: [`custom_components/aikido_tracker/api.py`](https://github.com/okami89aut/aiki-nikki/blob/main/custom_components/aikido_tracker/api.py) (HTTP API), [`custom_components/aikido_tracker/__init__.py`](https://github.com/okami89aut/aiki-nikki/blob/main/custom_components/aikido_tracker/__init__.py) (Integration setup), [`custom_components/aikido_tracker/store.py`](https://github.com/okami89aut/aiki-nikki/blob/main/custom_components/aikido_tracker/store.py) (Person store), [`custom_components/aikido_tracker/app/aikido-kyu-tracker.html`](https://github.com/okami89aut/aiki-nikki/blob/main/custom_components/aikido_tracker/app/aikido-kyu-tracker.html) (Kyu tracker app)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Browser app"]
  node_app["Kyu tracker app"]
end

subgraph group_server["Server integration"]
  node_setup["Integration setup<br/>[__init__.py]"]
  node_http_api["HTTP API<br/>[api.py]"]
  node_rate_limits["Request limits<br/>[limits.py]"]
  node_app_page["App page delivery<br/>[page.py]"]
end

subgraph group_storage["Identity and storage"]
  node_identity["Identity checks<br/>[identity.py]"]
  node_person_store["Person store<br/>[store.py]"]
  node_person_files[("Person data files<br/>[store.py]")]
end

subgraph group_ha["Home Assistant"]
  node_ha_sensor["Person overview sensor<br/>[sensor.py]"]
  node_overview_report["Overview formatter<br/>[report.py]"]
end

node_person(("Tracker user"))
node_ha_admin(("Home Assistant admin"))

node_person -->|"opens"| node_app
node_app -->|"syncs records"| node_http_api
node_person -.->|"registers or signs in"| node_http_api
node_setup -->|"registers routes"| node_http_api
node_setup -->|"loads store"| node_person_store
node_setup -->|"registers page"| node_app_page
node_setup -->|"loads platform"| node_ha_sensor
node_http_api -->|"checks credentials"| node_identity
node_http_api -->|"checks request limits"| node_rate_limits
node_http_api -->|"reads and writes"| node_person_store
node_person_store -->|"persists records"| node_person_files
node_ha_sensor -->|"formats overview"| node_overview_report
node_ha_admin -->|"configures integration"| node_setup
node_ha_admin -->|"deletes person"| node_person_store

click node_app "https://github.com/okami89aut/aiki-nikki/blob/main/custom_components/aikido_tracker/app/aikido-kyu-tracker.html"
click node_setup "https://github.com/okami89aut/aiki-nikki/blob/main/custom_components/aikido_tracker/__init__.py"
click node_http_api "https://github.com/okami89aut/aiki-nikki/blob/main/custom_components/aikido_tracker/api.py"
click node_identity "https://github.com/okami89aut/aiki-nikki/blob/main/custom_components/aikido_tracker/identity.py"
click node_rate_limits "https://github.com/okami89aut/aiki-nikki/blob/main/custom_components/aikido_tracker/limits.py"
click node_person_store "https://github.com/okami89aut/aiki-nikki/blob/main/custom_components/aikido_tracker/store.py"
click node_person_files "https://github.com/okami89aut/aiki-nikki/blob/main/custom_components/aikido_tracker/store.py"
click node_app_page "https://github.com/okami89aut/aiki-nikki/blob/main/custom_components/aikido_tracker/page.py"
click node_ha_sensor "https://github.com/okami89aut/aiki-nikki/blob/main/custom_components/aikido_tracker/sensor.py"
click node_overview_report "https://github.com/okami89aut/aiki-nikki/blob/main/custom_components/aikido_tracker/report.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_app,node_person toneBlue
class node_setup,node_http_api,node_rate_limits,node_app_page toneAmber
class node_identity,node_person_store,node_person_files toneMint
class node_ha_sensor,node_overview_report toneRose
class node_ha_admin toneIndigo
```

## Components

### Browser app

- [Kyu tracker app](https://github.com/okami89aut/aiki-nikki/blob/main/custom_components/aikido_tracker/app/aikido-kyu-tracker.html): `custom_components/aikido_tracker/app/aikido-kyu-tracker.html`

### Server integration

- [Integration setup](https://github.com/okami89aut/aiki-nikki/blob/main/custom_components/aikido_tracker/__init__.py): `custom_components/aikido_tracker/__init__.py`
- [HTTP API](https://github.com/okami89aut/aiki-nikki/blob/main/custom_components/aikido_tracker/api.py): `custom_components/aikido_tracker/api.py`
- [Request limits](https://github.com/okami89aut/aiki-nikki/blob/main/custom_components/aikido_tracker/limits.py): `custom_components/aikido_tracker/limits.py`
- [App page delivery](https://github.com/okami89aut/aiki-nikki/blob/main/custom_components/aikido_tracker/page.py): `custom_components/aikido_tracker/page.py`

### Identity and storage

- [Identity checks](https://github.com/okami89aut/aiki-nikki/blob/main/custom_components/aikido_tracker/identity.py): `custom_components/aikido_tracker/identity.py`
- [Person store](https://github.com/okami89aut/aiki-nikki/blob/main/custom_components/aikido_tracker/store.py): `custom_components/aikido_tracker/store.py`
- [Person data files](https://github.com/okami89aut/aiki-nikki/blob/main/custom_components/aikido_tracker/store.py): `custom_components/aikido_tracker/store.py`

### Home Assistant

- [Person overview sensor](https://github.com/okami89aut/aiki-nikki/blob/main/custom_components/aikido_tracker/sensor.py): `custom_components/aikido_tracker/sensor.py`
- [Overview formatter](https://github.com/okami89aut/aiki-nikki/blob/main/custom_components/aikido_tracker/report.py): `custom_components/aikido_tracker/report.py`

### Other components

- **Tracker user**
- **Home Assistant admin**

## Connections

- Tracker user → Kyu tracker app: opens (evidence: `README.md`)
- Kyu tracker app → HTTP API: syncs records (evidence: `README.md`)
- Tracker user → HTTP API: registers or signs in
- Integration setup → HTTP API: registers routes (evidence: `custom_components/aikido_tracker/__init__.py`)
- Integration setup → Person store: loads store (evidence: `custom_components/aikido_tracker/__init__.py`)
- Integration setup → App page delivery: registers page (evidence: `custom_components/aikido_tracker/__init__.py`)
- Integration setup → Person overview sensor: loads platform (evidence: `custom_components/aikido_tracker/__init__.py`)
- HTTP API → Identity checks: checks credentials (evidence: `custom_components/aikido_tracker/api.py`)
- HTTP API → Request limits: checks request limits (evidence: `custom_components/aikido_tracker/api.py`)
- HTTP API → Person store: reads and writes (evidence: `custom_components/aikido_tracker/api.py`)
- Person store → Person data files: persists records (evidence: `custom_components/aikido_tracker/store.py`)
- Person overview sensor → Overview formatter: formats overview (evidence: `custom_components/aikido_tracker/sensor.py`)
- Home Assistant admin → Integration setup: configures integration (evidence: `README.md`)
- Home Assistant admin → Person store: deletes person
