# erykjj/jwlmanager architecture

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

- Interactive diagram: https://gitdiagram.com/erykjj/jwlmanager
- Repository: https://github.com/erykjj/jwlmanager

## Overview

JWLManager is a desktop application for inspecting and modifying user records in JW Library backup archives. Users open an archive, browse and manage its annotations, bookmarks, favorites, highlights, notes and playlists, then export or import selected data or restore a modified archive in JW Library. The README also documents archive merging, cleanup, note tagging and bulk color changes. The sampled code confirms database queries, export logic and a native merge bridge; unsampled feature links rely on README descriptions rather than inspected implementation.

Main entry points: [`JWLManager.py`](https://github.com/erykjj/jwlmanager/blob/master/JWLManager.py) (Browse records), [`jwlcore.py`](https://github.com/erykjj/jwlmanager/blob/master/jwlcore.py) (Native merge bridge), [`res/ui_main_window.py`](https://github.com/erykjj/jwlmanager/blob/master/res/ui_main_window.py) (Window layout), [`res/ui_extras.py`](https://github.com/erykjj/jwlmanager/blob/master/res/ui_extras.py) (Dialogs and viewers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Desktop interface"]
  node_app["Application window<br/>[JWLManager.py]"]
  node_window_ui["Window layout<br/>[ui_main_window.py]"]
  node_ui_helpers["Dialogs and viewers<br/>[ui_extras.py]"]
end

subgraph group_archive["Archive workflow"]
  node_archive_file["Backup archive"]
  node_archive_open["Open and load<br/>[JWLManager.py]"]
  node_import_export["Import and export<br/>[JWLManager.py]"]
  node_merge["Archive merge<br/>[JWLManager.py]"]
  node_database[("Archive database")]
end

subgraph group_records["Record management"]
  node_record_view["Browse records<br/>[JWLManager.py]"]
  node_annotations["Annotations and notes<br/>[JWLManager.py]"]
  node_bookmarks["Bookmarks and favorites<br/>[JWLManager.py]"]
  node_highlights["Highlights and playlists<br/>[JWLManager.py]"]
  node_record_edit["Edit and delete<br/>[JWLManager.py]"]
  node_tags_colors["Tags and colors<br/>[JWLManager.py]"]
  node_cleanup["Cleanup utilities<br/>[JWLManager.py]"]
end

subgraph group_integration["Core and output"]
  node_core_bridge["Native merge bridge<br/>[jwlcore.py]"]
end

node_user(("User"))
node_jw_library(("JW Library"))

node_user -->|"operates"| node_app
node_app -->|"builds interface"| node_window_ui
node_app -->|"uses dialogs"| node_ui_helpers
node_user -->|"opens backup"| node_archive_open
node_archive_open -->|"loads"| node_archive_file
node_archive_open -->|"queries"| node_database
node_database -->|"provides records"| node_record_view
node_record_view -->|"browses"| node_annotations
node_record_view -->|"browses"| node_bookmarks
node_record_view -->|"browses"| node_highlights
node_user -->|"manages records"| node_record_edit
node_record_edit -->|"updates"| node_database
node_user -->|"tags and recolors"| node_tags_colors
node_tags_colors -->|"updates"| node_database
node_user -->|"cleans records"| node_cleanup
node_cleanup -->|"removes unused data"| node_database
node_user -->|"imports or exports"| node_import_export
node_import_export -->|"reads and writes"| node_database
node_user -->|"merges backups"| node_merge
node_merge -->|"calls merge"| node_core_bridge
node_core_bridge -->|"merges databases"| node_archive_file
node_user -->|"restores modified backup"| node_jw_library

click node_app "https://github.com/erykjj/jwlmanager/blob/master/JWLManager.py"
click node_window_ui "https://github.com/erykjj/jwlmanager/blob/master/res/ui_main_window.py"
click node_ui_helpers "https://github.com/erykjj/jwlmanager/blob/master/res/ui_extras.py"
click node_archive_open "https://github.com/erykjj/jwlmanager/blob/master/JWLManager.py"
click node_record_view "https://github.com/erykjj/jwlmanager/blob/master/JWLManager.py"
click node_annotations "https://github.com/erykjj/jwlmanager/blob/master/JWLManager.py"
click node_bookmarks "https://github.com/erykjj/jwlmanager/blob/master/JWLManager.py"
click node_highlights "https://github.com/erykjj/jwlmanager/blob/master/JWLManager.py"
click node_record_edit "https://github.com/erykjj/jwlmanager/blob/master/JWLManager.py"
click node_tags_colors "https://github.com/erykjj/jwlmanager/blob/master/JWLManager.py"
click node_cleanup "https://github.com/erykjj/jwlmanager/blob/master/JWLManager.py"
click node_import_export "https://github.com/erykjj/jwlmanager/blob/master/JWLManager.py"
click node_merge "https://github.com/erykjj/jwlmanager/blob/master/JWLManager.py"
click node_core_bridge "https://github.com/erykjj/jwlmanager/blob/master/jwlcore.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_window_ui,node_ui_helpers,node_user toneBlue
class node_archive_file,node_archive_open,node_import_export,node_merge,node_database toneAmber
class node_record_view,node_annotations,node_bookmarks,node_highlights,node_record_edit,node_tags_colors,node_cleanup toneMint
class node_core_bridge toneRose
class node_jw_library toneIndigo
```

## Components

### Desktop interface

- [Application window](https://github.com/erykjj/jwlmanager/blob/master/JWLManager.py): `JWLManager.py`
- [Window layout](https://github.com/erykjj/jwlmanager/blob/master/res/ui_main_window.py): `res/ui_main_window.py`
- [Dialogs and viewers](https://github.com/erykjj/jwlmanager/blob/master/res/ui_extras.py): `res/ui_extras.py`

### Archive workflow

- **Backup archive**
- [Open and load](https://github.com/erykjj/jwlmanager/blob/master/JWLManager.py): `JWLManager.py`
- [Import and export](https://github.com/erykjj/jwlmanager/blob/master/JWLManager.py): `JWLManager.py`
- [Archive merge](https://github.com/erykjj/jwlmanager/blob/master/JWLManager.py): `JWLManager.py`
- **Archive database**

### Record management

- [Browse records](https://github.com/erykjj/jwlmanager/blob/master/JWLManager.py): `JWLManager.py`
- [Annotations and notes](https://github.com/erykjj/jwlmanager/blob/master/JWLManager.py): `JWLManager.py`
- [Bookmarks and favorites](https://github.com/erykjj/jwlmanager/blob/master/JWLManager.py): `JWLManager.py`
- [Highlights and playlists](https://github.com/erykjj/jwlmanager/blob/master/JWLManager.py): `JWLManager.py`
- [Edit and delete](https://github.com/erykjj/jwlmanager/blob/master/JWLManager.py): `JWLManager.py`
- [Tags and colors](https://github.com/erykjj/jwlmanager/blob/master/JWLManager.py): `JWLManager.py`
- [Cleanup utilities](https://github.com/erykjj/jwlmanager/blob/master/JWLManager.py): `JWLManager.py`

### Core and output

- [Native merge bridge](https://github.com/erykjj/jwlmanager/blob/master/jwlcore.py): `jwlcore.py`

### Other components

- **User**
- **JW Library**

## Connections

- User → Application window: operates (evidence: `README.md`)
- Application window → Window layout: builds interface (evidence: `JWLManager.py`)
- Application window → Dialogs and viewers: uses dialogs (evidence: `JWLManager.py`)
- User → Open and load: opens backup (evidence: `README.md`)
- Open and load → Backup archive: loads (evidence: `README.md`)
- Open and load → Archive database: queries (evidence: `JWLManager.py`)
- Archive database → Browse records: provides records (evidence: `JWLManager.py`)
- Browse records → Annotations and notes: browses (evidence: `README.md`)
- Browse records → Bookmarks and favorites: browses (evidence: `README.md`)
- Browse records → Highlights and playlists: browses (evidence: `README.md`)
- User → Edit and delete: manages records (evidence: `README.md`)
- Edit and delete → Archive database: updates (evidence: `README.md`)
- User → Tags and colors: tags and recolors (evidence: `README.md`)
- Tags and colors → Archive database: updates (evidence: `README.md`)
- User → Cleanup utilities: cleans records (evidence: `README.md`)
- Cleanup utilities → Archive database: removes unused data (evidence: `README.md`)
- User → Import and export: imports or exports (evidence: `README.md`)
- Import and export → Archive database: reads and writes (evidence: `README.md`)
- User → Archive merge: merges backups (evidence: `README.md`)
- Archive merge → Native merge bridge: calls merge (evidence: `JWLManager.py`)
- Native merge bridge → Backup archive: merges databases (evidence: `jwlcore.py`)
- User → JW Library: restores modified backup (evidence: `README.md`)
