Skip to content

Architecture Diagrams

bitbiter-dev edited this page May 1, 2026 · 2 revisions

Architecture Diagrams

System context

The user accesses memories through a browser. The API serves all data and files. The Worker processes the NAS in the background and is the only component that writes to the database.

graph TB
    User((User))

    subgraph Anichron
        UI[Web UI\nNext.js]
        API[anichron-api\nASP.NET Core]
        Worker[anichron-worker\n.NET Worker + FFmpeg]
        DB[(anichron-db\nPostgreSQL)]
    end

    NAS[/NAS\n/data/originals/]
    Proxies[/Proxy SSD\n/data/proxies/]

    User -->|browser| UI
    UI -->|REST| API
    API --> DB
    API -->|reads| Proxies
    API -->|on demand| NAS
    Worker -->|crawls| NAS
    Worker -->|writes| Proxies
    Worker --> DB
Loading

Container view

Shows the internal structure, base images, and data flow between containers.

graph LR
    subgraph compose[Docker Compose]
        direction TB
        API["anichron-api\n─────────────\nASP.NET Core Minimal APIs\nAlpine · read-only"]
        Worker["anichron-worker\n─────────────\n.NET BackgroundService\nFFmpeg · ImageSharp\nNoble · GPU drivers amd64"]
        DB[("anichron-db\n─────────────\nPostgreSQL 17")]
    end

    NAS[/"NAS\n/data/originals\n:ro"/]
    Proxies[/"Proxy SSD\n/data/proxies\n:rw Worker · :ro API"/]

    API -- queries --> DB
    API -- reads --> Proxies
    API -. on demand .-> NAS
    Worker -- migrates + persists --> DB
    Worker -- reads --> NAS
    Worker -- writes --> Proxies
Loading

Data write boundary

The Worker is the only component that writes to the database. The API is strictly read-only. This boundary is enforced by convention (no write operations in API code) rather than database-level permissions.

graph LR
    Worker -->|INSERT / UPDATE / DELETE| DB[(Database)]
    API -->|SELECT only| DB
Loading

Clone this wiki locally