# notokta/hightex-desktop architecture

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

- Interactive diagram: https://gitdiagram.com/notokta/hightex-desktop
- Repository: https://github.com/notokta/hightex-desktop

## Overview

HighTex Desktop is an offline-first desktop thesis editor. Users create or open local documents, edit structured chapters, and generate formatted PDFs in a browser-based compilation pipeline; workspace, profile, and configuration features support managing work locally. Separate capabilities include local-network document sharing, citation and lecturer tools, forms, document scanning, and account-backed cloud features. The graph combines documented product capabilities with sampled runtime relationships; unsampled subsystems are linked only where the README establishes the relationship.

Main entry points: [`src/App.tsx`](https://github.com/notokta/hightex-desktop/blob/main/src/App.tsx) (Application routes), [`electron/main/application.ts`](https://github.com/notokta/hightex-desktop/blob/main/electron/main/application.ts) (Application host), [`electron/service/auth-service.ts`](https://github.com/notokta/hightex-desktop/blob/main/electron/service/auth-service.ts) (Browser authentication), [`src/pages/editor.tsx`](https://github.com/notokta/hightex-desktop/blob/main/src/pages/editor.tsx) (Thesis editor)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop runtime"]
  node_app["Application host<br/>[application.ts]"]
  node_workspace["Workspace management"]
  node_ui["Application routes<br/>[App.tsx]"]
end

subgraph group_authoring["Thesis authoring"]
  node_localdocs["Local documents<br/>[local.tsx]"]
  node_editor["Thesis editor<br/>[editor.tsx]"]
  node_editorstorage[("Editor document storage<br/>[hightex-db.ts]")]
  node_citation["Citation tools<br/>[citation.tsx]"]
  node_lecturers["Lecturer directory"]
  node_forms["Academic forms<br/>[forms.tsx]"]
end

subgraph group_output["Document output"]
  node_compiler["PDF compilation<br/>[engine-pipeline.ts]"]
  node_print["Print views<br/>[index.tsx]"]
  node_scanner["Document validation"]
end

subgraph group_collaboration["Sharing and review"]
  node_sharing["Local network sharing"]
  node_review["Submission review<br/>[review.tsx]"]
  node_snapshots["Snapshot viewing"]
end

subgraph group_account["Accounts and data"]
  node_session[("Session management<br/>[session-service.ts]")]
  node_auth["Browser authentication<br/>[auth-service.ts]"]
  node_authclient["Authentication client<br/>[auth-client.ts]"]
  node_cloud["Cloud data services"]
end

node_user(("Desktop user"))

node_user -->|"uses"| node_app
node_app -->|"registers handlers"| node_workspace
node_app -.->|"opens desktop UI"| node_ui
node_user -->|"navigates"| node_ui
node_ui -->|"routes to"| node_localdocs
node_ui -->|"routes to"| node_editor
node_ui -->|"routes to"| node_citation
node_ui -->|"routes to"| node_forms
node_editor -.->|"stores document data"| node_editorstorage
node_compiler -->|"warms storage"| node_editorstorage
node_user -.->|"generates PDF"| node_compiler
node_ui -->|"routes to"| node_print
node_user -->|"validates document"| node_scanner
node_user -->|"shares on local network"| node_sharing
node_ui -->|"routes to"| node_review
node_user -.->|"views snapshots"| node_snapshots
node_user -.->|"signs in"| node_auth
node_auth -->|"configures"| node_authclient
node_authclient -->|"reads session"| node_session
node_auth -.->|"requests account data"| node_cloud
node_user -->|"manages directory"| node_lecturers

click node_app "https://github.com/notokta/hightex-desktop/blob/main/electron/main/application.ts"
click node_workspace "https://github.com/notokta/hightex-desktop/tree/main/electron/workspaces"
click node_ui "https://github.com/notokta/hightex-desktop/blob/main/src/App.tsx"
click node_localdocs "https://github.com/notokta/hightex-desktop/blob/main/src/pages/local.tsx"
click node_editor "https://github.com/notokta/hightex-desktop/blob/main/src/pages/editor.tsx"
click node_editorstorage "https://github.com/notokta/hightex-desktop/blob/main/src/editor/storage/hightex-db.ts"
click node_citation "https://github.com/notokta/hightex-desktop/blob/main/src/pages/citation.tsx"
click node_lecturers "https://github.com/notokta/hightex-desktop/blob/main/src/components/lecturer-directory-manager.tsx"
click node_forms "https://github.com/notokta/hightex-desktop/blob/main/src/pages/forms.tsx"
click node_compiler "https://github.com/notokta/hightex-desktop/blob/main/src/compiler/engine/engine-pipeline.ts"
click node_print "https://github.com/notokta/hightex-desktop/blob/main/src/components/printable/index.tsx"
click node_scanner "https://github.com/notokta/hightex-desktop/tree/main/src/scanner"
click node_sharing "https://github.com/notokta/hightex-desktop/tree/main/electron/server/sharing-server"
click node_review "https://github.com/notokta/hightex-desktop/blob/main/src/pages/review.tsx"
click node_snapshots "https://github.com/notokta/hightex-desktop/blob/main/src/pages/snapshot-viewer.tsx"
click node_session "https://github.com/notokta/hightex-desktop/blob/main/electron/service/session-service.ts"
click node_auth "https://github.com/notokta/hightex-desktop/blob/main/electron/service/auth-service.ts"
click node_authclient "https://github.com/notokta/hightex-desktop/blob/main/electron/clients/auth-client.ts"
click node_cloud "https://github.com/notokta/hightex-desktop/tree/main/electron/clients"

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_workspace,node_ui,node_user toneBlue
class node_localdocs,node_editor,node_editorstorage,node_citation,node_lecturers,node_forms toneAmber
class node_compiler,node_print,node_scanner toneMint
class node_sharing,node_review,node_snapshots toneRose
class node_session,node_auth,node_authclient,node_cloud toneIndigo
```

## Components

### Desktop runtime

- [Application host](https://github.com/notokta/hightex-desktop/blob/main/electron/main/application.ts): `electron/main/application.ts`
- [Workspace management](https://github.com/notokta/hightex-desktop/tree/main/electron/workspaces): `electron/workspaces`
- [Application routes](https://github.com/notokta/hightex-desktop/blob/main/src/App.tsx): `src/App.tsx`

### Thesis authoring

- [Local documents](https://github.com/notokta/hightex-desktop/blob/main/src/pages/local.tsx): `src/pages/local.tsx`
- [Thesis editor](https://github.com/notokta/hightex-desktop/blob/main/src/pages/editor.tsx): `src/pages/editor.tsx`
- [Editor document storage](https://github.com/notokta/hightex-desktop/blob/main/src/editor/storage/hightex-db.ts): `src/editor/storage/hightex-db.ts`
- [Citation tools](https://github.com/notokta/hightex-desktop/blob/main/src/pages/citation.tsx): `src/pages/citation.tsx`
- [Lecturer directory](https://github.com/notokta/hightex-desktop/blob/main/src/components/lecturer-directory-manager.tsx): `src/components/lecturer-directory-manager.tsx`
- [Academic forms](https://github.com/notokta/hightex-desktop/blob/main/src/pages/forms.tsx): `src/pages/forms.tsx`

### Document output

- [PDF compilation](https://github.com/notokta/hightex-desktop/blob/main/src/compiler/engine/engine-pipeline.ts): `src/compiler/engine/engine-pipeline.ts`
- [Print views](https://github.com/notokta/hightex-desktop/blob/main/src/components/printable/index.tsx): `src/components/printable/index.tsx`
- [Document validation](https://github.com/notokta/hightex-desktop/tree/main/src/scanner): `src/scanner`

### Sharing and review

- [Local network sharing](https://github.com/notokta/hightex-desktop/tree/main/electron/server/sharing-server): `electron/server/sharing-server`
- [Submission review](https://github.com/notokta/hightex-desktop/blob/main/src/pages/review.tsx): `src/pages/review.tsx`
- [Snapshot viewing](https://github.com/notokta/hightex-desktop/blob/main/src/pages/snapshot-viewer.tsx): `src/pages/snapshot-viewer.tsx`

### Accounts and data

- [Session management](https://github.com/notokta/hightex-desktop/blob/main/electron/service/session-service.ts): `electron/service/session-service.ts`
- [Browser authentication](https://github.com/notokta/hightex-desktop/blob/main/electron/service/auth-service.ts): `electron/service/auth-service.ts`
- [Authentication client](https://github.com/notokta/hightex-desktop/blob/main/electron/clients/auth-client.ts): `electron/clients/auth-client.ts`
- [Cloud data services](https://github.com/notokta/hightex-desktop/tree/main/electron/clients): `electron/clients`

### Other components

- **Desktop user**

## Connections

- Desktop user → Application host: uses (evidence: `README.md`)
- Application host → Workspace management: registers handlers (evidence: `electron/main/application.ts`)
- Application host → Application routes: opens desktop UI
- Desktop user → Application routes: navigates (evidence: `src/App.tsx`)
- Application routes → Local documents: routes to (evidence: `src/App.tsx`)
- Application routes → Thesis editor: routes to (evidence: `src/App.tsx`)
- Application routes → Citation tools: routes to (evidence: `src/App.tsx`)
- Application routes → Academic forms: routes to (evidence: `src/App.tsx`)
- Thesis editor → Editor document storage: stores document data
- PDF compilation → Editor document storage: warms storage (evidence: `src/compiler/engine/engine-pipeline.ts`)
- Desktop user → PDF compilation: generates PDF
- Application routes → Print views: routes to (evidence: `src/App.tsx`)
- Desktop user → Document validation: validates document (evidence: `README.md`)
- Desktop user → Local network sharing: shares on local network (evidence: `README.md`)
- Application routes → Submission review: routes to (evidence: `src/App.tsx`)
- Desktop user → Snapshot viewing: views snapshots
- Desktop user → Browser authentication: signs in
- Browser authentication → Authentication client: configures (evidence: `electron/service/auth-service.ts`)
- Authentication client → Session management: reads session (evidence: `electron/service/auth-service.ts`)
- Browser authentication → Cloud data services: requests account data (evidence: `electron/service/auth-service.ts`)
- Desktop user → Lecturer directory: manages directory (evidence: `README.md`)
