# slimshanks/classroutinemanager architecture

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

- Interactive diagram: https://gitdiagram.com/slimshanks/classroutinemanager
- Repository: https://github.com/slimshanks/classroutinemanager

## Overview

#### Purpose and executable entry point
Class Routine Manager is a native desktop application for managing class schedules. It is built in C++17 with Qt 6 Widgets and SQLite, with CMake producing the `ClassRoutineManager` executable. Application startup is in `src/main.cpp`; build composition and Qt linkage are defined by `CMakeLists.txt`.

#### Application shell and UI boundary
The main window owns the desktop interaction surface and coordinates user-facing schedule/authentication actions. `src/mainwindow.h` and `src/mainwindow.cpp` form the Qt Widgets presentation boundary, while `resources/styles/main.qss` supplies application-wide Qt stylesheet styling.

#### Authentication stage
`AuthManager` encapsulates authentication-related operations, separating credential/session logic from widgets and schedule management. The UI should invoke this layer rather than directly handling auth persistence or validation. Paths: `src/authmanager.h`, `src/authmanager.cpp`.

#### Database and persistence boundary
`DBManager` is the SQLite access layer. It centralizes database connection, schema/query operations, and persistence concerns so higher-level managers do not depend directly on Qt SQL/SQLite APIs. Paths: `src/dbmanager.h`, `src/dbmanager.cpp`.

#### Routine domain management
`RoutineManager` represents the schedule-focused application/service layer. It mediates routine creation, retrieval, modification, or organization between the main window and database layer. Paths: `src/routinemanager.h`, `src/routinemanager.cpp`.

#### Primary control and data flow
1. `src/main.cpp` initializes the Qt application runtime and creates the main window.
2. `src/mainwindow.cpp` receives desktop UI events and delegates authentication concerns to `AuthManager` and schedule concerns to `RoutineManager`.
3. Manager components use `DBManager` for durable reads/writes.
4. `DBManager` communicates through Qt SQL to the local SQLite database.
5. Returned auth/routine state is presented back through Qt Widgets.

This creates a practical boundary chain: Qt UI → domain/auth managers → database manager → SQLite.

#### Runtime and infrastructure
The application runs as a local Qt 6 Widgets desktop process, not as a web service. Material dependencies are Qt 6 Widgets for UI, Qt SQL for database integration, SQLite for local persistence, and CMake for build generation. Windows bootstrap support is provided by `setup-windows.ps1`; repository styling resources live under `resources/styles/`.

Main entry points: [`src/mainwindow.cpp`](https://github.com/slimshanks/classroutinemanager/blob/main/src/mainwindow.cpp) (Main window), [`src/dbmanager.cpp`](https://github.com/slimshanks/classroutinemanager/blob/main/src/dbmanager.cpp) (DB manager), [`src/main.cpp`](https://github.com/slimshanks/classroutinemanager/blob/main/src/main.cpp) (Application entry), [`CMakeLists.txt`](https://github.com/slimshanks/classroutinemanager/blob/main/CMakeLists.txt) (CMake build)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop Application"]
  node_cmake{{"CMake build<br/>build system<br/>[CMakeLists.txt]"}}
  node_entry["Application entry<br/>Qt startup<br/>[main.cpp]"]
  node_qt["Qt 6 Widgets + SQL<br/>runtime dependency"]
  node_styles["Application stylesheet<br/>Qt stylesheet<br/>[main.qss]"]
  node_windows_setup["Windows bootstrap<br/>setup script<br/>[setup-windows.ps1]"]
end

subgraph group_app["Application Layers"]
  node_window["Main window<br/>Qt Widgets UI<br/>[mainwindow.cpp]"]
  node_window_api["Main window interface<br/>Qt Widgets header<br/>[mainwindow.h]"]
  node_auth["Auth manager<br/>authentication service<br/>[authmanager.cpp]"]
  node_auth_api["Auth manager interface<br/>C++ header<br/>[authmanager.h]"]
  node_routine["Routine manager<br/>schedule service<br/>[routinemanager.cpp]"]
  node_routine_api["Routine manager interface<br/>C++ header<br/>[routinemanager.h]"]
end

subgraph group_persistence["Local Persistence"]
  node_db[("DB manager<br/>SQLite access layer<br/>[dbmanager.cpp]")]
  node_db_api["DB manager interface<br/>C++ header<br/>[dbmanager.h]"]
  node_sqlite[("Local SQLite database<br/>embedded database")]
end

node_cmake -->|"builds executable"| node_entry
node_cmake -->|"links"| node_qt
node_entry -->|"creates"| node_window
node_entry -->|"initializes"| node_qt
node_window_api -.->|"declares"| node_window
node_auth_api -.->|"declares"| node_auth
node_routine_api -.->|"declares"| node_routine
node_db_api -.->|"declares"| node_db
node_window -->|"delegates authentication"| node_auth
node_window -->|"delegates schedule actions"| node_routine
node_window -->|"presents through"| node_qt
node_styles -.->|"styles"| node_window
node_auth -->|"persists and reads"| node_db
node_routine -->|"persists and reads"| node_db
node_db -->|"uses Qt SQL"| node_qt
node_db -->|"reads and writes"| node_sqlite
node_windows_setup -.->|"bootstraps Windows build"| node_cmake

click node_cmake "https://github.com/slimshanks/classroutinemanager/blob/main/CMakeLists.txt"
click node_entry "https://github.com/slimshanks/classroutinemanager/blob/main/src/main.cpp"
click node_window "https://github.com/slimshanks/classroutinemanager/blob/main/src/mainwindow.cpp"
click node_window_api "https://github.com/slimshanks/classroutinemanager/blob/main/src/mainwindow.h"
click node_auth "https://github.com/slimshanks/classroutinemanager/blob/main/src/authmanager.cpp"
click node_auth_api "https://github.com/slimshanks/classroutinemanager/blob/main/src/authmanager.h"
click node_routine "https://github.com/slimshanks/classroutinemanager/blob/main/src/routinemanager.cpp"
click node_routine_api "https://github.com/slimshanks/classroutinemanager/blob/main/src/routinemanager.h"
click node_db "https://github.com/slimshanks/classroutinemanager/blob/main/src/dbmanager.cpp"
click node_db_api "https://github.com/slimshanks/classroutinemanager/blob/main/src/dbmanager.h"
click node_styles "https://github.com/slimshanks/classroutinemanager/blob/main/resources/styles/main.qss"
click node_windows_setup "https://github.com/slimshanks/classroutinemanager/blob/main/setup-windows.ps1"

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_cmake,node_entry,node_qt,node_styles,node_windows_setup toneBlue
class node_window,node_window_api,node_auth,node_auth_api,node_routine,node_routine_api toneAmber
class node_db,node_db_api,node_sqlite toneMint
```

## Components

### Desktop Application

- [CMake build](https://github.com/slimshanks/classroutinemanager/blob/main/CMakeLists.txt): build system · Builds the ClassRoutineManager executable and links Qt. · `CMakeLists.txt`
- [Application entry](https://github.com/slimshanks/classroutinemanager/blob/main/src/main.cpp): Qt startup · Initializes the Qt runtime and creates the main window. · `src/main.cpp`
- **Qt 6 Widgets + SQL**: runtime dependency · Provides the desktop UI runtime and SQL integration.
- [Application stylesheet](https://github.com/slimshanks/classroutinemanager/blob/main/resources/styles/main.qss): Qt stylesheet · `resources/styles/main.qss`
- [Windows bootstrap](https://github.com/slimshanks/classroutinemanager/blob/main/setup-windows.ps1): setup script · `setup-windows.ps1`

### Application Layers

- [Main window](https://github.com/slimshanks/classroutinemanager/blob/main/src/mainwindow.cpp): Qt Widgets UI · Desktop presentation boundary and interaction coordinator. · `src/mainwindow.cpp`
- [Main window interface](https://github.com/slimshanks/classroutinemanager/blob/main/src/mainwindow.h): Qt Widgets header · `src/mainwindow.h`
- [Auth manager](https://github.com/slimshanks/classroutinemanager/blob/main/src/authmanager.cpp): authentication service · Encapsulates credential and session operations. · `src/authmanager.cpp`
- [Auth manager interface](https://github.com/slimshanks/classroutinemanager/blob/main/src/authmanager.h): C++ header · `src/authmanager.h`
- [Routine manager](https://github.com/slimshanks/classroutinemanager/blob/main/src/routinemanager.cpp): schedule service · Mediates schedule creation, retrieval, modification, and organization. · `src/routinemanager.cpp`
- [Routine manager interface](https://github.com/slimshanks/classroutinemanager/blob/main/src/routinemanager.h): C++ header · `src/routinemanager.h`

### Local Persistence

- [DB manager](https://github.com/slimshanks/classroutinemanager/blob/main/src/dbmanager.cpp): SQLite access layer · Centralizes database connection, schema, queries, and persistence. · `src/dbmanager.cpp`
- [DB manager interface](https://github.com/slimshanks/classroutinemanager/blob/main/src/dbmanager.h): C++ header · `src/dbmanager.h`
- **Local SQLite database**: embedded database

## Connections

- CMake build → Application entry: builds executable
- CMake build → Qt 6 Widgets + SQL: links
- Application entry → Main window: creates
- Application entry → Qt 6 Widgets + SQL: initializes
- Main window interface → Main window: declares
- Auth manager interface → Auth manager: declares
- Routine manager interface → Routine manager: declares
- DB manager interface → DB manager: declares
- Main window → Auth manager: delegates authentication
- Main window → Routine manager: delegates schedule actions
- Main window → Qt 6 Widgets + SQL: presents through
- Application stylesheet → Main window: styles
- Auth manager → DB manager: persists and reads
- Routine manager → DB manager: persists and reads
- DB manager → Qt 6 Widgets + SQL: uses Qt SQL
- DB manager → Local SQLite database: reads and writes
- Windows bootstrap → CMake build: bootstraps Windows build
