# rapabru/offline-disk-caalog architecture

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

- Interactive diagram: https://gitdiagram.com/rapabru/offline-disk-caalog
- Repository: https://github.com/rapabru/offline-disk-caalog

## Overview

Offline Disk Catalog is an Electron desktop app for registering removable volumes, indexing their contents, and searching and organizing media while drives may be offline. The main workflow runs from disk registration and scanning through metadata extraction and local catalog storage, then into browsing, filtering, duplicate review, and classification. The README also documents incremental change detection, animated video previews, batch file actions, and PIN protection. Some Electron modules are present in the tree but their source was not sampled, so their links reflect documented capabilities only where noted; uncertain call wiring is omitted.

Main entry points: [`src/App.tsx`](https://github.com/rapabru/offline-disk-caalog/blob/main/src/App.tsx) (Application shell), [`electron/main.ts`](https://github.com/rapabru/offline-disk-caalog/blob/main/electron/main.ts) (IPC handlers), [`electron/preload.ts`](https://github.com/rapabru/offline-disk-caalog/blob/main/electron/preload.ts) (Preload API), [`electron/db.ts`](https://github.com/rapabru/offline-disk-caalog/blob/main/electron/db.ts) (Catalog database)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Desktop interface"]
  node_app["Application shell<br/>[App.tsx]"]
  node_auth["Sign-in screen<br/>[AuthPage.tsx]"]
  node_disk_ui["Disk management"]
  node_catalog_ui["Catalog browser<br/>[CatalogView.tsx]"]
  node_search_ui["Search filters"]
  node_classification_ui["Classification views"]
  node_people_ui["People view<br/>[PeopleView.tsx]"]
  node_places_ui["Places view<br/>[PlacesView.tsx]"]
  node_duplicates_ui["Duplicate review<br/>[DuplicatesView.tsx]"]
  node_security_ui["PIN lock<br/>[AppLockModal.tsx]"]
  node_language["Language context"]
end

subgraph group_indexing["Disk indexing"]
  node_indexer["Disk indexer<br/>[indexer.ts]"]
  node_disk_detect["Volume detection<br/>[diskDetector.ts]"]
  node_metadata["Metadata extraction"]
  node_classifier["Tag classifier<br/>[autoClassifier.ts]"]
end

subgraph group_catalog["Catalog and media"]
  node_thumbs["Thumbnail generation"]
  node_db[("Catalog database<br/>[db.ts]")]
  node_duplicates_logic["Duplicate detection<br/>[main.ts]"]
end

subgraph group_organization["Media organization"]
  node_places_logic["Places classification<br/>[PlacesView.tsx]"]
end

subgraph group_runtime["Electron runtime"]
  node_main["IPC handlers<br/>[main.ts]"]
  node_preload["Preload API<br/>[preload.ts]"]
end

node_user(("User"))
node_media["Media files"]

node_user -->|"uses"| node_app
node_app -->|"shows"| node_auth
node_app -->|"renders"| node_disk_ui
node_app -->|"renders"| node_catalog_ui
node_app -->|"renders"| node_search_ui
node_app -->|"renders"| node_classification_ui
node_app -->|"renders"| node_people_ui
node_app -->|"renders"| node_places_ui
node_app -->|"renders"| node_duplicates_ui
node_app -->|"renders"| node_security_ui
node_catalog_ui -->|"requests files"| node_preload
node_search_ui -->|"requests filters"| node_preload
node_people_ui -->|"requests tagged files"| node_preload
node_duplicates_ui -->|"requests duplicate actions"| node_preload
node_disk_ui -->|"disk commands"| node_preload
node_preload -->|"forwards IPC"| node_main
node_main -->|"reads and writes"| node_db
node_main -->|"checks volumes"| node_disk_detect
node_main -->|"hashes files"| node_metadata
node_main -->|"learns fingerprints"| node_classifier
node_main -->|"queries duplicate hashes"| node_duplicates_logic
node_indexer -->|"scans files"| node_media
node_indexer -->|"stores index"| node_db
node_metadata -->|"extracts metadata"| node_media
node_thumbs -->|"generates previews"| node_media
node_catalog_ui -.->|"loads previews"| node_media
node_disk_detect -->|"checks connected drives"| node_media
node_classifier -->|"stores tag learning"| node_db
node_duplicates_logic -->|"reads hashes"| node_db
node_classification_ui -.->|"organizes catalog"| node_db
node_places_ui -.->|"filters GPS media"| node_db
node_app -->|"provides translations"| node_language

click node_app "https://github.com/rapabru/offline-disk-caalog/blob/main/src/App.tsx"
click node_auth "https://github.com/rapabru/offline-disk-caalog/blob/main/src/components/auth/AuthPage.tsx"
click node_disk_ui "https://github.com/rapabru/offline-disk-caalog/tree/main/src/components/disks"
click node_catalog_ui "https://github.com/rapabru/offline-disk-caalog/blob/main/src/components/catalog/CatalogView.tsx"
click node_search_ui "https://github.com/rapabru/offline-disk-caalog/blob/main/src/components/search/SearchFilterView.tsx"
click node_classification_ui "https://github.com/rapabru/offline-disk-caalog/blob/main/src/components/classification/ClassificationView.tsx"
click node_people_ui "https://github.com/rapabru/offline-disk-caalog/blob/main/src/components/people/PeopleView.tsx"
click node_places_ui "https://github.com/rapabru/offline-disk-caalog/blob/main/src/components/places/PlacesView.tsx"
click node_duplicates_ui "https://github.com/rapabru/offline-disk-caalog/blob/main/src/components/duplicates/DuplicatesView.tsx"
click node_security_ui "https://github.com/rapabru/offline-disk-caalog/blob/main/src/components/common/AppLockModal.tsx"
click node_indexer "https://github.com/rapabru/offline-disk-caalog/blob/main/electron/indexer.ts"
click node_disk_detect "https://github.com/rapabru/offline-disk-caalog/blob/main/electron/diskDetector.ts"
click node_metadata "https://github.com/rapabru/offline-disk-caalog/blob/main/electron/metadataExtractor.ts"
click node_classifier "https://github.com/rapabru/offline-disk-caalog/blob/main/electron/autoClassifier.ts"
click node_thumbs "https://github.com/rapabru/offline-disk-caalog/blob/main/electron/thumbnailGenerator.ts"
click node_db "https://github.com/rapabru/offline-disk-caalog/blob/main/electron/db.ts"
click node_main "https://github.com/rapabru/offline-disk-caalog/blob/main/electron/main.ts"
click node_preload "https://github.com/rapabru/offline-disk-caalog/blob/main/electron/preload.ts"
click node_duplicates_logic "https://github.com/rapabru/offline-disk-caalog/blob/main/electron/main.ts"
click node_language "https://github.com/rapabru/offline-disk-caalog/blob/main/src/context/LanguageContext.tsx"
click node_places_logic "https://github.com/rapabru/offline-disk-caalog/blob/main/src/components/places/PlacesView.tsx"

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_auth,node_disk_ui,node_catalog_ui,node_search_ui,node_classification_ui,node_people_ui,node_places_ui,node_duplicates_ui,node_security_ui,node_language,node_user toneBlue
class node_indexer,node_disk_detect,node_metadata,node_classifier toneAmber
class node_thumbs,node_db,node_duplicates_logic toneMint
class node_places_logic toneRose
class node_main,node_preload,node_media toneIndigo
```

## Components

### Desktop interface

- [Application shell](https://github.com/rapabru/offline-disk-caalog/blob/main/src/App.tsx): `src/App.tsx`
- [Sign-in screen](https://github.com/rapabru/offline-disk-caalog/blob/main/src/components/auth/AuthPage.tsx): `src/components/auth/AuthPage.tsx`
- [Disk management](https://github.com/rapabru/offline-disk-caalog/tree/main/src/components/disks): `src/components/disks`
- [Catalog browser](https://github.com/rapabru/offline-disk-caalog/blob/main/src/components/catalog/CatalogView.tsx): `src/components/catalog/CatalogView.tsx`
- [Search filters](https://github.com/rapabru/offline-disk-caalog/blob/main/src/components/search/SearchFilterView.tsx): `src/components/search/SearchFilterView.tsx`
- [Classification views](https://github.com/rapabru/offline-disk-caalog/blob/main/src/components/classification/ClassificationView.tsx): `src/components/classification/ClassificationView.tsx`
- [People view](https://github.com/rapabru/offline-disk-caalog/blob/main/src/components/people/PeopleView.tsx): `src/components/people/PeopleView.tsx`
- [Places view](https://github.com/rapabru/offline-disk-caalog/blob/main/src/components/places/PlacesView.tsx): `src/components/places/PlacesView.tsx`
- [Duplicate review](https://github.com/rapabru/offline-disk-caalog/blob/main/src/components/duplicates/DuplicatesView.tsx): `src/components/duplicates/DuplicatesView.tsx`
- [PIN lock](https://github.com/rapabru/offline-disk-caalog/blob/main/src/components/common/AppLockModal.tsx): `src/components/common/AppLockModal.tsx`
- [Language context](https://github.com/rapabru/offline-disk-caalog/blob/main/src/context/LanguageContext.tsx): `src/context/LanguageContext.tsx`

### Disk indexing

- [Disk indexer](https://github.com/rapabru/offline-disk-caalog/blob/main/electron/indexer.ts): `electron/indexer.ts`
- [Volume detection](https://github.com/rapabru/offline-disk-caalog/blob/main/electron/diskDetector.ts): `electron/diskDetector.ts`
- [Metadata extraction](https://github.com/rapabru/offline-disk-caalog/blob/main/electron/metadataExtractor.ts): `electron/metadataExtractor.ts`
- [Tag classifier](https://github.com/rapabru/offline-disk-caalog/blob/main/electron/autoClassifier.ts): `electron/autoClassifier.ts`

### Catalog and media

- [Thumbnail generation](https://github.com/rapabru/offline-disk-caalog/blob/main/electron/thumbnailGenerator.ts): `electron/thumbnailGenerator.ts`
- [Catalog database](https://github.com/rapabru/offline-disk-caalog/blob/main/electron/db.ts): `electron/db.ts`
- [Duplicate detection](https://github.com/rapabru/offline-disk-caalog/blob/main/electron/main.ts): `electron/main.ts`

### Media organization

- [Places classification](https://github.com/rapabru/offline-disk-caalog/blob/main/src/components/places/PlacesView.tsx): `src/components/places/PlacesView.tsx`

### Electron runtime

- [IPC handlers](https://github.com/rapabru/offline-disk-caalog/blob/main/electron/main.ts): `electron/main.ts`
- [Preload API](https://github.com/rapabru/offline-disk-caalog/blob/main/electron/preload.ts): `electron/preload.ts`

### Other components

- **User**
- **Media files**

## Connections

- User → Application shell: uses
- Application shell → Sign-in screen: shows
- Application shell → Disk management: renders
- Application shell → Catalog browser: renders
- Application shell → Search filters: renders
- Application shell → Classification views: renders
- Application shell → People view: renders
- Application shell → Places view: renders
- Application shell → Duplicate review: renders
- Application shell → PIN lock: renders
- Catalog browser → Preload API: requests files
- Search filters → Preload API: requests filters
- People view → Preload API: requests tagged files
- Duplicate review → Preload API: requests duplicate actions
- Disk management → Preload API: disk commands
- Preload API → IPC handlers: forwards IPC
- IPC handlers → Catalog database: reads and writes
- IPC handlers → Volume detection: checks volumes
- IPC handlers → Metadata extraction: hashes files
- IPC handlers → Tag classifier: learns fingerprints
- IPC handlers → Duplicate detection: queries duplicate hashes
- Disk indexer → Media files: scans files
- Disk indexer → Catalog database: stores index
- Metadata extraction → Media files: extracts metadata
- Thumbnail generation → Media files: generates previews
- Catalog browser → Media files: loads previews
- Volume detection → Media files: checks connected drives
- Tag classifier → Catalog database: stores tag learning
- Duplicate detection → Catalog database: reads hashes
- Classification views → Catalog database: organizes catalog
- Places view → Catalog database: filters GPS media
- Application shell → Language context: provides translations
