# mufoysal/weather_app architecture

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

- Interactive diagram: https://gitdiagram.com/mufoysal/weather_app
- Repository: https://github.com/mufoysal/weather_app

## Overview

Weather App is a Flutter client for city-based weather lookup, showing current conditions, hourly forecasts, and a seven-day forecast. Its documented flow starts with a city search, retrieves weather data from Open-Meteo, and presents the result with loading, error, and retry states. The README describes a Clean Architecture split across presentation, domain, data, and dependency injection. Dart implementation files were not sampled, so internal calls and API wiring are shown as unverified dashed relationships rather than asserted facts.

Main entry points: [`lib/features/weather/presentation/screens/weather_screen.dart`](https://github.com/mufoysal/weather_app/blob/main/lib/features/weather/presentation/screens/weather_screen.dart) (Weather screen), [`lib/features/weather/domain/entities/weather.dart`](https://github.com/mufoysal/weather_app/blob/main/lib/features/weather/domain/entities/weather.dart) (Weather entity), [`lib/features/weather/data/datasources/weather_remote_data_source_impl.dart`](https://github.com/mufoysal/weather_app/blob/main/lib/features/weather/data/datasources/weather_remote_data_source_impl.dart) (Remote data source), [`lib/features/weather/data/repositories/weather_repository_impl.dart`](https://github.com/mufoysal/weather_app/blob/main/lib/features/weather/data/repositories/weather_repository_impl.dart) (Repository implementation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_presentation["Weather presentation"]
  node_screen["Weather screen"]
  node_state["Weather state<br/>[weather_state.dart]"]
  node_welcome["Search welcome"]
  node_current["Current conditions"]
  node_hourly["Hourly forecast"]
  node_daily["Seven-day forecast"]
  node_errorview["Error and retry"]
end

subgraph group_domain["Weather domain"]
  node_getweather["Get weather<br/>[get_weather.dart]"]
  node_repository["Weather contract"]
  node_weather["Weather entity<br/>[weather.dart]"]
  node_hourlyentity["Hourly entity"]
  node_dailyentity["Daily entity<br/>[daily_weather.dart]"]
end

subgraph group_data["Weather data"]
  node_repositoryimpl["Repository implementation"]
  node_datasource["Remote data source"]
  node_model["Weather model<br/>[weather_model.dart]"]
end

subgraph group_support["App support"]
  node_app["Flutter entry<br/>[main.dart]"]
  node_mapper["Condition code mapper"]
  node_exception["Weather exception"]
  node_dependencies["Weather dependencies"]
end

node_user(("User"))
node_openmeteo{{"Open-Meteo APIs"}}

node_user -.->|"launches"| node_app
node_app -.->|"starts"| node_screen
node_user -.->|"searches city"| node_welcome
node_welcome -.->|"submits search"| node_screen
node_screen -.->|"requests weather"| node_getweather
node_getweather -.->|"requests data"| node_repository
node_repositoryimpl -.->|"implements"| node_repository
node_repositoryimpl -.->|"fetches data"| node_datasource
node_datasource -.->|"queries weather and geocoding"| node_openmeteo
node_datasource -.->|"parses response"| node_model
node_screen -.->|"tracks status"| node_state
node_screen -.->|"shows conditions"| node_current
node_screen -.->|"shows hourly"| node_hourly
node_screen -.->|"shows daily"| node_daily
node_screen -.->|"shows errors"| node_errorview
node_model -.->|"maps to"| node_weather
node_weather -.->|"includes forecast"| node_hourlyentity
node_weather -.->|"includes forecast"| node_dailyentity
node_dependencies -.->|"configures"| node_repositoryimpl
node_weather -.->|"maps condition codes"| node_mapper
node_datasource -.->|"reports failures"| node_exception

click node_app "https://github.com/mufoysal/weather_app/blob/main/lib/main.dart"
click node_screen "https://github.com/mufoysal/weather_app/blob/main/lib/features/weather/presentation/screens/weather_screen.dart"
click node_state "https://github.com/mufoysal/weather_app/blob/main/lib/features/weather/presentation/weather_state.dart"
click node_welcome "https://github.com/mufoysal/weather_app/blob/main/lib/features/weather/presentation/widgets/weather_welcome_view.dart"
click node_current "https://github.com/mufoysal/weather_app/blob/main/lib/features/weather/presentation/widgets/weather_info_card.dart"
click node_hourly "https://github.com/mufoysal/weather_app/blob/main/lib/features/weather/presentation/widgets/hourly_forecast.dart"
click node_daily "https://github.com/mufoysal/weather_app/blob/main/lib/features/weather/presentation/widgets/daily_forecast.dart"
click node_errorview "https://github.com/mufoysal/weather_app/blob/main/lib/features/weather/presentation/widgets/weather_error_view.dart"
click node_getweather "https://github.com/mufoysal/weather_app/blob/main/lib/features/weather/domain/usecases/get_weather.dart"
click node_repository "https://github.com/mufoysal/weather_app/blob/main/lib/features/weather/domain/repositories/weather_repository.dart"
click node_weather "https://github.com/mufoysal/weather_app/blob/main/lib/features/weather/domain/entities/weather.dart"
click node_hourlyentity "https://github.com/mufoysal/weather_app/blob/main/lib/features/weather/domain/entities/hourly_weather.dart"
click node_dailyentity "https://github.com/mufoysal/weather_app/blob/main/lib/features/weather/domain/entities/daily_weather.dart"
click node_repositoryimpl "https://github.com/mufoysal/weather_app/blob/main/lib/features/weather/data/repositories/weather_repository_impl.dart"
click node_datasource "https://github.com/mufoysal/weather_app/blob/main/lib/features/weather/data/datasources/weather_remote_data_source_impl.dart"
click node_model "https://github.com/mufoysal/weather_app/blob/main/lib/features/weather/data/models/weather_model.dart"
click node_mapper "https://github.com/mufoysal/weather_app/blob/main/lib/core/utils/weather_code_mapper.dart"
click node_exception "https://github.com/mufoysal/weather_app/blob/main/lib/core/error/weather_exception.dart"
click node_dependencies "https://github.com/mufoysal/weather_app/blob/main/lib/features/weather/di/weather_dependencies.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_state,node_welcome,node_current,node_hourly,node_daily,node_errorview,node_user toneBlue
class node_getweather,node_repository,node_weather,node_hourlyentity,node_dailyentity toneAmber
class node_repositoryimpl,node_datasource,node_model,node_openmeteo toneMint
class node_app,node_mapper,node_exception,node_dependencies toneRose
```

## Components

### Weather presentation

- [Weather screen](https://github.com/mufoysal/weather_app/blob/main/lib/features/weather/presentation/screens/weather_screen.dart): `lib/features/weather/presentation/screens/weather_screen.dart`
- [Weather state](https://github.com/mufoysal/weather_app/blob/main/lib/features/weather/presentation/weather_state.dart): `lib/features/weather/presentation/weather_state.dart`
- [Search welcome](https://github.com/mufoysal/weather_app/blob/main/lib/features/weather/presentation/widgets/weather_welcome_view.dart): `lib/features/weather/presentation/widgets/weather_welcome_view.dart`
- [Current conditions](https://github.com/mufoysal/weather_app/blob/main/lib/features/weather/presentation/widgets/weather_info_card.dart): `lib/features/weather/presentation/widgets/weather_info_card.dart`
- [Hourly forecast](https://github.com/mufoysal/weather_app/blob/main/lib/features/weather/presentation/widgets/hourly_forecast.dart): `lib/features/weather/presentation/widgets/hourly_forecast.dart`
- [Seven-day forecast](https://github.com/mufoysal/weather_app/blob/main/lib/features/weather/presentation/widgets/daily_forecast.dart): `lib/features/weather/presentation/widgets/daily_forecast.dart`
- [Error and retry](https://github.com/mufoysal/weather_app/blob/main/lib/features/weather/presentation/widgets/weather_error_view.dart): `lib/features/weather/presentation/widgets/weather_error_view.dart`

### Weather domain

- [Get weather](https://github.com/mufoysal/weather_app/blob/main/lib/features/weather/domain/usecases/get_weather.dart): `lib/features/weather/domain/usecases/get_weather.dart`
- [Weather contract](https://github.com/mufoysal/weather_app/blob/main/lib/features/weather/domain/repositories/weather_repository.dart): `lib/features/weather/domain/repositories/weather_repository.dart`
- [Weather entity](https://github.com/mufoysal/weather_app/blob/main/lib/features/weather/domain/entities/weather.dart): `lib/features/weather/domain/entities/weather.dart`
- [Hourly entity](https://github.com/mufoysal/weather_app/blob/main/lib/features/weather/domain/entities/hourly_weather.dart): `lib/features/weather/domain/entities/hourly_weather.dart`
- [Daily entity](https://github.com/mufoysal/weather_app/blob/main/lib/features/weather/domain/entities/daily_weather.dart): `lib/features/weather/domain/entities/daily_weather.dart`

### Weather data

- [Repository implementation](https://github.com/mufoysal/weather_app/blob/main/lib/features/weather/data/repositories/weather_repository_impl.dart): `lib/features/weather/data/repositories/weather_repository_impl.dart`
- [Remote data source](https://github.com/mufoysal/weather_app/blob/main/lib/features/weather/data/datasources/weather_remote_data_source_impl.dart): `lib/features/weather/data/datasources/weather_remote_data_source_impl.dart`
- [Weather model](https://github.com/mufoysal/weather_app/blob/main/lib/features/weather/data/models/weather_model.dart): `lib/features/weather/data/models/weather_model.dart`

### App support

- [Flutter entry](https://github.com/mufoysal/weather_app/blob/main/lib/main.dart): `lib/main.dart`
- [Condition code mapper](https://github.com/mufoysal/weather_app/blob/main/lib/core/utils/weather_code_mapper.dart): `lib/core/utils/weather_code_mapper.dart`
- [Weather exception](https://github.com/mufoysal/weather_app/blob/main/lib/core/error/weather_exception.dart): `lib/core/error/weather_exception.dart`
- [Weather dependencies](https://github.com/mufoysal/weather_app/blob/main/lib/features/weather/di/weather_dependencies.dart): `lib/features/weather/di/weather_dependencies.dart`

### Other components

- **User**
- **Open-Meteo APIs**

## Connections

- User → Flutter entry: launches
- Flutter entry → Weather screen: starts
- User → Search welcome: searches city
- Search welcome → Weather screen: submits search
- Weather screen → Get weather: requests weather
- Get weather → Weather contract: requests data
- Repository implementation → Weather contract: implements
- Repository implementation → Remote data source: fetches data
- Remote data source → Open-Meteo APIs: queries weather and geocoding
- Remote data source → Weather model: parses response
- Weather screen → Weather state: tracks status
- Weather screen → Current conditions: shows conditions
- Weather screen → Hourly forecast: shows hourly
- Weather screen → Seven-day forecast: shows daily
- Weather screen → Error and retry: shows errors
- Weather model → Weather entity: maps to
- Weather entity → Hourly entity: includes forecast
- Weather entity → Daily entity: includes forecast
- Weather dependencies → Repository implementation: configures
- Weather entity → Condition code mapper: maps condition codes
- Remote data source → Weather exception: reports failures
