# ginj-capture/ginj architecture

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

- Interactive diagram: https://gitdiagram.com/ginj-capture/ginj
- Repository: https://github.com/ginj-capture/ginj

## Overview

Ginj is a Java desktop screen-capture and recording application centered on a capture → annotate → share workflow. The visible launcher initializes preferences and creates the persistent StarWindow UI; that window references capture selection and history. Annotation tools and undoable overlay actions form a distinct editing stage, while exports have disk, clipboard, and OAuth-backed service implementations. The README documents recording and supported sharing services, but sampled source does not show their full runtime wiring, so those branches are kept separate. Connections below are limited to README statements and relationships visible in the provided source index or excerpts.

Main entry points: [`src/main/java/info/ginj/ui/ExportFrame.java`](https://github.com/ginj-capture/ginj/blob/master/src/main/java/info/ginj/ui/ExportFrame.java) (Export interface), [`src/main/java/info/ginj/ui/StarWindow.java`](https://github.com/ginj-capture/ginj/blob/master/src/main/java/info/ginj/ui/StarWindow.java) (Desktop hub), [`src/main/java/info/ginj/Ginj.java`](https://github.com/ginj-capture/ginj/blob/master/src/main/java/info/ginj/Ginj.java) (App launcher), [`src/main/java/info/ginj/ui/CaptureEditingFrame.java`](https://github.com/ginj-capture/ginj/blob/master/src/main/java/info/ginj/ui/CaptureEditingFrame.java) (Capture editor)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application UI"]
  node_launcher["App launcher<br/>[Ginj.java]"]
  node_star["Desktop hub<br/>[StarWindow.java]"]
  node_history["Capture history<br/>[HistoryFrame.java]"]
end

subgraph group_capture["Capture and editing"]
  node_capture_ui["Capture selection"]
  node_edit_ui["Capture editor"]
  node_overlays["Annotation tools"]
  node_undo["Overlay actions"]
  node_recording["Video recording"]
end

subgraph group_export["Export and sharing"]
  node_export_ui["Export interface<br/>[ExportFrame.java]"]
  node_export_context["Export context<br/>[ExportContext.java]"]
  node_disk["Disk export<br/>[DiskExporter.java]"]
  node_clipboard["Clipboard export"]
  node_oauth["OAuth workflow"]
  node_dropbox["Dropbox export"]
  node_google_drive["Drive export"]
  node_google_photos["Photos export"]
  node_youtube["YouTube export"]
end

subgraph group_state["Models and settings"]
  node_capture_model["Capture data<br/>[Capture.java]"]
  node_prefs[("Preferences<br/>[Prefs.java]")]
  node_accounts["Accounts<br/>[Account.java]"]
  node_history_store[("History files<br/>[Ginj.java]")]
end

node_user(("User"))
node_dropbox_service{{"Dropbox"}}
node_google_service{{"Google services"}}
node_desktop(("Desktop"))

node_user -->|"uses"| node_star
node_launcher -->|"loads"| node_prefs
node_launcher -->|"starts"| node_star
node_star -->|"opens"| node_capture_ui
node_star -->|"opens"| node_history
node_user -->|"selects screen"| node_capture_ui
node_user -->|"annotates"| node_edit_ui
node_edit_ui -.->|"uses tools"| node_overlays
node_edit_ui -.->|"uses actions"| node_undo
node_user -->|"records video"| node_recording
node_user -->|"shares capture"| node_export_ui
node_export_ui -.->|"provides context"| node_export_context
node_export_context -->|"references"| node_star
node_export_ui -.->|"exports to disk"| node_disk
node_export_ui -.->|"copies image"| node_clipboard
node_export_ui -.->|"selects service"| node_dropbox
node_export_ui -.->|"selects service"| node_google_drive
node_export_ui -.->|"selects service"| node_google_photos
node_export_ui -.->|"selects service"| node_youtube
node_dropbox -->|"uses authorization"| node_oauth
node_google_drive -->|"uploads to"| node_google_service
node_google_photos -->|"uploads to"| node_google_service
node_dropbox -->|"uploads to"| node_dropbox_service
node_oauth -->|"creates account"| node_accounts
node_launcher -->|"provides history folder"| node_history_store
node_star -.->|"positions on display"| node_desktop

click node_launcher "https://github.com/ginj-capture/ginj/blob/master/src/main/java/info/ginj/Ginj.java"
click node_star "https://github.com/ginj-capture/ginj/blob/master/src/main/java/info/ginj/ui/StarWindow.java"
click node_capture_ui "https://github.com/ginj-capture/ginj/blob/master/src/main/java/info/ginj/ui/CaptureSelectionFrame.java"
click node_edit_ui "https://github.com/ginj-capture/ginj/blob/master/src/main/java/info/ginj/ui/CaptureEditingFrame.java"
click node_overlays "https://github.com/ginj-capture/ginj/tree/master/src/main/java/info/ginj/tool"
click node_undo "https://github.com/ginj-capture/ginj/tree/master/src/main/java/info/ginj/action"
click node_recording "https://github.com/ginj-capture/ginj/blob/master/src/main/java/info/ginj/ui/VideoControlFrame.java"
click node_history "https://github.com/ginj-capture/ginj/blob/master/src/main/java/info/ginj/ui/HistoryFrame.java"
click node_export_ui "https://github.com/ginj-capture/ginj/blob/master/src/main/java/info/ginj/ui/ExportFrame.java"
click node_export_context "https://github.com/ginj-capture/ginj/blob/master/src/main/java/info/ginj/export/ExportContext.java"
click node_disk "https://github.com/ginj-capture/ginj/blob/master/src/main/java/info/ginj/export/disk/DiskExporter.java"
click node_clipboard "https://github.com/ginj-capture/ginj/blob/master/src/main/java/info/ginj/export/clipboard/ClipboardExporter.java"
click node_oauth "https://github.com/ginj-capture/ginj/blob/master/src/main/java/info/ginj/export/online/AbstractOAuth2Exporter.java"
click node_dropbox "https://github.com/ginj-capture/ginj/blob/master/src/main/java/info/ginj/export/online/dropbox/DropboxExporter.java"
click node_google_drive "https://github.com/ginj-capture/ginj/blob/master/src/main/java/info/ginj/export/online/google/GoogleDriveExporter.java"
click node_google_photos "https://github.com/ginj-capture/ginj/blob/master/src/main/java/info/ginj/export/online/google/GooglePhotosExporter.java"
click node_youtube "https://github.com/ginj-capture/ginj/blob/master/src/main/java/info/ginj/export/online/google/YoutubeExporter.java"
click node_capture_model "https://github.com/ginj-capture/ginj/blob/master/src/main/java/info/ginj/model/Capture.java"
click node_prefs "https://github.com/ginj-capture/ginj/blob/master/src/main/java/info/ginj/model/Prefs.java"
click node_accounts "https://github.com/ginj-capture/ginj/blob/master/src/main/java/info/ginj/model/Account.java"
click node_history_store "https://github.com/ginj-capture/ginj/blob/master/src/main/java/info/ginj/Ginj.java"

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_launcher,node_star,node_history,node_user toneBlue
class node_capture_ui,node_edit_ui,node_overlays,node_undo,node_recording toneAmber
class node_export_ui,node_export_context,node_disk,node_clipboard,node_oauth,node_dropbox,node_google_drive,node_google_photos,node_youtube toneMint
class node_capture_model,node_prefs,node_accounts,node_history_store toneRose
class node_dropbox_service,node_google_service,node_desktop toneIndigo
```

## Components

### Application UI

- [App launcher](https://github.com/ginj-capture/ginj/blob/master/src/main/java/info/ginj/Ginj.java): `src/main/java/info/ginj/Ginj.java`
- [Desktop hub](https://github.com/ginj-capture/ginj/blob/master/src/main/java/info/ginj/ui/StarWindow.java): `src/main/java/info/ginj/ui/StarWindow.java`
- [Capture history](https://github.com/ginj-capture/ginj/blob/master/src/main/java/info/ginj/ui/HistoryFrame.java): `src/main/java/info/ginj/ui/HistoryFrame.java`

### Capture and editing

- [Capture selection](https://github.com/ginj-capture/ginj/blob/master/src/main/java/info/ginj/ui/CaptureSelectionFrame.java): `src/main/java/info/ginj/ui/CaptureSelectionFrame.java`
- [Capture editor](https://github.com/ginj-capture/ginj/blob/master/src/main/java/info/ginj/ui/CaptureEditingFrame.java): `src/main/java/info/ginj/ui/CaptureEditingFrame.java`
- [Annotation tools](https://github.com/ginj-capture/ginj/tree/master/src/main/java/info/ginj/tool): `src/main/java/info/ginj/tool`
- [Overlay actions](https://github.com/ginj-capture/ginj/tree/master/src/main/java/info/ginj/action): `src/main/java/info/ginj/action`
- [Video recording](https://github.com/ginj-capture/ginj/blob/master/src/main/java/info/ginj/ui/VideoControlFrame.java): `src/main/java/info/ginj/ui/VideoControlFrame.java`

### Export and sharing

- [Export interface](https://github.com/ginj-capture/ginj/blob/master/src/main/java/info/ginj/ui/ExportFrame.java): `src/main/java/info/ginj/ui/ExportFrame.java`
- [Export context](https://github.com/ginj-capture/ginj/blob/master/src/main/java/info/ginj/export/ExportContext.java): `src/main/java/info/ginj/export/ExportContext.java`
- [Disk export](https://github.com/ginj-capture/ginj/blob/master/src/main/java/info/ginj/export/disk/DiskExporter.java): `src/main/java/info/ginj/export/disk/DiskExporter.java`
- [Clipboard export](https://github.com/ginj-capture/ginj/blob/master/src/main/java/info/ginj/export/clipboard/ClipboardExporter.java): `src/main/java/info/ginj/export/clipboard/ClipboardExporter.java`
- [OAuth workflow](https://github.com/ginj-capture/ginj/blob/master/src/main/java/info/ginj/export/online/AbstractOAuth2Exporter.java): `src/main/java/info/ginj/export/online/AbstractOAuth2Exporter.java`
- [Dropbox export](https://github.com/ginj-capture/ginj/blob/master/src/main/java/info/ginj/export/online/dropbox/DropboxExporter.java): `src/main/java/info/ginj/export/online/dropbox/DropboxExporter.java`
- [Drive export](https://github.com/ginj-capture/ginj/blob/master/src/main/java/info/ginj/export/online/google/GoogleDriveExporter.java): `src/main/java/info/ginj/export/online/google/GoogleDriveExporter.java`
- [Photos export](https://github.com/ginj-capture/ginj/blob/master/src/main/java/info/ginj/export/online/google/GooglePhotosExporter.java): `src/main/java/info/ginj/export/online/google/GooglePhotosExporter.java`
- [YouTube export](https://github.com/ginj-capture/ginj/blob/master/src/main/java/info/ginj/export/online/google/YoutubeExporter.java): `src/main/java/info/ginj/export/online/google/YoutubeExporter.java`

### Models and settings

- [Capture data](https://github.com/ginj-capture/ginj/blob/master/src/main/java/info/ginj/model/Capture.java): `src/main/java/info/ginj/model/Capture.java`
- [Preferences](https://github.com/ginj-capture/ginj/blob/master/src/main/java/info/ginj/model/Prefs.java): `src/main/java/info/ginj/model/Prefs.java`
- [Accounts](https://github.com/ginj-capture/ginj/blob/master/src/main/java/info/ginj/model/Account.java): `src/main/java/info/ginj/model/Account.java`
- [History files](https://github.com/ginj-capture/ginj/blob/master/src/main/java/info/ginj/Ginj.java): `src/main/java/info/ginj/Ginj.java`

### Other components

- **User**
- **Dropbox**
- **Google services**
- **Desktop**

## Connections

- User → Desktop hub: uses
- App launcher → Preferences: loads (evidence: `src/main/java/info/ginj/Ginj.java`)
- App launcher → Desktop hub: starts (evidence: `src/main/java/info/ginj/Ginj.java`)
- Desktop hub → Capture selection: opens (evidence: `src/main/java/info/ginj/ui/StarWindow.java`)
- Desktop hub → Capture history: opens (evidence: `src/main/java/info/ginj/ui/StarWindow.java`)
- User → Capture selection: selects screen
- User → Capture editor: annotates
- Capture editor → Annotation tools: uses tools (evidence: `src/main/java/info/ginj/tool/Overlay.java`)
- Capture editor → Overlay actions: uses actions
- User → Video recording: records video
- User → Export interface: shares capture
- Export interface → Export context: provides context
- Export context → Desktop hub: references (evidence: `src/main/java/info/ginj/export/ExportContext.java`)
- Export interface → Disk export: exports to disk
- Export interface → Clipboard export: copies image
- Export interface → Dropbox export: selects service
- Export interface → Drive export: selects service
- Export interface → Photos export: selects service
- Export interface → YouTube export: selects service
- Dropbox export → OAuth workflow: uses authorization (evidence: `src/main/java/info/ginj/export/online/dropbox/DropboxExporter.java`)
- Drive export → Google services: uploads to
- Photos export → Google services: uploads to
- Dropbox export → Dropbox: uploads to
- OAuth workflow → Accounts: creates account (evidence: `src/main/java/info/ginj/export/online/AbstractOAuth2Exporter.java`)
- App launcher → History files: provides history folder (evidence: `src/main/java/info/ginj/Ginj.java`)
- Desktop hub → Desktop: positions on display
