# thowdan/sffs-graduation-project- architecture

> Architecture diagram of the GitHub repository thowdan/sffs-graduation-project-, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/thowdan/sffs-graduation-project-
- Repository: https://github.com/thowdan/sffs-graduation-project-
- Video tour (about a minute): https://gitdiagram.com/thowdan/sffs-graduation-project-/video

## Overview

RoboFireFighter is a cross-platform Flutter app for monitoring and controlling a firefighting robot. The primary workflow is that the dashboard requests sensor updates, the sensor service polls and parses responses into typed readings, and the UI displays live status and history. Users can also authenticate, inspect devices and maps, view camera feeds, and deploy or control the robot. The README documents the service-locator wiring and reactive streams; sampled source did not include Dart implementation, so uncertain screen-to-service links are omitted.

Main entry points: [`lib/services/sensor_service.dart`](https://github.com/thowdan/sffs-graduation-project-/blob/main/lib/services/sensor_service.dart) (Sensor polling), [`lib/services/robot_service.dart`](https://github.com/thowdan/sffs-graduation-project-/blob/main/lib/services/robot_service.dart) (Robot commands), [`lib/screens/dashboard_screen.dart`](https://github.com/thowdan/sffs-graduation-project-/blob/main/lib/screens/dashboard_screen.dart) (Dashboard), [`lib/config/service_locator.dart`](https://github.com/thowdan/sffs-graduation-project-/blob/main/lib/config/service_locator.dart) (Service locator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["User interface"]
  node_dashboard["Dashboard"]
  node_sensor_views["Sensor views"]
  node_history_view["History view"]
  node_auth_views["Auth screens<br/>[login_screen.dart]"]
  node_robot_views["Robot controls"]
  node_camera_widget["Camera feed"]
end

subgraph group_runtime["Domain and services"]
  node_sensor_service["Sensor polling"]
  node_response_parser["Response parser"]
  node_sensor_reading["Reading factory"]
  node_sensor_domain["Sensor policy"]
  node_robot_service["Robot commands<br/>[robot_service.dart]"]
  node_camera_service["Camera service"]
  node_notifications["Notifications"]
  node_http_client["HTTP client"]
end

subgraph group_setup["Configuration and state"]
  node_service_locator["Service locator"]
  node_app_config["App configuration<br/>[app_config.dart]"]
  node_local_state[("Local preferences")]
end

node_user(("User"))
node_supabase{{"Supabase"}}
node_robot_api{{"Robot API"}}
node_sensor_endpoints{{"Sensor endpoints"}}
node_camera_endpoint{{"Camera endpoint"}}

node_user -->|"opens"| node_dashboard
node_user -->|"authenticates"| node_auth_views
node_user -->|"controls"| node_robot_views
node_dashboard -->|"requests updates"| node_sensor_service
node_sensor_views -->|"listens to readings"| node_sensor_service
node_history_view -->|"reads history"| node_sensor_service
node_sensor_service -->|"polls"| node_sensor_endpoints
node_sensor_service -->|"decodes responses"| node_response_parser
node_response_parser -->|"creates readings"| node_sensor_reading
node_sensor_reading -->|"classifies values"| node_sensor_domain
node_sensor_service -->|"publishes stream"| node_dashboard
node_robot_views -->|"sends commands"| node_robot_service
node_robot_service -->|"dispatches commands"| node_robot_api
node_robot_service -->|"adapts readings"| node_sensor_service
node_dashboard -->|"displays feed"| node_camera_widget
node_camera_widget -->|"loads feed"| node_camera_service
node_camera_service -->|"reads stream"| node_camera_endpoint
node_auth_views -.->|"authenticates"| node_supabase
node_service_locator -->|"wires service"| node_sensor_service
node_service_locator -->|"wires service"| node_robot_service
node_service_locator -->|"wires client"| node_http_client
node_sensor_service -->|"uses client"| node_http_client
node_robot_service -->|"uses client"| node_http_client
node_sensor_service -->|"reads endpoints"| node_app_config
node_robot_service -->|"reads settings"| node_app_config
node_notifications -->|"reads preferences"| node_local_state

click node_dashboard "https://github.com/thowdan/sffs-graduation-project-/blob/main/lib/screens/dashboard_screen.dart"
click node_sensor_views "https://github.com/thowdan/sffs-graduation-project-/blob/main/lib/screens/sensors_list_screen.dart"
click node_history_view "https://github.com/thowdan/sffs-graduation-project-/blob/main/lib/screens/history_screen.dart"
click node_auth_views "https://github.com/thowdan/sffs-graduation-project-/blob/main/lib/screens/login_screen.dart"
click node_robot_views "https://github.com/thowdan/sffs-graduation-project-/blob/main/lib/screens/deploy_robot_screen.dart"
click node_camera_widget "https://github.com/thowdan/sffs-graduation-project-/blob/main/lib/widgets/live_camera_feed.dart"
click node_sensor_service "https://github.com/thowdan/sffs-graduation-project-/blob/main/lib/services/sensor_service.dart"
click node_response_parser "https://github.com/thowdan/sffs-graduation-project-/blob/main/lib/services/sensor_response_parser.dart"
click node_sensor_reading "https://github.com/thowdan/sffs-graduation-project-/blob/main/lib/models/sensor_reading.dart"
click node_sensor_domain "https://github.com/thowdan/sffs-graduation-project-/blob/main/lib/domain/sensor_thresholds.dart"
click node_robot_service "https://github.com/thowdan/sffs-graduation-project-/blob/main/lib/services/robot_service.dart"
click node_camera_service "https://github.com/thowdan/sffs-graduation-project-/blob/main/lib/services/camera_feed_service.dart"
click node_notifications "https://github.com/thowdan/sffs-graduation-project-/blob/main/lib/services/notification_service.dart"
click node_http_client "https://github.com/thowdan/sffs-graduation-project-/blob/main/lib/services/http_client_service.dart"
click node_service_locator "https://github.com/thowdan/sffs-graduation-project-/blob/main/lib/config/service_locator.dart"
click node_app_config "https://github.com/thowdan/sffs-graduation-project-/blob/main/lib/config/app_config.dart"
click node_local_state "https://github.com/thowdan/sffs-graduation-project-/blob/main/lib/utils/notification_preferences.dart"

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_dashboard,node_sensor_views,node_history_view,node_auth_views,node_robot_views,node_camera_widget,node_user toneBlue
class node_sensor_service,node_response_parser,node_sensor_reading,node_sensor_domain,node_robot_service,node_camera_service,node_notifications,node_http_client toneAmber
class node_service_locator,node_app_config,node_local_state,node_robot_api toneMint
class node_supabase,node_sensor_endpoints,node_camera_endpoint toneIndigo
```

## Components

### User interface

- [Dashboard](https://github.com/thowdan/sffs-graduation-project-/blob/main/lib/screens/dashboard_screen.dart): `lib/screens/dashboard_screen.dart`
- [Sensor views](https://github.com/thowdan/sffs-graduation-project-/blob/main/lib/screens/sensors_list_screen.dart): `lib/screens/sensors_list_screen.dart`
- [History view](https://github.com/thowdan/sffs-graduation-project-/blob/main/lib/screens/history_screen.dart): `lib/screens/history_screen.dart`
- [Auth screens](https://github.com/thowdan/sffs-graduation-project-/blob/main/lib/screens/login_screen.dart): `lib/screens/login_screen.dart`
- [Robot controls](https://github.com/thowdan/sffs-graduation-project-/blob/main/lib/screens/deploy_robot_screen.dart): `lib/screens/deploy_robot_screen.dart`
- [Camera feed](https://github.com/thowdan/sffs-graduation-project-/blob/main/lib/widgets/live_camera_feed.dart): `lib/widgets/live_camera_feed.dart`

### Domain and services

- [Sensor polling](https://github.com/thowdan/sffs-graduation-project-/blob/main/lib/services/sensor_service.dart): `lib/services/sensor_service.dart`
- [Response parser](https://github.com/thowdan/sffs-graduation-project-/blob/main/lib/services/sensor_response_parser.dart): `lib/services/sensor_response_parser.dart`
- [Reading factory](https://github.com/thowdan/sffs-graduation-project-/blob/main/lib/models/sensor_reading.dart): `lib/models/sensor_reading.dart`
- [Sensor policy](https://github.com/thowdan/sffs-graduation-project-/blob/main/lib/domain/sensor_thresholds.dart): `lib/domain/sensor_thresholds.dart`
- [Robot commands](https://github.com/thowdan/sffs-graduation-project-/blob/main/lib/services/robot_service.dart): `lib/services/robot_service.dart`
- [Camera service](https://github.com/thowdan/sffs-graduation-project-/blob/main/lib/services/camera_feed_service.dart): `lib/services/camera_feed_service.dart`
- [Notifications](https://github.com/thowdan/sffs-graduation-project-/blob/main/lib/services/notification_service.dart): `lib/services/notification_service.dart`
- [HTTP client](https://github.com/thowdan/sffs-graduation-project-/blob/main/lib/services/http_client_service.dart): `lib/services/http_client_service.dart`

### Configuration and state

- [Service locator](https://github.com/thowdan/sffs-graduation-project-/blob/main/lib/config/service_locator.dart): `lib/config/service_locator.dart`
- [App configuration](https://github.com/thowdan/sffs-graduation-project-/blob/main/lib/config/app_config.dart): `lib/config/app_config.dart`
- [Local preferences](https://github.com/thowdan/sffs-graduation-project-/blob/main/lib/utils/notification_preferences.dart): `lib/utils/notification_preferences.dart`

### Other components

- **User**
- **Supabase**
- **Robot API**
- **Sensor endpoints**
- **Camera endpoint**

## Connections

- User → Dashboard: opens
- User → Auth screens: authenticates
- User → Robot controls: controls
- Dashboard → Sensor polling: requests updates
- Sensor views → Sensor polling: listens to readings
- History view → Sensor polling: reads history
- Sensor polling → Sensor endpoints: polls
- Sensor polling → Response parser: decodes responses
- Response parser → Reading factory: creates readings
- Reading factory → Sensor policy: classifies values
- Sensor polling → Dashboard: publishes stream
- Robot controls → Robot commands: sends commands
- Robot commands → Robot API: dispatches commands
- Robot commands → Sensor polling: adapts readings
- Dashboard → Camera feed: displays feed
- Camera feed → Camera service: loads feed
- Camera service → Camera endpoint: reads stream
- Auth screens → Supabase: authenticates
- Service locator → Sensor polling: wires service
- Service locator → Robot commands: wires service
- Service locator → HTTP client: wires client
- Sensor polling → HTTP client: uses client
- Robot commands → HTTP client: uses client
- Sensor polling → App configuration: reads endpoints
- Robot commands → App configuration: reads settings
- Notifications → Local preferences: reads preferences
