Skip to content

Solution Overview

bitbiter-dev edited this page Apr 30, 2026 · 3 revisions

Solution Overview

The project follows a Clean Architecture approach using a shared core to ensure data consistency between the background engine and the user interface.

Project Structure

Anichron.Core (Class Library)

  • Single Source of Truth: Contains the AnichronDbContext and all database configuration (Fluent API).
  • Domain Models: Holds the central entities (MediaAsset, Burst, Metadata).
  • Shared Logic: Houses the XXHash64 implementation and path-parsing utilities used by both the Worker and API.

Anichron.Worker (Console Application)

  • Ingestion Engine: Periodically crawls the NAS root folders to identify new or moved files.
  • Media Processing: Executes FFmpeg commands for video transcoding and ImageSharp/ExifLib for photo metadata extraction.
  • Proxy Generation: Utilises Intel QuickSync to generate thumbnails and web-optimised video versions.
  • Writer: Responsible for all initial database inserts and reconciliation (soft-deletes).

Anichron.API (ASP.NET Core API)

  • Query Handler: Executes optimised SQL for "On This Day" and "Calendar View" requests.
  • Data Mapper: Converts internal database entities into clean DTOs for the frontend.
  • File Provider: Serves the generated proxy files (and originals on request) via HTTP.
  • State Manager: Handles user interactions (liking, starring, or hiding photos).

Anichron.UI (Next.js / React)

  • Experience Layer: Provides the "Instagram Story" navigation (swipe/tap/hold).
  • State Store: Manages client-side caching and pre-fetching of the next "memory" in the sequence.

Containers

Each component is isolated to optimise resource usage — keeping heavy media processing away from the responsive API.

Container Base Image Responsibility
anichron-db postgres:17-alpine Persists metadata, user configs, and asset relationships.
anichron-worker mcr.microsoft.com/dotnet/runtime:10.0-noble (Custom) The "Heavy Lifter." Contains ffmpeg and intel-media-driver. Read-only access to NAS; write access to proxy storage.
anichron-api mcr.microsoft.com/dotnet/aspnet:10.0-alpine The "Gatekeeper." Provides REST endpoints. Read-only access to both NAS and proxy storage.
anichron-ui node:22-alpine (or nginx) The "Interface." Serves the web assets. Connects only to the API container.

Storage Layout

Path Mount Who
/data/originals (NAS) :ro API + Worker — originals are never modified
/data/proxies (SSD) :rw Worker / :ro API Worker writes thumbnails and transcoded video; API serves them

Clone this wiki locally