# cs250-fall-2026-team-5/roadwatch architecture

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

- Interactive diagram: https://gitdiagram.com/cs250-fall-2026-team-5/roadwatch
- Repository: https://github.com/cs250-fall-2026-team-5/roadwatch

## Overview

RoadWatch is a Kotlin Multiplatform road-hazard reporting app for Android, iOS, and desktop. Users can search maps, view location-oriented UI, and submit hazard reports; the shared app validates and stores reports through a repository abstraction. Device location has a shared service and platform-specific providers, while map rendering also has platform-specific implementations. The desktop entry point selects SQLite persistence; other targets default to in-memory storage. Edges reflect excerpts, SOURCE INDEX references, or README statements; unsampled implementations and their wiring are not inferred.

Main entry points: [`shared/src/commonMain/kotlin/edu/sdsu/cs250/team5/road_watch/App.kt`](https://github.com/cs250-fall-2026-team-5/roadwatch/blob/main/shared/src/commonMain/kotlin/edu/sdsu/cs250/team5/road_watch/App.kt) (Compose app UI), [`shared/src/commonMain/kotlin/edu/sdsu/cs250/team5/road_watch/LocationCoordinates.kt`](https://github.com/cs250-fall-2026-team-5/roadwatch/blob/main/shared/src/commonMain/kotlin/edu/sdsu/cs250/team5/road_watch/LocationCoordinates.kt) (Coordinates), [`desktopApp/src/main/kotlin/edu/sdsu/cs250/team5/road_watch/main.kt`](https://github.com/cs250-fall-2026-team-5/roadwatch/blob/main/desktopApp/src/main/kotlin/edu/sdsu/cs250/team5/road_watch/main.kt) (Desktop entry), [`shared/src/commonMain/kotlin/edu/sdsu/cs250/team5/road_watch/Geolocator.kt`](https://github.com/cs250-fall-2026-team-5/roadwatch/blob/main/shared/src/commonMain/kotlin/edu/sdsu/cs250/team5/road_watch/Geolocator.kt) (Location provider API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["App clients"]
  node_android["Android entry<br/>[MainActivity.kt]"]
  node_ios["iOS entry<br/>[ContentView.swift]"]
  node_desktop["Desktop entry<br/>[main.kt]"]
end

subgraph group_experience["Shared experience"]
  node_app["Compose app UI<br/>[App.kt]"]
end

subgraph group_location["Location and maps"]
  node_viewcontroller["Location view state"]
  node_locationservice["Location service<br/>[LocationService.kt]"]
  node_coordinates["Coordinates"]
  node_geolocator["Location provider API<br/>[Geolocator.kt]"]
  node_androidgeo["Android locator"]
  node_iosgeo["iOS locator<br/>[Geolocator.ios.kt]"]
  node_jvmgeo["JVM locator<br/>[Geolocator.jvm.kt]"]
  node_map["Shared map UI<br/>[map.kt]"]
  node_androidmap["Android map<br/>[map.android.kt]"]
  node_iosmap["iOS map<br/>[map.ios.kt]"]
  node_jvmmap["JVM map<br/>[map.jvm.kt]"]
end

subgraph group_reports["Hazard reports"]
  node_hazard["Hazard model<br/>[Hazard.kt]"]
  node_reporting["Report submission"]
  node_validator["Report validation<br/>[ReportValidator.kt]"]
end

subgraph group_persistence["Persistence"]
  node_repository["Repository interface"]
  node_provider["Repository selection"]
  node_sqlite["SQLite repository"]
  node_db[("SQLite database")]
end

node_person(("App user"))

node_person -->|"uses"| node_android
node_person -->|"uses"| node_ios
node_person -->|"uses"| node_desktop
node_android -->|"starts"| node_app
node_ios -->|"embeds"| node_app
node_desktop -->|"starts"| node_app
node_desktop -->|"sets repository"| node_provider
node_desktop -->|"initializes"| node_sqlite
node_app -->|"uses"| node_provider
node_app -->|"uses"| node_hazard
node_reporting -->|"submits to"| node_repository
node_repository -->|"validates with"| node_validator
node_provider -->|"selects"| node_repository
node_sqlite -->|"implements"| node_repository
node_sqlite -->|"reads and writes"| node_db
node_viewcontroller -->|"fetches location"| node_locationservice
node_locationservice -->|"tracks location"| node_geolocator
node_locationservice -->|"returns"| node_coordinates
node_geolocator -->|"implemented by"| node_androidgeo
node_geolocator -->|"implemented by"| node_iosgeo
node_geolocator -->|"implemented by"| node_jvmgeo
node_map -->|"uses"| node_viewcontroller
node_map -->|"uses"| node_coordinates
node_androidmap -->|"uses"| node_coordinates
node_iosmap -->|"uses"| node_coordinates
node_jvmmap -->|"uses"| node_coordinates

click node_android "https://github.com/cs250-fall-2026-team-5/roadwatch/blob/main/androidApp/src/main/kotlin/edu/sdsu/cs250/team5/road_watch/MainActivity.kt"
click node_ios "https://github.com/cs250-fall-2026-team-5/roadwatch/blob/main/iosApp/iosApp/ContentView.swift"
click node_desktop "https://github.com/cs250-fall-2026-team-5/roadwatch/blob/main/desktopApp/src/main/kotlin/edu/sdsu/cs250/team5/road_watch/main.kt"
click node_app "https://github.com/cs250-fall-2026-team-5/roadwatch/blob/main/shared/src/commonMain/kotlin/edu/sdsu/cs250/team5/road_watch/App.kt"
click node_hazard "https://github.com/cs250-fall-2026-team-5/roadwatch/blob/main/shared/src/commonMain/kotlin/edu/sdsu/cs250/team5/road_watch/Hazard.kt"
click node_reporting "https://github.com/cs250-fall-2026-team-5/roadwatch/blob/main/shared/src/commonMain/kotlin/edu/sdsu/cs250/team5/road_watch/ReportSubmissionController.kt"
click node_validator "https://github.com/cs250-fall-2026-team-5/roadwatch/blob/main/shared/src/commonMain/kotlin/edu/sdsu/cs250/team5/road_watch/ReportValidator.kt"
click node_repository "https://github.com/cs250-fall-2026-team-5/roadwatch/blob/main/shared/src/commonMain/kotlin/edu/sdsu/cs250/team5/road_watch/HazardRepository.kt"
click node_provider "https://github.com/cs250-fall-2026-team-5/roadwatch/blob/main/shared/src/commonMain/kotlin/edu/sdsu/cs250/team5/road_watch/HazardRepositoryProvider.kt"
click node_sqlite "https://github.com/cs250-fall-2026-team-5/roadwatch/blob/main/shared/src/jvmMain/kotlin/edu/sdsu/cs250/team5/road_watch/storage/SqliteHazardRepository.kt"
click node_viewcontroller "https://github.com/cs250-fall-2026-team-5/roadwatch/blob/main/shared/src/commonMain/kotlin/edu/sdsu/cs250/team5/road_watch/MainViewController.kt"
click node_locationservice "https://github.com/cs250-fall-2026-team-5/roadwatch/blob/main/shared/src/commonMain/kotlin/edu/sdsu/cs250/team5/road_watch/LocationService.kt"
click node_coordinates "https://github.com/cs250-fall-2026-team-5/roadwatch/blob/main/shared/src/commonMain/kotlin/edu/sdsu/cs250/team5/road_watch/LocationCoordinates.kt"
click node_geolocator "https://github.com/cs250-fall-2026-team-5/roadwatch/blob/main/shared/src/commonMain/kotlin/edu/sdsu/cs250/team5/road_watch/Geolocator.kt"
click node_androidgeo "https://github.com/cs250-fall-2026-team-5/roadwatch/blob/main/shared/src/androidMain/kotlin/edu/sdsu/cs250/team5/road_watch/Geolocator.android.kt"
click node_iosgeo "https://github.com/cs250-fall-2026-team-5/roadwatch/blob/main/shared/src/iosMain/kotlin/edu/sdsu/cs250/team5/road_watch/Geolocator.ios.kt"
click node_jvmgeo "https://github.com/cs250-fall-2026-team-5/roadwatch/blob/main/shared/src/jvmMain/kotlin/edu/sdsu/cs250/team5/road_watch/Geolocator.jvm.kt"
click node_map "https://github.com/cs250-fall-2026-team-5/roadwatch/blob/main/shared/src/commonMain/kotlin/edu/sdsu/cs250/team5/road_watch/map.kt"
click node_androidmap "https://github.com/cs250-fall-2026-team-5/roadwatch/blob/main/shared/src/androidMain/kotlin/edu/sdsu/cs250/team5/road_watch/map.android.kt"
click node_iosmap "https://github.com/cs250-fall-2026-team-5/roadwatch/blob/main/shared/src/iosMain/kotlin/edu/sdsu/cs250/team5/road_watch/map.ios.kt"
click node_jvmmap "https://github.com/cs250-fall-2026-team-5/roadwatch/blob/main/shared/src/jvmMain/kotlin/edu/sdsu/cs250/team5/road_watch/map.jvm.kt"

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_android,node_ios,node_desktop,node_person toneBlue
class node_app toneAmber
class node_viewcontroller,node_locationservice,node_coordinates,node_geolocator,node_androidgeo,node_iosgeo,node_jvmgeo,node_map,node_androidmap,node_iosmap,node_jvmmap toneMint
class node_hazard,node_reporting,node_validator toneRose
class node_repository,node_provider,node_sqlite,node_db toneIndigo
```

## Components

### App clients

- [Android entry](https://github.com/cs250-fall-2026-team-5/roadwatch/blob/main/androidApp/src/main/kotlin/edu/sdsu/cs250/team5/road_watch/MainActivity.kt): `androidApp/src/main/kotlin/edu/sdsu/cs250/team5/road_watch/MainActivity.kt`
- [iOS entry](https://github.com/cs250-fall-2026-team-5/roadwatch/blob/main/iosApp/iosApp/ContentView.swift): `iosApp/iosApp/ContentView.swift`
- [Desktop entry](https://github.com/cs250-fall-2026-team-5/roadwatch/blob/main/desktopApp/src/main/kotlin/edu/sdsu/cs250/team5/road_watch/main.kt): `desktopApp/src/main/kotlin/edu/sdsu/cs250/team5/road_watch/main.kt`

### Shared experience

- [Compose app UI](https://github.com/cs250-fall-2026-team-5/roadwatch/blob/main/shared/src/commonMain/kotlin/edu/sdsu/cs250/team5/road_watch/App.kt): `shared/src/commonMain/kotlin/edu/sdsu/cs250/team5/road_watch/App.kt`

### Location and maps

- [Location view state](https://github.com/cs250-fall-2026-team-5/roadwatch/blob/main/shared/src/commonMain/kotlin/edu/sdsu/cs250/team5/road_watch/MainViewController.kt): `shared/src/commonMain/kotlin/edu/sdsu/cs250/team5/road_watch/MainViewController.kt`
- [Location service](https://github.com/cs250-fall-2026-team-5/roadwatch/blob/main/shared/src/commonMain/kotlin/edu/sdsu/cs250/team5/road_watch/LocationService.kt): `shared/src/commonMain/kotlin/edu/sdsu/cs250/team5/road_watch/LocationService.kt`
- [Coordinates](https://github.com/cs250-fall-2026-team-5/roadwatch/blob/main/shared/src/commonMain/kotlin/edu/sdsu/cs250/team5/road_watch/LocationCoordinates.kt): `shared/src/commonMain/kotlin/edu/sdsu/cs250/team5/road_watch/LocationCoordinates.kt`
- [Location provider API](https://github.com/cs250-fall-2026-team-5/roadwatch/blob/main/shared/src/commonMain/kotlin/edu/sdsu/cs250/team5/road_watch/Geolocator.kt): `shared/src/commonMain/kotlin/edu/sdsu/cs250/team5/road_watch/Geolocator.kt`
- [Android locator](https://github.com/cs250-fall-2026-team-5/roadwatch/blob/main/shared/src/androidMain/kotlin/edu/sdsu/cs250/team5/road_watch/Geolocator.android.kt): `shared/src/androidMain/kotlin/edu/sdsu/cs250/team5/road_watch/Geolocator.android.kt`
- [iOS locator](https://github.com/cs250-fall-2026-team-5/roadwatch/blob/main/shared/src/iosMain/kotlin/edu/sdsu/cs250/team5/road_watch/Geolocator.ios.kt): `shared/src/iosMain/kotlin/edu/sdsu/cs250/team5/road_watch/Geolocator.ios.kt`
- [JVM locator](https://github.com/cs250-fall-2026-team-5/roadwatch/blob/main/shared/src/jvmMain/kotlin/edu/sdsu/cs250/team5/road_watch/Geolocator.jvm.kt): `shared/src/jvmMain/kotlin/edu/sdsu/cs250/team5/road_watch/Geolocator.jvm.kt`
- [Shared map UI](https://github.com/cs250-fall-2026-team-5/roadwatch/blob/main/shared/src/commonMain/kotlin/edu/sdsu/cs250/team5/road_watch/map.kt): `shared/src/commonMain/kotlin/edu/sdsu/cs250/team5/road_watch/map.kt`
- [Android map](https://github.com/cs250-fall-2026-team-5/roadwatch/blob/main/shared/src/androidMain/kotlin/edu/sdsu/cs250/team5/road_watch/map.android.kt): `shared/src/androidMain/kotlin/edu/sdsu/cs250/team5/road_watch/map.android.kt`
- [iOS map](https://github.com/cs250-fall-2026-team-5/roadwatch/blob/main/shared/src/iosMain/kotlin/edu/sdsu/cs250/team5/road_watch/map.ios.kt): `shared/src/iosMain/kotlin/edu/sdsu/cs250/team5/road_watch/map.ios.kt`
- [JVM map](https://github.com/cs250-fall-2026-team-5/roadwatch/blob/main/shared/src/jvmMain/kotlin/edu/sdsu/cs250/team5/road_watch/map.jvm.kt): `shared/src/jvmMain/kotlin/edu/sdsu/cs250/team5/road_watch/map.jvm.kt`

### Hazard reports

- [Hazard model](https://github.com/cs250-fall-2026-team-5/roadwatch/blob/main/shared/src/commonMain/kotlin/edu/sdsu/cs250/team5/road_watch/Hazard.kt): `shared/src/commonMain/kotlin/edu/sdsu/cs250/team5/road_watch/Hazard.kt`
- [Report submission](https://github.com/cs250-fall-2026-team-5/roadwatch/blob/main/shared/src/commonMain/kotlin/edu/sdsu/cs250/team5/road_watch/ReportSubmissionController.kt): `shared/src/commonMain/kotlin/edu/sdsu/cs250/team5/road_watch/ReportSubmissionController.kt`
- [Report validation](https://github.com/cs250-fall-2026-team-5/roadwatch/blob/main/shared/src/commonMain/kotlin/edu/sdsu/cs250/team5/road_watch/ReportValidator.kt): `shared/src/commonMain/kotlin/edu/sdsu/cs250/team5/road_watch/ReportValidator.kt`

### Persistence

- [Repository interface](https://github.com/cs250-fall-2026-team-5/roadwatch/blob/main/shared/src/commonMain/kotlin/edu/sdsu/cs250/team5/road_watch/HazardRepository.kt): `shared/src/commonMain/kotlin/edu/sdsu/cs250/team5/road_watch/HazardRepository.kt`
- [Repository selection](https://github.com/cs250-fall-2026-team-5/roadwatch/blob/main/shared/src/commonMain/kotlin/edu/sdsu/cs250/team5/road_watch/HazardRepositoryProvider.kt): `shared/src/commonMain/kotlin/edu/sdsu/cs250/team5/road_watch/HazardRepositoryProvider.kt`
- [SQLite repository](https://github.com/cs250-fall-2026-team-5/roadwatch/blob/main/shared/src/jvmMain/kotlin/edu/sdsu/cs250/team5/road_watch/storage/SqliteHazardRepository.kt): `shared/src/jvmMain/kotlin/edu/sdsu/cs250/team5/road_watch/storage/SqliteHazardRepository.kt`
- **SQLite database**

### Other components

- **App user**

## Connections

- App user → Android entry: uses
- App user → iOS entry: uses
- App user → Desktop entry: uses
- Android entry → Compose app UI: starts (evidence: `androidApp/src/main/kotlin/edu/sdsu/cs250/team5/road_watch/MainActivity.kt`)
- iOS entry → Compose app UI: embeds (evidence: `iosApp/iosApp/ContentView.swift`)
- Desktop entry → Compose app UI: starts (evidence: `desktopApp/src/main/kotlin/edu/sdsu/cs250/team5/road_watch/main.kt`)
- Desktop entry → Repository selection: sets repository (evidence: `desktopApp/src/main/kotlin/edu/sdsu/cs250/team5/road_watch/main.kt`)
- Desktop entry → SQLite repository: initializes (evidence: `desktopApp/src/main/kotlin/edu/sdsu/cs250/team5/road_watch/main.kt`)
- Compose app UI → Repository selection: uses (evidence: `shared/src/commonMain/kotlin/edu/sdsu/cs250/team5/road_watch/App.kt`)
- Compose app UI → Hazard model: uses (evidence: `shared/src/commonMain/kotlin/edu/sdsu/cs250/team5/road_watch/App.kt`)
- Report submission → Repository interface: submits to (evidence: `shared/src/commonMain/kotlin/edu/sdsu/cs250/team5/road_watch/ReportSubmissionController.kt`)
- Repository interface → Report validation: validates with (evidence: `shared/src/commonMain/kotlin/edu/sdsu/cs250/team5/road_watch/HazardRepository.kt`)
- Repository selection → Repository interface: selects (evidence: `shared/src/commonMain/kotlin/edu/sdsu/cs250/team5/road_watch/HazardRepositoryProvider.kt`)
- SQLite repository → Repository interface: implements (evidence: `shared/src/jvmMain/kotlin/edu/sdsu/cs250/team5/road_watch/storage/SqliteHazardRepository.kt`)
- SQLite repository → SQLite database: reads and writes (evidence: `shared/src/jvmMain/kotlin/edu/sdsu/cs250/team5/road_watch/storage/SqliteHazardRepository.kt`)
- Location view state → Location service: fetches location (evidence: `shared/src/commonMain/kotlin/edu/sdsu/cs250/team5/road_watch/MainViewController.kt`)
- Location service → Location provider API: tracks location (evidence: `shared/src/commonMain/kotlin/edu/sdsu/cs250/team5/road_watch/LocationService.kt`)
- Location service → Coordinates: returns (evidence: `shared/src/commonMain/kotlin/edu/sdsu/cs250/team5/road_watch/LocationService.kt`)
- Location provider API → Android locator: implemented by (evidence: `shared/src/androidMain/kotlin/edu/sdsu/cs250/team5/road_watch/Geolocator.android.kt`)
- Location provider API → iOS locator: implemented by (evidence: `shared/src/iosMain/kotlin/edu/sdsu/cs250/team5/road_watch/Geolocator.ios.kt`)
- Location provider API → JVM locator: implemented by (evidence: `shared/src/jvmMain/kotlin/edu/sdsu/cs250/team5/road_watch/Geolocator.jvm.kt`)
- Shared map UI → Location view state: uses (evidence: `shared/src/commonMain/kotlin/edu/sdsu/cs250/team5/road_watch/map.kt`)
- Shared map UI → Coordinates: uses (evidence: `shared/src/commonMain/kotlin/edu/sdsu/cs250/team5/road_watch/map.kt`)
- Android map → Coordinates: uses (evidence: `shared/src/androidMain/kotlin/edu/sdsu/cs250/team5/road_watch/map.android.kt`)
- iOS map → Coordinates: uses (evidence: `shared/src/iosMain/kotlin/edu/sdsu/cs250/team5/road_watch/map.ios.kt`)
- JVM map → Coordinates: uses (evidence: `shared/src/jvmMain/kotlin/edu/sdsu/cs250/team5/road_watch/map.jvm.kt`)
