# openfotos/openfotos-platform architecture

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

- Interactive diagram: https://gitdiagram.com/openfotos/openfotos-platform
- Repository: https://github.com/openfotos/openfotos-platform

## Overview

OneNodeAI Studio is a photographer-facing desktop and Django service for private wedding-photo ingestion, publication, browsing, and event-scoped face search. The main workflow selects an event sub-event, scans and validates local images, prepares derivatives and face data, transfers originals, then lets the server reconcile contributions and publish a frozen gallery snapshot. Server-side event, access, gallery, and search capabilities are documented, though several corresponding modules were not sampled. The graph uses README and source-index evidence; unsampled internals are represented at their exact existing paths, with uncertain links omitted.

Main entry points: [`apps/desktop/src/openfotos_desktop/batch_sync.py`](https://github.com/openfotos/openfotos-platform/blob/main/apps/desktop/src/openfotos_desktop/batch_sync.py) (Batch synchronization), [`apps/server/src/openfotos_server/events/ingestion_services.py`](https://github.com/openfotos/openfotos-platform/blob/main/apps/server/src/openfotos_server/events/ingestion_services.py) (Contribution lifecycle), [`apps/desktop/src/openfotos_desktop/ui.py`](https://github.com/openfotos/openfotos-platform/blob/main/apps/desktop/src/openfotos_desktop/ui.py) (Studio workflow), [`apps/server/src/openfotos_server/events/face_services.py`](https://github.com/openfotos/openfotos-platform/blob/main/apps/server/src/openfotos_server/events/face_services.py) (Face indexing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop Studio"]
  node_studio_ui["Studio workflow<br/>[ui.py]"]
  node_scanner["Folder scanner<br/>[scanner.py]"]
  node_validation["Image validation<br/>[validation.py]"]
  node_checkpoint[("Local checkpoint<br/>[checkpoint.py]")]
  node_batch_sync["Batch synchronization<br/>[batch_sync.py]"]
  node_derivatives["Derivative generation<br/>[derivatives.py]"]
  node_face_models["Model download<br/>[face_models.py]"]
  node_api_client["Server API client<br/>[api_client.py]"]
  node_object_transfer["Object transfer<br/>[object_transfer.py]"]
end

subgraph group_server["Event Server"]
  node_server_api["Event API<br/>[api.py]"]
  node_ingestion["Contribution lifecycle"]
  node_event_lifecycle["Event publication<br/>[event_lifecycle.py]"]
  node_records[("Event records<br/>[models.py]")]
  node_object_store[("Private object storage<br/>[backend.py]")]
  node_derivative_service["Preview services"]
  node_gallery["Gallery and sharing"]
  node_face_service["Face indexing<br/>[face_services.py]"]
  node_face_search["Face search"]
end

subgraph group_shared["Shared Processing"]
  node_contracts["Shared API contracts<br/>[ingestion.py]"]
  node_vision["Face engine<br/>[engines.py]"]
end

node_photographer(("Photographer"))

node_photographer -->|"selects photos"| node_studio_ui
node_studio_ui -->|"starts scan"| node_scanner
node_scanner -->|"validates files"| node_validation
node_scanner -->|"saves inventory"| node_checkpoint
node_studio_ui -->|"uses inventory"| node_checkpoint
node_studio_ui -.->|"starts contribution"| node_batch_sync
node_batch_sync -->|"validates inputs"| node_validation
node_batch_sync -->|"creates previews"| node_derivatives
node_batch_sync -->|"embeds faces"| node_face_models
node_batch_sync -->|"transfers objects"| node_object_transfer
node_batch_sync -.->|"calls API"| node_api_client
node_api_client -.->|"sends requests"| node_server_api
node_server_api -.->|"dispatches ingestion"| node_ingestion
node_ingestion -->|"updates records"| node_records
node_ingestion -->|"checks lifecycle"| node_event_lifecycle
node_ingestion -->|"stores originals"| node_object_store
node_ingestion -->|"coordinates derivatives"| node_derivative_service
node_ingestion -->|"coordinates indexing"| node_face_service
node_derivative_service -->|"stores previews"| node_object_store
node_event_lifecycle -->|"transitions event"| node_records
node_face_service -->|"persists face data"| node_records
node_face_search -->|"uses face index"| node_face_service
node_face_service -->|"uses face contracts"| node_vision
node_batch_sync -->|"formats requests"| node_contracts
node_ingestion -->|"validates requests"| node_contracts
node_photographer -.->|"publishes event"| node_gallery
node_gallery -.->|"reads event data"| node_records
node_gallery -.->|"serves media"| node_object_store
node_photographer -.->|"searches photos"| node_face_search

click node_studio_ui "https://github.com/openfotos/openfotos-platform/blob/main/apps/desktop/src/openfotos_desktop/ui.py"
click node_scanner "https://github.com/openfotos/openfotos-platform/blob/main/apps/desktop/src/openfotos_desktop/ingestion/scanner.py"
click node_validation "https://github.com/openfotos/openfotos-platform/blob/main/apps/desktop/src/openfotos_desktop/ingestion/validation.py"
click node_checkpoint "https://github.com/openfotos/openfotos-platform/blob/main/apps/desktop/src/openfotos_desktop/ingestion/checkpoint.py"
click node_batch_sync "https://github.com/openfotos/openfotos-platform/blob/main/apps/desktop/src/openfotos_desktop/batch_sync.py"
click node_derivatives "https://github.com/openfotos/openfotos-platform/blob/main/apps/desktop/src/openfotos_desktop/derivatives.py"
click node_face_models "https://github.com/openfotos/openfotos-platform/blob/main/apps/desktop/src/openfotos_desktop/face_models.py"
click node_api_client "https://github.com/openfotos/openfotos-platform/blob/main/apps/desktop/src/openfotos_desktop/api_client.py"
click node_object_transfer "https://github.com/openfotos/openfotos-platform/blob/main/apps/desktop/src/openfotos_desktop/object_transfer.py"
click node_server_api "https://github.com/openfotos/openfotos-platform/blob/main/apps/server/src/openfotos_server/events/api.py"
click node_ingestion "https://github.com/openfotos/openfotos-platform/blob/main/apps/server/src/openfotos_server/events/ingestion_services.py"
click node_event_lifecycle "https://github.com/openfotos/openfotos-platform/blob/main/apps/server/src/openfotos_server/events/event_lifecycle.py"
click node_records "https://github.com/openfotos/openfotos-platform/blob/main/apps/server/src/openfotos_server/events/models.py"
click node_object_store "https://github.com/openfotos/openfotos-platform/blob/main/packages/storage/src/openfotos_storage/backend.py"
click node_derivative_service "https://github.com/openfotos/openfotos-platform/blob/main/apps/server/src/openfotos_server/events/derivative_services.py"
click node_gallery "https://github.com/openfotos/openfotos-platform/blob/main/apps/server/src/openfotos_server/events/gallery_services.py"
click node_face_service "https://github.com/openfotos/openfotos-platform/blob/main/apps/server/src/openfotos_server/events/face_services.py"
click node_face_search "https://github.com/openfotos/openfotos-platform/blob/main/apps/server/src/openfotos_server/events/face_search_services.py"
click node_contracts "https://github.com/openfotos/openfotos-platform/blob/main/packages/contracts/src/openfotos_contracts/ingestion.py"
click node_vision "https://github.com/openfotos/openfotos-platform/blob/main/packages/vision/src/openfotos_vision/engines.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_studio_ui,node_scanner,node_validation,node_checkpoint,node_batch_sync,node_derivatives,node_face_models,node_api_client,node_object_transfer toneBlue
class node_server_api,node_ingestion,node_event_lifecycle,node_records,node_object_store,node_derivative_service,node_gallery,node_face_service,node_face_search toneAmber
class node_contracts,node_vision toneMint
class node_photographer toneIndigo
```

## Components

### Desktop Studio

- [Studio workflow](https://github.com/openfotos/openfotos-platform/blob/main/apps/desktop/src/openfotos_desktop/ui.py): `apps/desktop/src/openfotos_desktop/ui.py`
- [Folder scanner](https://github.com/openfotos/openfotos-platform/blob/main/apps/desktop/src/openfotos_desktop/ingestion/scanner.py): `apps/desktop/src/openfotos_desktop/ingestion/scanner.py`
- [Image validation](https://github.com/openfotos/openfotos-platform/blob/main/apps/desktop/src/openfotos_desktop/ingestion/validation.py): `apps/desktop/src/openfotos_desktop/ingestion/validation.py`
- [Local checkpoint](https://github.com/openfotos/openfotos-platform/blob/main/apps/desktop/src/openfotos_desktop/ingestion/checkpoint.py): `apps/desktop/src/openfotos_desktop/ingestion/checkpoint.py`
- [Batch synchronization](https://github.com/openfotos/openfotos-platform/blob/main/apps/desktop/src/openfotos_desktop/batch_sync.py): `apps/desktop/src/openfotos_desktop/batch_sync.py`
- [Derivative generation](https://github.com/openfotos/openfotos-platform/blob/main/apps/desktop/src/openfotos_desktop/derivatives.py): `apps/desktop/src/openfotos_desktop/derivatives.py`
- [Model download](https://github.com/openfotos/openfotos-platform/blob/main/apps/desktop/src/openfotos_desktop/face_models.py): `apps/desktop/src/openfotos_desktop/face_models.py`
- [Server API client](https://github.com/openfotos/openfotos-platform/blob/main/apps/desktop/src/openfotos_desktop/api_client.py): `apps/desktop/src/openfotos_desktop/api_client.py`
- [Object transfer](https://github.com/openfotos/openfotos-platform/blob/main/apps/desktop/src/openfotos_desktop/object_transfer.py): `apps/desktop/src/openfotos_desktop/object_transfer.py`

### Event Server

- [Event API](https://github.com/openfotos/openfotos-platform/blob/main/apps/server/src/openfotos_server/events/api.py): `apps/server/src/openfotos_server/events/api.py`
- [Contribution lifecycle](https://github.com/openfotos/openfotos-platform/blob/main/apps/server/src/openfotos_server/events/ingestion_services.py): `apps/server/src/openfotos_server/events/ingestion_services.py`
- [Event publication](https://github.com/openfotos/openfotos-platform/blob/main/apps/server/src/openfotos_server/events/event_lifecycle.py): `apps/server/src/openfotos_server/events/event_lifecycle.py`
- [Event records](https://github.com/openfotos/openfotos-platform/blob/main/apps/server/src/openfotos_server/events/models.py): `apps/server/src/openfotos_server/events/models.py`
- [Private object storage](https://github.com/openfotos/openfotos-platform/blob/main/packages/storage/src/openfotos_storage/backend.py): `packages/storage/src/openfotos_storage/backend.py`
- [Preview services](https://github.com/openfotos/openfotos-platform/blob/main/apps/server/src/openfotos_server/events/derivative_services.py): `apps/server/src/openfotos_server/events/derivative_services.py`
- [Gallery and sharing](https://github.com/openfotos/openfotos-platform/blob/main/apps/server/src/openfotos_server/events/gallery_services.py): `apps/server/src/openfotos_server/events/gallery_services.py`
- [Face indexing](https://github.com/openfotos/openfotos-platform/blob/main/apps/server/src/openfotos_server/events/face_services.py): `apps/server/src/openfotos_server/events/face_services.py`
- [Face search](https://github.com/openfotos/openfotos-platform/blob/main/apps/server/src/openfotos_server/events/face_search_services.py): `apps/server/src/openfotos_server/events/face_search_services.py`

### Shared Processing

- [Shared API contracts](https://github.com/openfotos/openfotos-platform/blob/main/packages/contracts/src/openfotos_contracts/ingestion.py): `packages/contracts/src/openfotos_contracts/ingestion.py`
- [Face engine](https://github.com/openfotos/openfotos-platform/blob/main/packages/vision/src/openfotos_vision/engines.py): `packages/vision/src/openfotos_vision/engines.py`

### Other components

- **Photographer**

## Connections

- Photographer → Studio workflow: selects photos
- Studio workflow → Folder scanner: starts scan (evidence: `apps/desktop/src/openfotos_desktop/ui.py`)
- Folder scanner → Image validation: validates files (evidence: `apps/desktop/src/openfotos_desktop/ingestion/scanner.py`)
- Folder scanner → Local checkpoint: saves inventory (evidence: `apps/desktop/src/openfotos_desktop/ingestion/scanner.py`)
- Studio workflow → Local checkpoint: uses inventory (evidence: `apps/desktop/src/openfotos_desktop/ui.py`)
- Studio workflow → Batch synchronization: starts contribution
- Batch synchronization → Image validation: validates inputs (evidence: `apps/desktop/src/openfotos_desktop/batch_sync.py`)
- Batch synchronization → Derivative generation: creates previews (evidence: `apps/desktop/src/openfotos_desktop/batch_sync.py`)
- Batch synchronization → Model download: embeds faces (evidence: `apps/desktop/src/openfotos_desktop/batch_sync.py`)
- Batch synchronization → Object transfer: transfers objects (evidence: `apps/desktop/src/openfotos_desktop/batch_sync.py`)
- Batch synchronization → Server API client: calls API
- Server API client → Event API: sends requests
- Event API → Contribution lifecycle: dispatches ingestion
- Contribution lifecycle → Event records: updates records (evidence: `apps/server/src/openfotos_server/events/ingestion_services.py`)
- Contribution lifecycle → Event publication: checks lifecycle (evidence: `apps/server/src/openfotos_server/events/ingestion_services.py`)
- Contribution lifecycle → Private object storage: stores originals (evidence: `apps/server/src/openfotos_server/events/ingestion_services.py`)
- Contribution lifecycle → Preview services: coordinates derivatives (evidence: `apps/server/src/openfotos_server/events/ingestion_services.py`)
- Contribution lifecycle → Face indexing: coordinates indexing (evidence: `apps/server/src/openfotos_server/events/ingestion_services.py`)
- Preview services → Private object storage: stores previews (evidence: `apps/server/src/openfotos_server/events/derivative_services.py`)
- Event publication → Event records: transitions event (evidence: `apps/server/src/openfotos_server/events/event_lifecycle.py`)
- Face indexing → Event records: persists face data (evidence: `apps/server/src/openfotos_server/events/face_services.py`)
- Face search → Face indexing: uses face index (evidence: `apps/server/src/openfotos_server/events/face_search_services.py`)
- Face indexing → Face engine: uses face contracts (evidence: `apps/server/src/openfotos_server/events/face_services.py`)
- Batch synchronization → Shared API contracts: formats requests (evidence: `apps/desktop/src/openfotos_desktop/batch_sync.py`)
- Contribution lifecycle → Shared API contracts: validates requests (evidence: `apps/server/src/openfotos_server/events/ingestion_services.py`)
- Photographer → Gallery and sharing: publishes event
- Gallery and sharing → Event records: reads event data
- Gallery and sharing → Private object storage: serves media
- Photographer → Face search: searches photos
