# abdhakeem18/weather-app architecture

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

- Interactive diagram: https://gitdiagram.com/abdhakeem18/weather-app
- Repository: https://github.com/abdhakeem18/weather-app

## Overview

Weather App is a Flutter client for OpenWeatherMap. Its principal workflow is to obtain a location or accept a city search, retrieve weather data, and present current conditions and forecasts; users can also inspect air quality, manage favorites, and customize settings. The tree identifies the relevant screens, providers, services, and models. Dart implementation excerpts were not provided, so feature-to-feature wiring is shown only where the README documents it; unverified internal calls are omitted.

Main entry points: [`lib/features/weather/data/services/weather_api_service.dart`](https://github.com/abdhakeem18/weather-app/blob/main/lib/features/weather/data/services/weather_api_service.dart) (Weather API), [`lib/features/home/presentation/pages/home_screen.dart`](https://github.com/abdhakeem18/weather-app/blob/main/lib/features/home/presentation/pages/home_screen.dart) (Home screen), [`lib/features/weather/presentation/providers/weather_provider.dart`](https://github.com/abdhakeem18/weather-app/blob/main/lib/features/weather/presentation/providers/weather_provider.dart) (Weather state), [`lib/features/search/presentation/pages/search_screen.dart`](https://github.com/abdhakeem18/weather-app/blob/main/lib/features/search/presentation/pages/search_screen.dart) (City search)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_presentation["App and screens"]
  node_app["App entry<br/>[main.dart]"]
  node_home["Home screen<br/>[home_screen.dart]"]
  node_weather_card["Weather card<br/>[weather_card.dart]"]
  node_weather_details["Weather details"]
  node_forecast_list["Forecast list<br/>[forecast_list.dart]"]
  node_search["City search<br/>[search_screen.dart]"]
  node_forecast["Forecast screen"]
  node_favorites_screen["Favorites screen"]
  node_settings_screen["Settings screen"]
end

subgraph group_weather["Weather data"]
  node_weather_provider["Weather state"]
  node_weather_api["Weather API"]
  node_weather_model["Weather model<br/>[weather_model.dart]"]
  node_forecast_model["Forecast model"]
  node_air_quality["Air quality model"]
end

subgraph group_personal["Personal features"]
  node_favorites_provider["Favorites state"]
  node_favorite_model["Favorite city"]
  node_settings_provider["Settings state"]
end

subgraph group_shared["Shared services"]
  node_location["Location service"]
  node_cache[("Offline cache<br/>[cache_service.dart]")]
  node_theme["App theme<br/>[app_theme.dart]"]
  node_config["App configuration<br/>[app_config.dart]"]
end

node_user(("User"))
node_openweather["OpenWeatherMap"]

node_user -->|"opens app"| node_app
node_user -->|"searches cities"| node_search
node_user -->|"manages favorites"| node_favorites_screen
node_user -->|"changes preferences"| node_settings_screen
node_user -->|"views weather"| node_home
node_location -.->|"provides location"| node_weather_provider
node_search -.->|"searches cities"| node_weather_api
node_weather_api -->|"requests weather data"| node_openweather
node_weather_provider -.->|"fetches weather"| node_weather_api
node_home -->|"shows conditions"| node_weather_card
node_home -->|"shows details"| node_weather_details
node_home -->|"shows quick forecast"| node_forecast_list
node_forecast -->|"presents forecast"| node_forecast_model
node_weather_api -.->|"parses current data"| node_weather_model
node_weather_api -.->|"fetches air quality"| node_air_quality
node_favorites_screen -.->|"manages favorites"| node_favorites_provider
node_favorites_provider -.->|"stores city entries"| node_favorite_model
node_settings_screen -.->|"updates preferences"| node_settings_provider
node_weather_provider -.->|"uses cached data"| node_cache
node_settings_provider -.->|"selects appearance"| node_theme
node_weather_api -.->|"uses API settings"| node_config

click node_app "https://github.com/abdhakeem18/weather-app/blob/main/lib/main.dart"
click node_home "https://github.com/abdhakeem18/weather-app/blob/main/lib/features/home/presentation/pages/home_screen.dart"
click node_weather_card "https://github.com/abdhakeem18/weather-app/blob/main/lib/features/home/presentation/widgets/weather_card.dart"
click node_weather_details "https://github.com/abdhakeem18/weather-app/blob/main/lib/features/home/presentation/widgets/weather_details.dart"
click node_forecast_list "https://github.com/abdhakeem18/weather-app/blob/main/lib/features/home/presentation/widgets/forecast_list.dart"
click node_search "https://github.com/abdhakeem18/weather-app/blob/main/lib/features/search/presentation/pages/search_screen.dart"
click node_forecast "https://github.com/abdhakeem18/weather-app/blob/main/lib/features/forecast/presentation/pages/forecast_screen.dart"
click node_favorites_screen "https://github.com/abdhakeem18/weather-app/blob/main/lib/features/favorites/presentation/pages/favorites_screen.dart"
click node_settings_screen "https://github.com/abdhakeem18/weather-app/blob/main/lib/features/settings/presentation/pages/settings_screen.dart"
click node_location "https://github.com/abdhakeem18/weather-app/blob/main/lib/core/services/location_service.dart"
click node_weather_provider "https://github.com/abdhakeem18/weather-app/blob/main/lib/features/weather/presentation/providers/weather_provider.dart"
click node_weather_api "https://github.com/abdhakeem18/weather-app/blob/main/lib/features/weather/data/services/weather_api_service.dart"
click node_weather_model "https://github.com/abdhakeem18/weather-app/blob/main/lib/features/weather/data/models/weather_model.dart"
click node_forecast_model "https://github.com/abdhakeem18/weather-app/blob/main/lib/features/weather/data/models/forecast_model.dart"
click node_air_quality "https://github.com/abdhakeem18/weather-app/blob/main/lib/features/weather/data/models/air_quality_model.dart"
click node_favorites_provider "https://github.com/abdhakeem18/weather-app/blob/main/lib/features/favorites/presentation/providers/favorites_provider.dart"
click node_favorite_model "https://github.com/abdhakeem18/weather-app/blob/main/lib/features/favorites/data/models/favorite_city_model.dart"
click node_settings_provider "https://github.com/abdhakeem18/weather-app/blob/main/lib/features/settings/presentation/providers/settings_provider.dart"
click node_cache "https://github.com/abdhakeem18/weather-app/blob/main/lib/core/services/cache_service.dart"
click node_theme "https://github.com/abdhakeem18/weather-app/blob/main/lib/core/theme/app_theme.dart"
click node_config "https://github.com/abdhakeem18/weather-app/blob/main/lib/core/config/app_config.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_app,node_home,node_weather_card,node_weather_details,node_forecast_list,node_search,node_forecast,node_favorites_screen,node_settings_screen,node_user toneBlue
class node_weather_provider,node_weather_api,node_weather_model,node_forecast_model,node_air_quality toneAmber
class node_favorites_provider,node_favorite_model,node_settings_provider toneMint
class node_location,node_cache,node_theme,node_config toneRose
class node_openweather toneIndigo
```

## Components

### App and screens

- [App entry](https://github.com/abdhakeem18/weather-app/blob/main/lib/main.dart): `lib/main.dart`
- [Home screen](https://github.com/abdhakeem18/weather-app/blob/main/lib/features/home/presentation/pages/home_screen.dart): `lib/features/home/presentation/pages/home_screen.dart`
- [Weather card](https://github.com/abdhakeem18/weather-app/blob/main/lib/features/home/presentation/widgets/weather_card.dart): `lib/features/home/presentation/widgets/weather_card.dart`
- [Weather details](https://github.com/abdhakeem18/weather-app/blob/main/lib/features/home/presentation/widgets/weather_details.dart): `lib/features/home/presentation/widgets/weather_details.dart`
- [Forecast list](https://github.com/abdhakeem18/weather-app/blob/main/lib/features/home/presentation/widgets/forecast_list.dart): `lib/features/home/presentation/widgets/forecast_list.dart`
- [City search](https://github.com/abdhakeem18/weather-app/blob/main/lib/features/search/presentation/pages/search_screen.dart): `lib/features/search/presentation/pages/search_screen.dart`
- [Forecast screen](https://github.com/abdhakeem18/weather-app/blob/main/lib/features/forecast/presentation/pages/forecast_screen.dart): `lib/features/forecast/presentation/pages/forecast_screen.dart`
- [Favorites screen](https://github.com/abdhakeem18/weather-app/blob/main/lib/features/favorites/presentation/pages/favorites_screen.dart): `lib/features/favorites/presentation/pages/favorites_screen.dart`
- [Settings screen](https://github.com/abdhakeem18/weather-app/blob/main/lib/features/settings/presentation/pages/settings_screen.dart): `lib/features/settings/presentation/pages/settings_screen.dart`

### Weather data

- [Weather state](https://github.com/abdhakeem18/weather-app/blob/main/lib/features/weather/presentation/providers/weather_provider.dart): `lib/features/weather/presentation/providers/weather_provider.dart`
- [Weather API](https://github.com/abdhakeem18/weather-app/blob/main/lib/features/weather/data/services/weather_api_service.dart): `lib/features/weather/data/services/weather_api_service.dart`
- [Weather model](https://github.com/abdhakeem18/weather-app/blob/main/lib/features/weather/data/models/weather_model.dart): `lib/features/weather/data/models/weather_model.dart`
- [Forecast model](https://github.com/abdhakeem18/weather-app/blob/main/lib/features/weather/data/models/forecast_model.dart): `lib/features/weather/data/models/forecast_model.dart`
- [Air quality model](https://github.com/abdhakeem18/weather-app/blob/main/lib/features/weather/data/models/air_quality_model.dart): `lib/features/weather/data/models/air_quality_model.dart`

### Personal features

- [Favorites state](https://github.com/abdhakeem18/weather-app/blob/main/lib/features/favorites/presentation/providers/favorites_provider.dart): `lib/features/favorites/presentation/providers/favorites_provider.dart`
- [Favorite city](https://github.com/abdhakeem18/weather-app/blob/main/lib/features/favorites/data/models/favorite_city_model.dart): `lib/features/favorites/data/models/favorite_city_model.dart`
- [Settings state](https://github.com/abdhakeem18/weather-app/blob/main/lib/features/settings/presentation/providers/settings_provider.dart): `lib/features/settings/presentation/providers/settings_provider.dart`

### Shared services

- [Location service](https://github.com/abdhakeem18/weather-app/blob/main/lib/core/services/location_service.dart): `lib/core/services/location_service.dart`
- [Offline cache](https://github.com/abdhakeem18/weather-app/blob/main/lib/core/services/cache_service.dart): `lib/core/services/cache_service.dart`
- [App theme](https://github.com/abdhakeem18/weather-app/blob/main/lib/core/theme/app_theme.dart): `lib/core/theme/app_theme.dart`
- [App configuration](https://github.com/abdhakeem18/weather-app/blob/main/lib/core/config/app_config.dart): `lib/core/config/app_config.dart`

### Other components

- **User**
- **OpenWeatherMap**

## Connections

- User → App entry: opens app (evidence: `README.md`)
- User → City search: searches cities (evidence: `README.md`)
- User → Favorites screen: manages favorites (evidence: `README.md`)
- User → Settings screen: changes preferences (evidence: `README.md`)
- User → Home screen: views weather (evidence: `README.md`)
- Location service → Weather state: provides location
- City search → Weather API: searches cities
- Weather API → OpenWeatherMap: requests weather data (evidence: `README.md`)
- Weather state → Weather API: fetches weather
- Home screen → Weather card: shows conditions (evidence: `README.md`)
- Home screen → Weather details: shows details (evidence: `README.md`)
- Home screen → Forecast list: shows quick forecast (evidence: `README.md`)
- Forecast screen → Forecast model: presents forecast (evidence: `README.md`)
- Weather API → Weather model: parses current data
- Weather API → Air quality model: fetches air quality
- Favorites screen → Favorites state: manages favorites
- Favorites state → Favorite city: stores city entries
- Settings screen → Settings state: updates preferences
- Weather state → Offline cache: uses cached data
- Settings state → App theme: selects appearance
- Weather API → App configuration: uses API settings
