# abdulrahman-saleh-cs/weather_app architecture

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

- Interactive diagram: https://gitdiagram.com/abdulrahman-saleh-cs/weather_app
- Repository: https://github.com/abdulrahman-saleh-cs/weather_app

## Overview

This is a Flutter weather app whose documented purpose is to fetch real-time weather data through a REST API. The intended user workflow is to open the weather screen, request weather data, and display current conditions and forecasts. The tree shows distinct presentation, domain, and data layers, plus shared weather UI and API infrastructure. Core Dart implementations were not included in the sampled source, so most internal call relationships are shown as unverified; the README supports only the app’s REST-fetch capability.

Main entry points: [`lib/features/weather/data/repositories/weather_repository_impl.dart`](https://github.com/abdulrahman-saleh-cs/weather_app/blob/main/lib/features/weather/data/repositories/weather_repository_impl.dart) (Weather repository), [`lib/features/weather/presentation/pages/weather/weather_view.dart`](https://github.com/abdulrahman-saleh-cs/weather_app/blob/main/lib/features/weather/presentation/pages/weather/weather_view.dart) (Weather screen), [`lib/features/weather/presentation/manager/weather_cubit.dart`](https://github.com/abdulrahman-saleh-cs/weather_app/blob/main/lib/features/weather/presentation/manager/weather_cubit.dart) (Weather controller), [`lib/features/weather/data/data_sources/remote_data_source.dart`](https://github.com/abdulrahman-saleh-cs/weather_app/blob/main/lib/features/weather/data/data_sources/remote_data_source.dart) (Remote weather source)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_presentation["Weather presentation"]
  node_screen["Weather screen<br/>[weather_view.dart]"]
  node_weather_widgets["Weather display widgets"]
  node_weather_state["Weather state<br/>[weather_state.dart]"]
  node_weather_cubit["Weather controller<br/>[weather_cubit.dart]"]
  node_ui_mapper["Weather UI mapper"]
end

subgraph group_domain["Weather domain"]
  node_get_weather["Get weather<br/>[get_weather.dart]"]
  node_weather_contract["Weather repository contract"]
  node_weather_entities["Weather entities"]
end

subgraph group_data["Weather data"]
  node_repository["Weather repository"]
  node_remote_source["Remote weather source"]
  node_local_source["Local weather source"]
  node_weather_models["Weather models"]
end

subgraph group_shared["Shared infrastructure"]
  node_weather_ui["Weather visuals"]
  node_api_client["API client<br/>[dio_consumer.dart]"]
  node_api_contract["API abstraction<br/>[api_consumer.dart]"]
end

node_user(("App user"))
node_rest_service{{"Weather REST API"}}

node_user -.->|"opens"| node_screen
node_screen -.->|"renders"| node_weather_widgets
node_screen -.->|"requests weather"| node_weather_cubit
node_weather_cubit -.->|"invokes"| node_get_weather
node_weather_cubit -.->|"updates"| node_weather_state
node_get_weather -.->|"uses"| node_weather_contract
node_weather_contract -.->|"uses"| node_weather_entities
node_repository -.->|"implements"| node_weather_contract
node_repository -.->|"delegates to"| node_remote_source
node_repository -.->|"uses"| node_local_source
node_remote_source -.->|"uses"| node_api_contract
node_api_client -.->|"implements"| node_api_contract
node_remote_source -.->|"fetches weather"| node_rest_service
node_repository -.->|"uses"| node_weather_models
node_ui_mapper -.->|"maps"| node_weather_entities
node_weather_widgets -.->|"uses"| node_weather_ui

click node_screen "https://github.com/abdulrahman-saleh-cs/weather_app/blob/main/lib/features/weather/presentation/pages/weather/weather_view.dart"
click node_weather_widgets "https://github.com/abdulrahman-saleh-cs/weather_app/tree/main/lib/features/weather/presentation/pages/weather/widgets"
click node_weather_state "https://github.com/abdulrahman-saleh-cs/weather_app/blob/main/lib/features/weather/presentation/manager/weather_state.dart"
click node_weather_cubit "https://github.com/abdulrahman-saleh-cs/weather_app/blob/main/lib/features/weather/presentation/manager/weather_cubit.dart"
click node_ui_mapper "https://github.com/abdulrahman-saleh-cs/weather_app/blob/main/lib/features/weather/presentation/mappers/weather_ui_mapper.dart"
click node_weather_ui "https://github.com/abdulrahman-saleh-cs/weather_app/tree/main/lib/core/weather_ui"
click node_get_weather "https://github.com/abdulrahman-saleh-cs/weather_app/blob/main/lib/features/weather/domain/usecases/get_weather.dart"
click node_weather_contract "https://github.com/abdulrahman-saleh-cs/weather_app/blob/main/lib/features/weather/domain/repositories/weather_repository.dart"
click node_weather_entities "https://github.com/abdulrahman-saleh-cs/weather_app/tree/main/lib/features/weather/domain/entities"
click node_repository "https://github.com/abdulrahman-saleh-cs/weather_app/blob/main/lib/features/weather/data/repositories/weather_repository_impl.dart"
click node_remote_source "https://github.com/abdulrahman-saleh-cs/weather_app/blob/main/lib/features/weather/data/data_sources/remote_data_source.dart"
click node_local_source "https://github.com/abdulrahman-saleh-cs/weather_app/blob/main/lib/features/weather/data/data_sources/local_data_source.dart"
click node_weather_models "https://github.com/abdulrahman-saleh-cs/weather_app/tree/main/lib/features/weather/data/models"
click node_api_client "https://github.com/abdulrahman-saleh-cs/weather_app/blob/main/lib/core/databases/api/dio_consumer.dart"
click node_api_contract "https://github.com/abdulrahman-saleh-cs/weather_app/blob/main/lib/core/databases/api/api_consumer.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_screen,node_weather_widgets,node_weather_state,node_weather_cubit,node_ui_mapper,node_user toneBlue
class node_get_weather,node_weather_contract,node_weather_entities toneAmber
class node_repository,node_remote_source,node_local_source,node_weather_models,node_rest_service toneMint
class node_weather_ui,node_api_client,node_api_contract toneRose
```

## Components

### Weather presentation

- [Weather screen](https://github.com/abdulrahman-saleh-cs/weather_app/blob/main/lib/features/weather/presentation/pages/weather/weather_view.dart): `lib/features/weather/presentation/pages/weather/weather_view.dart`
- [Weather display widgets](https://github.com/abdulrahman-saleh-cs/weather_app/tree/main/lib/features/weather/presentation/pages/weather/widgets): `lib/features/weather/presentation/pages/weather/widgets`
- [Weather state](https://github.com/abdulrahman-saleh-cs/weather_app/blob/main/lib/features/weather/presentation/manager/weather_state.dart): `lib/features/weather/presentation/manager/weather_state.dart`
- [Weather controller](https://github.com/abdulrahman-saleh-cs/weather_app/blob/main/lib/features/weather/presentation/manager/weather_cubit.dart): `lib/features/weather/presentation/manager/weather_cubit.dart`
- [Weather UI mapper](https://github.com/abdulrahman-saleh-cs/weather_app/blob/main/lib/features/weather/presentation/mappers/weather_ui_mapper.dart): `lib/features/weather/presentation/mappers/weather_ui_mapper.dart`

### Weather domain

- [Get weather](https://github.com/abdulrahman-saleh-cs/weather_app/blob/main/lib/features/weather/domain/usecases/get_weather.dart): `lib/features/weather/domain/usecases/get_weather.dart`
- [Weather repository contract](https://github.com/abdulrahman-saleh-cs/weather_app/blob/main/lib/features/weather/domain/repositories/weather_repository.dart): `lib/features/weather/domain/repositories/weather_repository.dart`
- [Weather entities](https://github.com/abdulrahman-saleh-cs/weather_app/tree/main/lib/features/weather/domain/entities): `lib/features/weather/domain/entities`

### Weather data

- [Weather repository](https://github.com/abdulrahman-saleh-cs/weather_app/blob/main/lib/features/weather/data/repositories/weather_repository_impl.dart): `lib/features/weather/data/repositories/weather_repository_impl.dart`
- [Remote weather source](https://github.com/abdulrahman-saleh-cs/weather_app/blob/main/lib/features/weather/data/data_sources/remote_data_source.dart): `lib/features/weather/data/data_sources/remote_data_source.dart`
- [Local weather source](https://github.com/abdulrahman-saleh-cs/weather_app/blob/main/lib/features/weather/data/data_sources/local_data_source.dart): `lib/features/weather/data/data_sources/local_data_source.dart`
- [Weather models](https://github.com/abdulrahman-saleh-cs/weather_app/tree/main/lib/features/weather/data/models): `lib/features/weather/data/models`

### Shared infrastructure

- [Weather visuals](https://github.com/abdulrahman-saleh-cs/weather_app/tree/main/lib/core/weather_ui): `lib/core/weather_ui`
- [API client](https://github.com/abdulrahman-saleh-cs/weather_app/blob/main/lib/core/databases/api/dio_consumer.dart): `lib/core/databases/api/dio_consumer.dart`
- [API abstraction](https://github.com/abdulrahman-saleh-cs/weather_app/blob/main/lib/core/databases/api/api_consumer.dart): `lib/core/databases/api/api_consumer.dart`

### Other components

- **App user**
- **Weather REST API**

## Connections

- App user → Weather screen: opens
- Weather screen → Weather display widgets: renders
- Weather screen → Weather controller: requests weather
- Weather controller → Get weather: invokes
- Weather controller → Weather state: updates
- Get weather → Weather repository contract: uses
- Weather repository contract → Weather entities: uses
- Weather repository → Weather repository contract: implements
- Weather repository → Remote weather source: delegates to
- Weather repository → Local weather source: uses
- Remote weather source → API abstraction: uses
- API client → API abstraction: implements
- Remote weather source → Weather REST API: fetches weather (evidence: `README.md`)
- Weather repository → Weather models: uses
- Weather UI mapper → Weather entities: maps
- Weather display widgets → Weather visuals: uses
