# group-13-ltmcb/studyroom-desktop architecture

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

- Interactive diagram: https://gitdiagram.com/group-13-ltmcb/studyroom-desktop
- Repository: https://github.com/group-13-ltmcb/studyroom-desktop

## Overview

StudyRoom is a Windows desktop app for remote group study. The main workflow is sign-in, join or create a study group, then collaborate through a shared Kanban board, synchronized Pomodoro room, chat, and flashcards; dashboard activity is a supporting capability. The graph separates WPF presentation, application behavior, infrastructure, and cloud handlers. Some subsystem links follow README descriptions rather than inspected implementation; unsampled modules are represented only where the tree or documentation supports them.

Main entry points: [`src/StudyRoom.UI/MainWindow.xaml.cs`](https://github.com/group-13-ltmcb/studyroom-desktop/blob/main/src/StudyRoom.UI/MainWindow.xaml.cs) (WPF desktop), [`backend/src/StudyRoom.Backend/Handlers/WebSocketHandlers.cs`](https://github.com/group-13-ltmcb/studyroom-desktop/blob/main/backend/src/StudyRoom.Backend/Handlers/WebSocketHandlers.cs) (Realtime handlers), [`src/StudyRoom.UI/Services/WebSocketRelayService.cs`](https://github.com/group-13-ltmcb/studyroom-desktop/blob/main/src/StudyRoom.UI/Services/WebSocketRelayService.cs) (Realtime relay), [`infra/src/StudyRoomInfra/StudyRoomStack.cs`](https://github.com/group-13-ltmcb/studyroom-desktop/blob/main/infra/src/StudyRoomInfra/StudyRoomStack.cs) (AWS deployment stack)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_presentation["Desktop presentation"]
  node_desktop["WPF desktop<br/>[MainWindow.xaml.cs]"]
  node_login["Sign-in and MFA<br/>[LoginViewModel.cs]"]
  node_groupui["Group navigation"]
  node_dashboard["Study dashboard"]
  node_kanbanui["Kanban board UI"]
  node_pomodoroui["Pomodoro room UI"]
  node_flashcards["Group flashcards"]
end

subgraph group_application["Study workflows"]
  node_pomodoro["Pomodoro engine<br/>[PomodoroEngine.cs]"]
  node_kanban["Kanban service<br/>[KanbanService.cs]"]
  node_dashboarddata["Dashboard service"]
end

subgraph group_infrastructure["Client infrastructure"]
  node_relay["Realtime relay"]
  node_auth["Cognito authentication"]
  node_sessionstore[("Secure session storage")]
  node_socket["WebSocket client<br/>[WebSocketClient.cs]"]
  node_localcache[("Local cache")]
  node_groupsvc["Group management"]
end

subgraph group_cloud["Cloud backend"]
  node_backendgroups["Group API handlers<br/>[GroupHandlers.cs]"]
  node_backendws["Realtime handlers"]
  node_cloudstack["AWS deployment stack<br/>[StudyRoomStack.cs]"]
end

node_student(("Student"))
node_cognito{{"Amazon Cognito"}}
node_apigateway{{"API Gateway WebSocket"}}
node_dynamo[("Amazon DynamoDB")]

node_student -->|"uses"| node_desktop
node_desktop -->|"presents"| node_login
node_login -->|"authenticates"| node_auth
node_auth -->|"calls"| node_cognito
node_login -->|"stores session"| node_sessionstore
node_desktop -->|"presents"| node_groupui
node_groupui -->|"manages groups"| node_groupsvc
node_groupsvc -.->|"uses cloud API"| node_backendgroups
node_groupui -->|"opens"| node_dashboard
node_dashboard -.->|"requests metrics"| node_dashboarddata
node_desktop -->|"presents"| node_kanbanui
node_kanbanui -->|"manages cards"| node_kanban
node_kanban -->|"reads and writes"| node_localcache
node_desktop -->|"presents"| node_pomodoroui
node_pomodoroui -.->|"controls timer"| node_pomodoro
node_desktop -->|"presents"| node_flashcards
node_relay -->|"sends messages"| node_socket
node_relay -->|"syncs state"| node_pomodoro
node_relay -->|"exchanges events"| node_backendws
node_backendws -->|"handles events"| node_apigateway
node_backendgroups -->|"stores group data"| node_dynamo
node_backendws -->|"stores shared state"| node_dynamo
node_cloudstack -->|"configures"| node_backendgroups
node_cloudstack -->|"configures"| node_backendws
node_cloudstack -->|"provisions"| node_apigateway

click node_desktop "https://github.com/group-13-ltmcb/studyroom-desktop/blob/main/src/StudyRoom.UI/MainWindow.xaml.cs"
click node_login "https://github.com/group-13-ltmcb/studyroom-desktop/blob/main/src/StudyRoom.UI/ViewModels/LoginViewModel.cs"
click node_groupui "https://github.com/group-13-ltmcb/studyroom-desktop/blob/main/src/StudyRoom.UI/ViewModels/GroupRailViewModel.cs"
click node_dashboard "https://github.com/group-13-ltmcb/studyroom-desktop/blob/main/src/StudyRoom.UI/ViewModels/DashboardViewModel.cs"
click node_kanbanui "https://github.com/group-13-ltmcb/studyroom-desktop/blob/main/src/StudyRoom.UI/ViewModels/KanbanBoardViewModel.cs"
click node_pomodoroui "https://github.com/group-13-ltmcb/studyroom-desktop/blob/main/src/StudyRoom.UI/ViewModels/PomodoroRoomViewModel.cs"
click node_flashcards "https://github.com/group-13-ltmcb/studyroom-desktop/blob/main/src/StudyRoom.UI/ViewModels/FlashcardViewModel.cs"
click node_relay "https://github.com/group-13-ltmcb/studyroom-desktop/blob/main/src/StudyRoom.UI/Services/WebSocketRelayService.cs"
click node_auth "https://github.com/group-13-ltmcb/studyroom-desktop/blob/main/src/StudyRoom.Infrastructure/Auth/CognitoAuthService.cs"
click node_sessionstore "https://github.com/group-13-ltmcb/studyroom-desktop/blob/main/src/StudyRoom.Infrastructure/Security/DpapiSecureStorageService.cs"
click node_socket "https://github.com/group-13-ltmcb/studyroom-desktop/blob/main/src/StudyRoom.Infrastructure/Network/WebSocketClient.cs"
click node_localcache "https://github.com/group-13-ltmcb/studyroom-desktop/blob/main/src/StudyRoom.Infrastructure/Storage/SqliteLocalCacheRepository.cs"
click node_pomodoro "https://github.com/group-13-ltmcb/studyroom-desktop/blob/main/src/StudyRoom.Application/Engines/PomodoroEngine.cs"
click node_kanban "https://github.com/group-13-ltmcb/studyroom-desktop/blob/main/src/StudyRoom.Application/Services/KanbanService.cs"
click node_groupsvc "https://github.com/group-13-ltmcb/studyroom-desktop/blob/main/src/StudyRoom.Infrastructure/Services/GroupManagementService.cs"
click node_dashboarddata "https://github.com/group-13-ltmcb/studyroom-desktop/blob/main/src/StudyRoom.Application/Services/MockDashboardService.cs"
click node_backendgroups "https://github.com/group-13-ltmcb/studyroom-desktop/blob/main/backend/src/StudyRoom.Backend/Handlers/GroupHandlers.cs"
click node_backendws "https://github.com/group-13-ltmcb/studyroom-desktop/blob/main/backend/src/StudyRoom.Backend/Handlers/WebSocketHandlers.cs"
click node_cloudstack "https://github.com/group-13-ltmcb/studyroom-desktop/blob/main/infra/src/StudyRoomInfra/StudyRoomStack.cs"

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_desktop,node_login,node_groupui,node_dashboard,node_kanbanui,node_pomodoroui,node_flashcards toneBlue
class node_pomodoro,node_kanban,node_dashboarddata,node_dynamo toneAmber
class node_relay,node_auth,node_sessionstore,node_socket,node_localcache,node_groupsvc,node_apigateway toneMint
class node_backendgroups,node_backendws,node_cloudstack toneRose
class node_student,node_cognito toneIndigo
```

## Components

### Desktop presentation

- [WPF desktop](https://github.com/group-13-ltmcb/studyroom-desktop/blob/main/src/StudyRoom.UI/MainWindow.xaml.cs): `src/StudyRoom.UI/MainWindow.xaml.cs`
- [Sign-in and MFA](https://github.com/group-13-ltmcb/studyroom-desktop/blob/main/src/StudyRoom.UI/ViewModels/LoginViewModel.cs): `src/StudyRoom.UI/ViewModels/LoginViewModel.cs`
- [Group navigation](https://github.com/group-13-ltmcb/studyroom-desktop/blob/main/src/StudyRoom.UI/ViewModels/GroupRailViewModel.cs): `src/StudyRoom.UI/ViewModels/GroupRailViewModel.cs`
- [Study dashboard](https://github.com/group-13-ltmcb/studyroom-desktop/blob/main/src/StudyRoom.UI/ViewModels/DashboardViewModel.cs): `src/StudyRoom.UI/ViewModels/DashboardViewModel.cs`
- [Kanban board UI](https://github.com/group-13-ltmcb/studyroom-desktop/blob/main/src/StudyRoom.UI/ViewModels/KanbanBoardViewModel.cs): `src/StudyRoom.UI/ViewModels/KanbanBoardViewModel.cs`
- [Pomodoro room UI](https://github.com/group-13-ltmcb/studyroom-desktop/blob/main/src/StudyRoom.UI/ViewModels/PomodoroRoomViewModel.cs): `src/StudyRoom.UI/ViewModels/PomodoroRoomViewModel.cs`
- [Group flashcards](https://github.com/group-13-ltmcb/studyroom-desktop/blob/main/src/StudyRoom.UI/ViewModels/FlashcardViewModel.cs): `src/StudyRoom.UI/ViewModels/FlashcardViewModel.cs`

### Study workflows

- [Pomodoro engine](https://github.com/group-13-ltmcb/studyroom-desktop/blob/main/src/StudyRoom.Application/Engines/PomodoroEngine.cs): `src/StudyRoom.Application/Engines/PomodoroEngine.cs`
- [Kanban service](https://github.com/group-13-ltmcb/studyroom-desktop/blob/main/src/StudyRoom.Application/Services/KanbanService.cs): `src/StudyRoom.Application/Services/KanbanService.cs`
- [Dashboard service](https://github.com/group-13-ltmcb/studyroom-desktop/blob/main/src/StudyRoom.Application/Services/MockDashboardService.cs): `src/StudyRoom.Application/Services/MockDashboardService.cs`

### Client infrastructure

- [Realtime relay](https://github.com/group-13-ltmcb/studyroom-desktop/blob/main/src/StudyRoom.UI/Services/WebSocketRelayService.cs): `src/StudyRoom.UI/Services/WebSocketRelayService.cs`
- [Cognito authentication](https://github.com/group-13-ltmcb/studyroom-desktop/blob/main/src/StudyRoom.Infrastructure/Auth/CognitoAuthService.cs): `src/StudyRoom.Infrastructure/Auth/CognitoAuthService.cs`
- [Secure session storage](https://github.com/group-13-ltmcb/studyroom-desktop/blob/main/src/StudyRoom.Infrastructure/Security/DpapiSecureStorageService.cs): `src/StudyRoom.Infrastructure/Security/DpapiSecureStorageService.cs`
- [WebSocket client](https://github.com/group-13-ltmcb/studyroom-desktop/blob/main/src/StudyRoom.Infrastructure/Network/WebSocketClient.cs): `src/StudyRoom.Infrastructure/Network/WebSocketClient.cs`
- [Local cache](https://github.com/group-13-ltmcb/studyroom-desktop/blob/main/src/StudyRoom.Infrastructure/Storage/SqliteLocalCacheRepository.cs): `src/StudyRoom.Infrastructure/Storage/SqliteLocalCacheRepository.cs`
- [Group management](https://github.com/group-13-ltmcb/studyroom-desktop/blob/main/src/StudyRoom.Infrastructure/Services/GroupManagementService.cs): `src/StudyRoom.Infrastructure/Services/GroupManagementService.cs`

### Cloud backend

- [Group API handlers](https://github.com/group-13-ltmcb/studyroom-desktop/blob/main/backend/src/StudyRoom.Backend/Handlers/GroupHandlers.cs): `backend/src/StudyRoom.Backend/Handlers/GroupHandlers.cs`
- [Realtime handlers](https://github.com/group-13-ltmcb/studyroom-desktop/blob/main/backend/src/StudyRoom.Backend/Handlers/WebSocketHandlers.cs): `backend/src/StudyRoom.Backend/Handlers/WebSocketHandlers.cs`
- [AWS deployment stack](https://github.com/group-13-ltmcb/studyroom-desktop/blob/main/infra/src/StudyRoomInfra/StudyRoomStack.cs): `infra/src/StudyRoomInfra/StudyRoomStack.cs`

### Other components

- **Student**
- **Amazon Cognito**
- **API Gateway WebSocket**
- **Amazon DynamoDB**

## Connections

- Student → WPF desktop: uses
- WPF desktop → Sign-in and MFA: presents
- Sign-in and MFA → Cognito authentication: authenticates (evidence: `src/StudyRoom.UI/App.xaml.cs`)
- Cognito authentication → Amazon Cognito: calls
- Sign-in and MFA → Secure session storage: stores session (evidence: `src/StudyRoom.UI/App.xaml.cs`)
- WPF desktop → Group navigation: presents
- Group navigation → Group management: manages groups (evidence: `src/StudyRoom.Infrastructure/Services/GroupManagementService.cs`)
- Group management → Group API handlers: uses cloud API
- Group navigation → Study dashboard: opens
- Study dashboard → Dashboard service: requests metrics
- WPF desktop → Kanban board UI: presents
- Kanban board UI → Kanban service: manages cards
- Kanban service → Local cache: reads and writes (evidence: `src/StudyRoom.Application/Services/KanbanService.cs`)
- WPF desktop → Pomodoro room UI: presents
- Pomodoro room UI → Pomodoro engine: controls timer
- WPF desktop → Group flashcards: presents
- Realtime relay → WebSocket client: sends messages (evidence: `src/StudyRoom.UI/Services/WebSocketRelayService.cs`)
- Realtime relay → Pomodoro engine: syncs state (evidence: `src/StudyRoom.UI/Services/WebSocketRelayService.cs`)
- Realtime relay → Realtime handlers: exchanges events
- Realtime handlers → API Gateway WebSocket: handles events
- Group API handlers → Amazon DynamoDB: stores group data
- Realtime handlers → Amazon DynamoDB: stores shared state
- AWS deployment stack → Group API handlers: configures (evidence: `infra/src/StudyRoomInfra/StudyRoomStack.cs`)
- AWS deployment stack → Realtime handlers: configures (evidence: `infra/src/StudyRoomInfra/StudyRoomStack.cs`)
- AWS deployment stack → API Gateway WebSocket: provisions
