# omiddadvar/tv-clock-app architecture

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

- Interactive diagram: https://gitdiagram.com/omiddadvar/tv-clock-app
- Repository: https://github.com/omiddadvar/tv-clock-app

## Overview

TvClockApp is a cross-platform MAUI clock with selectable time zones and background colors. A user opens the home screen, which loads saved preferences, refreshes the displayed time and date on a timer, and can navigate to settings to choose and save a location and color. Settings are persisted through MAUI Preferences. The graph includes the documented runtime workflow and the service-registration layer; UI composition and some navigation wiring are not shown in the available excerpts, so those links are omitted.

Main entry points: [`TvClockApp/Infrastructure/Repositories/MauiSettingsRepository.cs`](https://github.com/omiddadvar/tv-clock-app/blob/master/TvClockApp/Infrastructure/Repositories/MauiSettingsRepository.cs) (MAUI settings store), [`TvClockApp/Application/ViewModels/HomeViewModel.cs`](https://github.com/omiddadvar/tv-clock-app/blob/master/TvClockApp/Application/ViewModels/HomeViewModel.cs) (Home view model), [`TvClockApp/Application/ServiceRegisteration.cs`](https://github.com/omiddadvar/tv-clock-app/blob/master/TvClockApp/Application/ServiceRegisteration.cs) (Application registration), [`TvClockApp/Application/ViewModels/SettingsViewModel.cs`](https://github.com/omiddadvar/tv-clock-app/blob/master/TvClockApp/Application/ViewModels/SettingsViewModel.cs) (Settings view model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_presentation["Presentation"]
  node_home["Home page<br/>[HomePage.xaml.cs]"]
  node_settings_page["Settings page"]
end

subgraph group_application["Application"]
  node_home_vm["Home view model<br/>[HomeViewModel.cs]"]
  node_settings_vm["Settings view model"]
  node_clock["Clock service<br/>[ClockService.cs]"]
  node_locations["Location catalog<br/>[LocationCatalog.cs]"]
  node_app_registration["Application registration"]
end

subgraph group_domain["Domain"]
  node_setting["Location setting<br/>[LocationSetting.cs]"]
  node_settings_contract["Settings contract"]
end

subgraph group_infrastructure["Infrastructure"]
  node_repository["MAUI settings store"]
  node_infra_registration["Infrastructure registration"]
end

node_user(("User"))
node_preferences[("MAUI Preferences")]
node_bootstrap["MAUI bootstrap<br/>[MauiProgram.cs]"]

node_user -->|"opens"| node_home
node_user -.->|"chooses settings"| node_settings_page
node_home -->|"loads and starts"| node_home_vm
node_settings_page -->|"binds view model"| node_settings_vm
node_home_vm -->|"reads preferences"| node_settings_contract
node_home_vm -->|"uses default"| node_locations
node_home_vm -->|"formats time"| node_clock
node_clock -->|"resolves time zone"| node_setting
node_settings_vm -->|"loads and saves"| node_settings_contract
node_settings_vm -->|"offers locations"| node_locations
node_settings_contract -->|"uses model"| node_setting
node_repository -->|"implements"| node_settings_contract
node_repository -->|"reads and writes"| node_preferences
node_repository -->|"matches saved location"| node_locations
node_repository -->|"returns location"| node_setting
node_bootstrap -->|"registers services"| node_app_registration
node_bootstrap -->|"registers services"| node_infra_registration
node_infra_registration -->|"registers implementation"| node_repository
node_app_registration -->|"registers service"| node_clock
node_app_registration -->|"registers view model"| node_home_vm
node_app_registration -->|"registers view model"| node_settings_vm

click node_home "https://github.com/omiddadvar/tv-clock-app/blob/master/TvClockApp/Presentation/Pages/HomePage.xaml.cs"
click node_settings_page "https://github.com/omiddadvar/tv-clock-app/blob/master/TvClockApp/Presentation/Pages/SettingsPage.xaml.cs"
click node_home_vm "https://github.com/omiddadvar/tv-clock-app/blob/master/TvClockApp/Application/ViewModels/HomeViewModel.cs"
click node_settings_vm "https://github.com/omiddadvar/tv-clock-app/blob/master/TvClockApp/Application/ViewModels/SettingsViewModel.cs"
click node_clock "https://github.com/omiddadvar/tv-clock-app/blob/master/TvClockApp/Application/Services/ClockService.cs"
click node_locations "https://github.com/omiddadvar/tv-clock-app/blob/master/TvClockApp/Application/Services/LocationCatalog.cs"
click node_setting "https://github.com/omiddadvar/tv-clock-app/blob/master/TvClockApp/Domain/Entities/LocationSetting.cs"
click node_settings_contract "https://github.com/omiddadvar/tv-clock-app/blob/master/TvClockApp/Domain/Interfaces/ISettingsRepository.cs"
click node_repository "https://github.com/omiddadvar/tv-clock-app/blob/master/TvClockApp/Infrastructure/Repositories/MauiSettingsRepository.cs"
click node_bootstrap "https://github.com/omiddadvar/tv-clock-app/blob/master/TvClockApp/MauiProgram.cs"
click node_app_registration "https://github.com/omiddadvar/tv-clock-app/blob/master/TvClockApp/Application/ServiceRegisteration.cs"
click node_infra_registration "https://github.com/omiddadvar/tv-clock-app/blob/master/TvClockApp/Infrastructure/ServiceRegisteration.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_home,node_settings_page,node_user,node_bootstrap toneBlue
class node_home_vm,node_settings_vm,node_clock,node_locations,node_app_registration,node_preferences toneAmber
class node_setting,node_settings_contract toneMint
class node_repository,node_infra_registration toneRose
```

## Components

### Presentation

- [Home page](https://github.com/omiddadvar/tv-clock-app/blob/master/TvClockApp/Presentation/Pages/HomePage.xaml.cs): `TvClockApp/Presentation/Pages/HomePage.xaml.cs`
- [Settings page](https://github.com/omiddadvar/tv-clock-app/blob/master/TvClockApp/Presentation/Pages/SettingsPage.xaml.cs): `TvClockApp/Presentation/Pages/SettingsPage.xaml.cs`

### Application

- [Home view model](https://github.com/omiddadvar/tv-clock-app/blob/master/TvClockApp/Application/ViewModels/HomeViewModel.cs): `TvClockApp/Application/ViewModels/HomeViewModel.cs`
- [Settings view model](https://github.com/omiddadvar/tv-clock-app/blob/master/TvClockApp/Application/ViewModels/SettingsViewModel.cs): `TvClockApp/Application/ViewModels/SettingsViewModel.cs`
- [Clock service](https://github.com/omiddadvar/tv-clock-app/blob/master/TvClockApp/Application/Services/ClockService.cs): `TvClockApp/Application/Services/ClockService.cs`
- [Location catalog](https://github.com/omiddadvar/tv-clock-app/blob/master/TvClockApp/Application/Services/LocationCatalog.cs): `TvClockApp/Application/Services/LocationCatalog.cs`
- [Application registration](https://github.com/omiddadvar/tv-clock-app/blob/master/TvClockApp/Application/ServiceRegisteration.cs): `TvClockApp/Application/ServiceRegisteration.cs`

### Domain

- [Location setting](https://github.com/omiddadvar/tv-clock-app/blob/master/TvClockApp/Domain/Entities/LocationSetting.cs): `TvClockApp/Domain/Entities/LocationSetting.cs`
- [Settings contract](https://github.com/omiddadvar/tv-clock-app/blob/master/TvClockApp/Domain/Interfaces/ISettingsRepository.cs): `TvClockApp/Domain/Interfaces/ISettingsRepository.cs`

### Infrastructure

- [MAUI settings store](https://github.com/omiddadvar/tv-clock-app/blob/master/TvClockApp/Infrastructure/Repositories/MauiSettingsRepository.cs): `TvClockApp/Infrastructure/Repositories/MauiSettingsRepository.cs`
- [Infrastructure registration](https://github.com/omiddadvar/tv-clock-app/blob/master/TvClockApp/Infrastructure/ServiceRegisteration.cs): `TvClockApp/Infrastructure/ServiceRegisteration.cs`

### Other components

- **User**
- **MAUI Preferences**
- [MAUI bootstrap](https://github.com/omiddadvar/tv-clock-app/blob/master/TvClockApp/MauiProgram.cs): `TvClockApp/MauiProgram.cs`

## Connections

- User → Home page: opens
- User → Settings page: chooses settings
- Home page → Home view model: loads and starts (evidence: `TvClockApp/Presentation/Pages/HomePage.xaml.cs`)
- Settings page → Settings view model: binds view model (evidence: `TvClockApp/Presentation/Pages/SettingsPage.xaml.cs`)
- Home view model → Settings contract: reads preferences (evidence: `TvClockApp/Application/ViewModels/HomeViewModel.cs`)
- Home view model → Location catalog: uses default (evidence: `TvClockApp/Application/ViewModels/HomeViewModel.cs`)
- Home view model → Clock service: formats time (evidence: `TvClockApp/Application/ViewModels/HomeViewModel.cs`)
- Clock service → Location setting: resolves time zone (evidence: `TvClockApp/Application/Services/ClockService.cs`)
- Settings view model → Settings contract: loads and saves (evidence: `TvClockApp/Application/ViewModels/SettingsViewModel.cs`)
- Settings view model → Location catalog: offers locations (evidence: `TvClockApp/Application/ViewModels/SettingsViewModel.cs`)
- Settings contract → Location setting: uses model (evidence: `TvClockApp/Domain/Interfaces/ISettingsRepository.cs`)
- MAUI settings store → Settings contract: implements (evidence: `TvClockApp/Infrastructure/Repositories/MauiSettingsRepository.cs`)
- MAUI settings store → MAUI Preferences: reads and writes (evidence: `TvClockApp/Infrastructure/Repositories/MauiSettingsRepository.cs`)
- MAUI settings store → Location catalog: matches saved location (evidence: `TvClockApp/Infrastructure/Repositories/MauiSettingsRepository.cs`)
- MAUI settings store → Location setting: returns location (evidence: `TvClockApp/Infrastructure/Repositories/MauiSettingsRepository.cs`)
- MAUI bootstrap → Application registration: registers services (evidence: `TvClockApp/MauiProgram.cs`)
- MAUI bootstrap → Infrastructure registration: registers services (evidence: `TvClockApp/MauiProgram.cs`)
- Infrastructure registration → MAUI settings store: registers implementation (evidence: `TvClockApp/Infrastructure/ServiceRegisteration.cs`)
- Application registration → Clock service: registers service (evidence: `TvClockApp/Application/ServiceRegisteration.cs`)
- Application registration → Home view model: registers view model (evidence: `TvClockApp/Application/ServiceRegisteration.cs`)
- Application registration → Settings view model: registers view model (evidence: `TvClockApp/Application/ServiceRegisteration.cs`)
