# mariglend/kettledesk architecture

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

- Interactive diagram: https://gitdiagram.com/mariglend/kettledesk
- Repository: https://github.com/mariglend/kettledesk

## Overview

Kettledesk is an offline-first Electron desktop app for personal trainers. Trainers manage clients and their appointments, then record attendance, sell packages and track payments; workout programmes and client progress support the ongoing coaching relationship. The UI also provides studio dashboards, statistics, team administration, settings and multilingual formatting. The documented boundary is an encrypted local store with optional Google Calendar sync and folder backups. Sampled source confirms the Electron/preload bridge, local encryption and selected domain behavior; other domain links reflect README capabilities rather than inspected implementations.

Main entry points: [`index.html`](https://github.com/mariglend/kettledesk/blob/main/index.html) (Studio interface), [`js/store.js`](https://github.com/mariglend/kettledesk/blob/main/js/store.js) (Local data access), [`preload.js`](https://github.com/mariglend/kettledesk/blob/main/preload.js) (Electron bridge), [`js/calendar.js`](https://github.com/mariglend/kettledesk/blob/main/js/calendar.js) (Calendar views)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_shell["Desktop shell"]
  node_window["App window<br/>[main.js]"]
  node_interface["Studio interface<br/>[index.html]"]
  node_startup["App startup<br/>[boot.js]"]
  node_shared["Shared UI logic<br/>[core.js]"]
  node_bridge["Electron bridge<br/>[preload.js]"]
end

subgraph group_studio["Studio operations"]
  node_calendar["Calendar views<br/>[calendar.js]"]
  node_events["Event recognition<br/>[events.js]"]
  node_clients["Client records<br/>[clients.js]"]
  node_money["Packages and payments<br/>[money.js]"]
  node_programs["Workout programmes<br/>[programs.js]"]
end

subgraph group_management["Studio oversight"]
  node_dashboard["Dashboard<br/>[dashboard.js]"]
  node_stats["Studio statistics<br/>[stats.js]"]
  node_admin["Team and settings<br/>[admin.js]"]
  node_localization["Language formatting<br/>[i18n.js]"]
end

subgraph group_data["Data and integrations"]
  node_google["Google Calendar adapter<br/>[google.js]"]
  node_store["Local data access<br/>[store.js]"]
  node_securedata[("Encrypted local data<br/>[main.js]")]
end

node_trainer(("Trainer"))
node_googlecal[("Google Calendar")]
node_backup[("Backup folder")]

node_trainer -->|"uses"| node_interface
node_window -->|"loads"| node_interface
node_interface -->|"starts"| node_startup
node_startup -->|"initializes"| node_shared
node_interface -->|"opens calendar"| node_calendar
node_calendar -->|"recognizes appointments"| node_events
node_calendar -->|"syncs events"| node_google
node_google -.->|"reads and updates"| node_googlecal
node_trainer -->|"manages clients"| node_clients
node_trainer -->|"tracks sales"| node_money
node_trainer -->|"creates programmes"| node_programs
node_trainer -->|"reviews studio"| node_dashboard
node_dashboard -->|"opens statistics"| node_stats
node_trainer -->|"manages team"| node_admin
node_interface -->|"formats language"| node_localization
node_clients -->|"reads and saves"| node_store
node_money -->|"reads and saves"| node_store
node_programs -->|"reads and saves"| node_store
node_events -->|"reads and saves"| node_store
node_store -->|"requests storage"| node_bridge
node_admin -->|"requests backup"| node_bridge
node_bridge -->|"invokes IPC"| node_securedata
node_bridge -->|"writes and reads"| node_backup

click node_window "https://github.com/mariglend/kettledesk/blob/main/main.js"
click node_interface "https://github.com/mariglend/kettledesk/blob/main/index.html"
click node_startup "https://github.com/mariglend/kettledesk/blob/main/js/boot.js"
click node_shared "https://github.com/mariglend/kettledesk/blob/main/js/core.js"
click node_bridge "https://github.com/mariglend/kettledesk/blob/main/preload.js"
click node_calendar "https://github.com/mariglend/kettledesk/blob/main/js/calendar.js"
click node_events "https://github.com/mariglend/kettledesk/blob/main/js/events.js"
click node_clients "https://github.com/mariglend/kettledesk/blob/main/js/clients.js"
click node_money "https://github.com/mariglend/kettledesk/blob/main/js/money.js"
click node_programs "https://github.com/mariglend/kettledesk/blob/main/js/programs.js"
click node_dashboard "https://github.com/mariglend/kettledesk/blob/main/js/dashboard.js"
click node_stats "https://github.com/mariglend/kettledesk/blob/main/js/stats.js"
click node_admin "https://github.com/mariglend/kettledesk/blob/main/js/admin.js"
click node_localization "https://github.com/mariglend/kettledesk/blob/main/js/i18n.js"
click node_google "https://github.com/mariglend/kettledesk/blob/main/js/google.js"
click node_store "https://github.com/mariglend/kettledesk/blob/main/js/store.js"
click node_securedata "https://github.com/mariglend/kettledesk/blob/main/main.js"

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_window,node_interface,node_startup,node_shared,node_bridge toneBlue
class node_calendar,node_events,node_clients,node_money,node_programs,node_googlecal,node_backup toneAmber
class node_dashboard,node_stats,node_admin,node_localization toneMint
class node_google,node_store,node_securedata toneRose
class node_trainer toneIndigo
```

## Components

### Desktop shell

- [App window](https://github.com/mariglend/kettledesk/blob/main/main.js): `main.js`
- [Studio interface](https://github.com/mariglend/kettledesk/blob/main/index.html): `index.html`
- [App startup](https://github.com/mariglend/kettledesk/blob/main/js/boot.js): `js/boot.js`
- [Shared UI logic](https://github.com/mariglend/kettledesk/blob/main/js/core.js): `js/core.js`
- [Electron bridge](https://github.com/mariglend/kettledesk/blob/main/preload.js): `preload.js`

### Studio operations

- [Calendar views](https://github.com/mariglend/kettledesk/blob/main/js/calendar.js): `js/calendar.js`
- [Event recognition](https://github.com/mariglend/kettledesk/blob/main/js/events.js): `js/events.js`
- [Client records](https://github.com/mariglend/kettledesk/blob/main/js/clients.js): `js/clients.js`
- [Packages and payments](https://github.com/mariglend/kettledesk/blob/main/js/money.js): `js/money.js`
- [Workout programmes](https://github.com/mariglend/kettledesk/blob/main/js/programs.js): `js/programs.js`

### Studio oversight

- [Dashboard](https://github.com/mariglend/kettledesk/blob/main/js/dashboard.js): `js/dashboard.js`
- [Studio statistics](https://github.com/mariglend/kettledesk/blob/main/js/stats.js): `js/stats.js`
- [Team and settings](https://github.com/mariglend/kettledesk/blob/main/js/admin.js): `js/admin.js`
- [Language formatting](https://github.com/mariglend/kettledesk/blob/main/js/i18n.js): `js/i18n.js`

### Data and integrations

- [Google Calendar adapter](https://github.com/mariglend/kettledesk/blob/main/js/google.js): `js/google.js`
- [Local data access](https://github.com/mariglend/kettledesk/blob/main/js/store.js): `js/store.js`
- [Encrypted local data](https://github.com/mariglend/kettledesk/blob/main/main.js): `main.js`

### Other components

- **Trainer**
- **Google Calendar**
- **Backup folder**

## Connections

- Trainer → Studio interface: uses
- App window → Studio interface: loads
- Studio interface → App startup: starts
- App startup → Shared UI logic: initializes
- Studio interface → Calendar views: opens calendar
- Calendar views → Event recognition: recognizes appointments
- Calendar views → Google Calendar adapter: syncs events
- Google Calendar adapter → Google Calendar: reads and updates
- Trainer → Client records: manages clients
- Trainer → Packages and payments: tracks sales
- Trainer → Workout programmes: creates programmes
- Trainer → Dashboard: reviews studio
- Dashboard → Studio statistics: opens statistics
- Trainer → Team and settings: manages team
- Studio interface → Language formatting: formats language
- Client records → Local data access: reads and saves
- Packages and payments → Local data access: reads and saves
- Workout programmes → Local data access: reads and saves
- Event recognition → Local data access: reads and saves
- Local data access → Electron bridge: requests storage
- Team and settings → Electron bridge: requests backup
- Electron bridge → Encrypted local data: invokes IPC
- Electron bridge → Backup folder: writes and reads
