# rizkidwisaputra646/breathe architecture

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

- Interactive diagram: https://gitdiagram.com/rizkidwisaputra646/breathe
- Repository: https://github.com/rizkidwisaputra646/breathe

## Overview

BREATHE is a Flutter air-quality and environmental guidance app. Its user-facing journey spans air-quality and location information, map/forecast exploration, and Gemini-based guidance, with account and preference capabilities alongside it. The README documents the product features and external technologies, but the sampled source contains only Android build configuration and a Flutter activity; therefore feature-level implementation links are documented at the product level, not verified as Dart call paths.

Main entry points: [`lib/main.dart`](https://github.com/rizkidwisaputra646/breathe/blob/main/lib/main.dart) (BREATHE app), [`lib/core/services/air_quality_service.dart`](https://github.com/rizkidwisaputra646/breathe/blob/main/lib/core/services/air_quality_service.dart) (Air quality data), [`lib/features/home`](https://github.com/rizkidwisaputra646/breathe/tree/main/lib/features/home) (Air quality overview), [`lib/core/services/nominatim_geocoding_service.dart`](https://github.com/rizkidwisaputra646/breathe/blob/main/lib/core/services/nominatim_geocoding_service.dart) (Place geocoding)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Air Quality Experience"]
  node_air_quality["Air quality data"]
  node_aqi_rules["AQI interpretation"]
  node_home["Air quality overview"]
  node_location["Location search"]
  node_geocoding["Place geocoding"]
  node_air_map["Interactive air map"]
  node_forecast["Air forecasts"]
  node_analytics["Pollutant trends"]
end

subgraph group_guidance["Guidance and Insights"]
  node_ai_advisor["AI advisor"]
  node_gemini_service["Gemini integration"]
  node_notifications["Air notifications"]
end

subgraph group_platform["Account and Platform Services"]
  node_authentication["Authentication"]
  node_preferences["User preferences"]
  node_local_storage[("Offline cache")]
end

node_user(("App user"))
node_app["BREATHE app<br/>[main.dart]"]
node_open_meteo["Open-Meteo"]
node_nominatim["OSM Nominatim"]
node_firebase["Firebase services"]

node_user -->|"uses"| node_app
node_app -.->|"shows air status"| node_home
node_app -->|"opens map"| node_air_map
node_app -->|"shows forecast"| node_forecast
node_app -->|"shows trends"| node_analytics
node_location -->|"searches places"| node_geocoding
node_geocoding -->|"uses geocoding"| node_nominatim
node_air_quality -->|"gets air data"| node_open_meteo
node_home -.->|"presents AQI status"| node_aqi_rules
node_app -->|"opens advisor"| node_ai_advisor
node_ai_advisor -.->|"requests analysis"| node_gemini_service
node_gemini_service -.->|"uses Gemini API"| node_firebase
node_app -->|"offers sign-in"| node_authentication
node_app -.->|"provides alerts"| node_notifications
node_app -.->|"offers settings"| node_preferences
node_air_quality -.->|"caches data"| node_local_storage
node_authentication -->|"uses authentication"| node_firebase

click node_app "https://github.com/rizkidwisaputra646/breathe/blob/main/lib/main.dart"
click node_air_quality "https://github.com/rizkidwisaputra646/breathe/blob/main/lib/core/services/air_quality_service.dart"
click node_aqi_rules "https://github.com/rizkidwisaputra646/breathe/blob/main/lib/core/utils/aqi_interpreter.dart"
click node_home "https://github.com/rizkidwisaputra646/breathe/tree/main/lib/features/home"
click node_location "https://github.com/rizkidwisaputra646/breathe/blob/main/lib/features/home/widgets/location_picker_sheet.dart"
click node_geocoding "https://github.com/rizkidwisaputra646/breathe/blob/main/lib/core/services/nominatim_geocoding_service.dart"
click node_air_map "https://github.com/rizkidwisaputra646/breathe/tree/main/lib/features/air_map"
click node_forecast "https://github.com/rizkidwisaputra646/breathe/tree/main/lib/features/forecast"
click node_analytics "https://github.com/rizkidwisaputra646/breathe/tree/main/lib/features/analytics"
click node_ai_advisor "https://github.com/rizkidwisaputra646/breathe/tree/main/lib/features/ai_advisor"
click node_gemini_service "https://github.com/rizkidwisaputra646/breathe/blob/main/lib/core/services/gemini_service.dart"
click node_notifications "https://github.com/rizkidwisaputra646/breathe/tree/main/lib/features/notifications"
click node_authentication "https://github.com/rizkidwisaputra646/breathe/tree/main/lib/features/authentication"
click node_preferences "https://github.com/rizkidwisaputra646/breathe/blob/main/lib/features/profile/providers/preferences_provider.dart"
click node_local_storage "https://github.com/rizkidwisaputra646/breathe/blob/main/lib/core/services/local_storage_service.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_air_quality,node_aqi_rules,node_home,node_location,node_geocoding,node_air_map,node_forecast,node_analytics,node_user toneBlue
class node_ai_advisor,node_gemini_service,node_notifications toneAmber
class node_authentication,node_preferences,node_local_storage toneMint
class node_app toneTeal
class node_open_meteo,node_nominatim,node_firebase toneIndigo
```

## Components

### Air Quality Experience

- [Air quality data](https://github.com/rizkidwisaputra646/breathe/blob/main/lib/core/services/air_quality_service.dart): `lib/core/services/air_quality_service.dart`
- [AQI interpretation](https://github.com/rizkidwisaputra646/breathe/blob/main/lib/core/utils/aqi_interpreter.dart): `lib/core/utils/aqi_interpreter.dart`
- [Air quality overview](https://github.com/rizkidwisaputra646/breathe/tree/main/lib/features/home): `lib/features/home`
- [Location search](https://github.com/rizkidwisaputra646/breathe/blob/main/lib/features/home/widgets/location_picker_sheet.dart): `lib/features/home/widgets/location_picker_sheet.dart`
- [Place geocoding](https://github.com/rizkidwisaputra646/breathe/blob/main/lib/core/services/nominatim_geocoding_service.dart): `lib/core/services/nominatim_geocoding_service.dart`
- [Interactive air map](https://github.com/rizkidwisaputra646/breathe/tree/main/lib/features/air_map): `lib/features/air_map`
- [Air forecasts](https://github.com/rizkidwisaputra646/breathe/tree/main/lib/features/forecast): `lib/features/forecast`
- [Pollutant trends](https://github.com/rizkidwisaputra646/breathe/tree/main/lib/features/analytics): `lib/features/analytics`

### Guidance and Insights

- [AI advisor](https://github.com/rizkidwisaputra646/breathe/tree/main/lib/features/ai_advisor): `lib/features/ai_advisor`
- [Gemini integration](https://github.com/rizkidwisaputra646/breathe/blob/main/lib/core/services/gemini_service.dart): `lib/core/services/gemini_service.dart`
- [Air notifications](https://github.com/rizkidwisaputra646/breathe/tree/main/lib/features/notifications): `lib/features/notifications`

### Account and Platform Services

- [Authentication](https://github.com/rizkidwisaputra646/breathe/tree/main/lib/features/authentication): `lib/features/authentication`
- [User preferences](https://github.com/rizkidwisaputra646/breathe/blob/main/lib/features/profile/providers/preferences_provider.dart): `lib/features/profile/providers/preferences_provider.dart`
- [Offline cache](https://github.com/rizkidwisaputra646/breathe/blob/main/lib/core/services/local_storage_service.dart): `lib/core/services/local_storage_service.dart`

### Other components

- **App user**
- [BREATHE app](https://github.com/rizkidwisaputra646/breathe/blob/main/lib/main.dart): `lib/main.dart`
- **Open-Meteo**
- **OSM Nominatim**
- **Firebase services**

## Connections

- App user → BREATHE app: uses (evidence: `README.md`)
- BREATHE app → Air quality overview: shows air status
- BREATHE app → Interactive air map: opens map (evidence: `README.md`)
- BREATHE app → Air forecasts: shows forecast (evidence: `README.md`)
- BREATHE app → Pollutant trends: shows trends (evidence: `README.md`)
- Location search → Place geocoding: searches places (evidence: `README.md`)
- Place geocoding → OSM Nominatim: uses geocoding (evidence: `README.md`)
- Air quality data → Open-Meteo: gets air data (evidence: `README.md`)
- Air quality overview → AQI interpretation: presents AQI status
- BREATHE app → AI advisor: opens advisor (evidence: `README.md`)
- AI advisor → Gemini integration: requests analysis
- Gemini integration → Firebase services: uses Gemini API
- BREATHE app → Authentication: offers sign-in (evidence: `README.md`)
- BREATHE app → Air notifications: provides alerts
- BREATHE app → User preferences: offers settings
- Air quality data → Offline cache: caches data
- Authentication → Firebase services: uses authentication (evidence: `README.md`)
