# giano95/qt_aura architecture

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

- Interactive diagram: https://gitdiagram.com/giano95/qt_aura
- Repository: https://github.com/giano95/qt_aura

## Overview

Aura is a Qt/QML coaching app for personal trainers and clients. The main workflow is sign-in or sign-up, role-based routing, then managing or using coaching relationships, training programs, and bookings. QML screens call C++ store singletons; stores apply business rules and persist data through Supabase. The README documents these screen-to-store responsibilities and the backend capabilities. Source excerpts also show shared store behavior, calendar/program/coaching value types, secure saved-login storage, and Realtime updates; unsampled screen internals are represented at their documented subsystem paths.

Main entry points: [`src/stores/storebase.cpp`](https://github.com/giano95/qt_aura/blob/main/src/stores/storebase.cpp) (Shared store behavior), [`src/stores/session.cpp`](https://github.com/giano95/qt_aura/blob/main/src/stores/session.cpp) (Session state), [`qml/screens/coach`](https://github.com/giano95/qt_aura/tree/main/qml/screens/coach) (Coach workspace), [`src/stores/programstore.cpp`](https://github.com/giano95/qt_aura/blob/main/src/stores/programstore.cpp) (Programs and exercises)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App and identity"]
  node_router["Role-based router<br/>[Main.qml]"]
  node_auth_ui["Sign-in and signup"]
  node_session["Session state<br/>[session.cpp]"]
  node_session_storage["Saved login<br/>[sessionstorage.cpp]"]
end

subgraph group_coaching["Coaching relationships"]
  node_coach_ui["Coach workspace"]
  node_client_ui["Client workspace"]
  node_client_store["Clients and assignments<br/>[clientstore.cpp]"]
  node_coach_store["Coach directory and requests<br/>[coachstore.cpp]"]
  node_coaching_model["Coaching rules and types<br/>[coaching.cpp]"]
end

subgraph group_training["Training plans"]
  node_program_ui["Program editor and viewer"]
  node_exercise_ui["Exercise library"]
  node_client_program_ui["Client program view"]
  node_program_store["Programs and exercises<br/>[programstore.cpp]"]
  node_program_model["Program value types<br/>[program.cpp]"]
end

subgraph group_scheduling["Scheduling"]
  node_coach_calendar_ui["Coach calendar"]
  node_client_calendar_ui["Client calendar"]
  node_calendar_store["Hours and bookings<br/>[calendarstore.cpp]"]
  node_calendar_model["Calendar rules and types<br/>[calendar.cpp]"]
end

subgraph group_backend["Backend services"]
  node_storebase["Shared store behavior<br/>[storebase.cpp]"]
  node_supabase["Supabase client<br/>[supabaseclient.cpp]"]
  node_realtime["Live updates<br/>[realtimeclient.cpp]"]
  node_database[("Supabase database")]
end

node_user(("Coach or client"))

node_user -->|"signs in"| node_auth_ui
node_auth_ui -->|"submits credentials"| node_session
node_session -->|"sets signed-in role"| node_router
node_router -->|"opens coach app"| node_coach_ui
node_router -->|"opens client app"| node_client_ui
node_session -->|"saves refresh token"| node_session_storage
node_coach_ui -->|"manages clients"| node_client_store
node_coach_ui -->|"handles requests"| node_coach_store
node_client_ui -->|"finds or requests coach"| node_coach_store
node_client_store -->|"uses coaching rules"| node_coaching_model
node_coach_ui -->|"opens programs"| node_program_ui
node_program_ui -->|"edits programs"| node_program_store
node_exercise_ui -->|"searches exercises"| node_program_store
node_client_program_ui -->|"reads assigned program"| node_program_store
node_program_store -->|"uses program types"| node_program_model
node_coach_ui -->|"opens calendar"| node_coach_calendar_ui
node_client_ui -->|"opens calendar"| node_client_calendar_ui
node_coach_calendar_ui -->|"manages hours and bookings"| node_calendar_store
node_client_calendar_ui -->|"requests sessions"| node_calendar_store
node_calendar_store -->|"uses calendar rules"| node_calendar_model
node_session -->|"authenticates and resumes"| node_supabase
node_session -.->|"starts store lifecycle"| node_storebase
node_client_store -->|"inherits shared behavior"| node_storebase
node_coach_store -->|"inherits shared behavior"| node_storebase
node_program_store -->|"inherits shared behavior"| node_storebase
node_calendar_store -->|"inherits shared behavior"| node_storebase
node_storebase -->|"loads and writes data"| node_supabase
node_supabase -->|"reads and writes"| node_database
node_supabase -->|"feeds change notifications"| node_realtime
node_realtime -->|"notifies changed tables"| node_supabase
node_database -->|"publishes table changes"| node_realtime

click node_router "https://github.com/giano95/qt_aura/blob/main/Main.qml"
click node_auth_ui "https://github.com/giano95/qt_aura/tree/main/qml/screens/auth"
click node_session "https://github.com/giano95/qt_aura/blob/main/src/stores/session.cpp"
click node_session_storage "https://github.com/giano95/qt_aura/blob/main/src/supabase/sessionstorage.cpp"
click node_coach_ui "https://github.com/giano95/qt_aura/tree/main/qml/screens/coach"
click node_client_ui "https://github.com/giano95/qt_aura/tree/main/qml/screens/client"
click node_client_store "https://github.com/giano95/qt_aura/blob/main/src/stores/clientstore.cpp"
click node_coach_store "https://github.com/giano95/qt_aura/blob/main/src/stores/coachstore.cpp"
click node_coaching_model "https://github.com/giano95/qt_aura/blob/main/src/models/coaching.cpp"
click node_program_ui "https://github.com/giano95/qt_aura/tree/main/qml/screens/coach/programs"
click node_exercise_ui "https://github.com/giano95/qt_aura/blob/main/qml/screens/coach/programs/ExerciseLibrary.qml"
click node_client_program_ui "https://github.com/giano95/qt_aura/tree/main/qml/screens/client/program"
click node_program_store "https://github.com/giano95/qt_aura/blob/main/src/stores/programstore.cpp"
click node_program_model "https://github.com/giano95/qt_aura/blob/main/src/models/program.cpp"
click node_coach_calendar_ui "https://github.com/giano95/qt_aura/tree/main/qml/screens/coach/calendar"
click node_client_calendar_ui "https://github.com/giano95/qt_aura/tree/main/qml/screens/client/calendar"
click node_calendar_store "https://github.com/giano95/qt_aura/blob/main/src/stores/calendarstore.cpp"
click node_calendar_model "https://github.com/giano95/qt_aura/blob/main/src/models/calendar.cpp"
click node_storebase "https://github.com/giano95/qt_aura/blob/main/src/stores/storebase.cpp"
click node_supabase "https://github.com/giano95/qt_aura/blob/main/src/supabase/supabaseclient.cpp"
click node_realtime "https://github.com/giano95/qt_aura/blob/main/src/supabase/realtimeclient.cpp"
click node_database "https://github.com/giano95/qt_aura/tree/main/supabase/migrations"

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_router,node_auth_ui,node_session,node_session_storage,node_user toneBlue
class node_coach_ui,node_client_ui,node_client_store,node_coach_store,node_coaching_model toneAmber
class node_program_ui,node_exercise_ui,node_client_program_ui,node_program_store,node_program_model toneMint
class node_coach_calendar_ui,node_client_calendar_ui,node_calendar_store,node_calendar_model toneRose
class node_storebase,node_supabase,node_realtime,node_database toneIndigo
```

## Components

### App and identity

- [Role-based router](https://github.com/giano95/qt_aura/blob/main/Main.qml): `Main.qml`
- [Sign-in and signup](https://github.com/giano95/qt_aura/tree/main/qml/screens/auth): `qml/screens/auth`
- [Session state](https://github.com/giano95/qt_aura/blob/main/src/stores/session.cpp): `src/stores/session.cpp`
- [Saved login](https://github.com/giano95/qt_aura/blob/main/src/supabase/sessionstorage.cpp): `src/supabase/sessionstorage.cpp`

### Coaching relationships

- [Coach workspace](https://github.com/giano95/qt_aura/tree/main/qml/screens/coach): `qml/screens/coach`
- [Client workspace](https://github.com/giano95/qt_aura/tree/main/qml/screens/client): `qml/screens/client`
- [Clients and assignments](https://github.com/giano95/qt_aura/blob/main/src/stores/clientstore.cpp): `src/stores/clientstore.cpp`
- [Coach directory and requests](https://github.com/giano95/qt_aura/blob/main/src/stores/coachstore.cpp): `src/stores/coachstore.cpp`
- [Coaching rules and types](https://github.com/giano95/qt_aura/blob/main/src/models/coaching.cpp): `src/models/coaching.cpp`

### Training plans

- [Program editor and viewer](https://github.com/giano95/qt_aura/tree/main/qml/screens/coach/programs): `qml/screens/coach/programs`
- [Exercise library](https://github.com/giano95/qt_aura/blob/main/qml/screens/coach/programs/ExerciseLibrary.qml): `qml/screens/coach/programs/ExerciseLibrary.qml`
- [Client program view](https://github.com/giano95/qt_aura/tree/main/qml/screens/client/program): `qml/screens/client/program`
- [Programs and exercises](https://github.com/giano95/qt_aura/blob/main/src/stores/programstore.cpp): `src/stores/programstore.cpp`
- [Program value types](https://github.com/giano95/qt_aura/blob/main/src/models/program.cpp): `src/models/program.cpp`

### Scheduling

- [Coach calendar](https://github.com/giano95/qt_aura/tree/main/qml/screens/coach/calendar): `qml/screens/coach/calendar`
- [Client calendar](https://github.com/giano95/qt_aura/tree/main/qml/screens/client/calendar): `qml/screens/client/calendar`
- [Hours and bookings](https://github.com/giano95/qt_aura/blob/main/src/stores/calendarstore.cpp): `src/stores/calendarstore.cpp`
- [Calendar rules and types](https://github.com/giano95/qt_aura/blob/main/src/models/calendar.cpp): `src/models/calendar.cpp`

### Backend services

- [Shared store behavior](https://github.com/giano95/qt_aura/blob/main/src/stores/storebase.cpp): `src/stores/storebase.cpp`
- [Supabase client](https://github.com/giano95/qt_aura/blob/main/src/supabase/supabaseclient.cpp): `src/supabase/supabaseclient.cpp`
- [Live updates](https://github.com/giano95/qt_aura/blob/main/src/supabase/realtimeclient.cpp): `src/supabase/realtimeclient.cpp`
- [Supabase database](https://github.com/giano95/qt_aura/tree/main/supabase/migrations): `supabase/migrations`

### Other components

- **Coach or client**

## Connections

- Coach or client → Sign-in and signup: signs in (evidence: `README.md`)
- Sign-in and signup → Session state: submits credentials (evidence: `README.md`)
- Session state → Role-based router: sets signed-in role (evidence: `README.md`)
- Role-based router → Coach workspace: opens coach app (evidence: `README.md`)
- Role-based router → Client workspace: opens client app (evidence: `README.md`)
- Session state → Saved login: saves refresh token (evidence: `README.md`)
- Coach workspace → Clients and assignments: manages clients (evidence: `README.md`)
- Coach workspace → Coach directory and requests: handles requests (evidence: `README.md`)
- Client workspace → Coach directory and requests: finds or requests coach (evidence: `README.md`)
- Clients and assignments → Coaching rules and types: uses coaching rules
- Coach workspace → Program editor and viewer: opens programs (evidence: `README.md`)
- Program editor and viewer → Programs and exercises: edits programs (evidence: `README.md`)
- Exercise library → Programs and exercises: searches exercises (evidence: `README.md`)
- Client program view → Programs and exercises: reads assigned program (evidence: `README.md`)
- Programs and exercises → Program value types: uses program types
- Coach workspace → Coach calendar: opens calendar (evidence: `README.md`)
- Client workspace → Client calendar: opens calendar (evidence: `README.md`)
- Coach calendar → Hours and bookings: manages hours and bookings (evidence: `README.md`)
- Client calendar → Hours and bookings: requests sessions (evidence: `README.md`)
- Hours and bookings → Calendar rules and types: uses calendar rules
- Session state → Supabase client: authenticates and resumes (evidence: `src/stores/session.cpp`)
- Session state → Shared store behavior: starts store lifecycle
- Clients and assignments → Shared store behavior: inherits shared behavior
- Coach directory and requests → Shared store behavior: inherits shared behavior
- Programs and exercises → Shared store behavior: inherits shared behavior
- Hours and bookings → Shared store behavior: inherits shared behavior
- Shared store behavior → Supabase client: loads and writes data
- Supabase client → Supabase database: reads and writes (evidence: `README.md`)
- Supabase client → Live updates: feeds change notifications
- Live updates → Supabase client: notifies changed tables
- Supabase database → Live updates: publishes table changes
