# silentkeyboard1/justweather architecture

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

- Interactive diagram: https://gitdiagram.com/silentkeyboard1/justweather
- Repository: https://github.com/silentkeyboard1/justweather

## Overview

JustWeather is a local-weather app: users view weather for their current location, search for cities, inspect a city’s weather, and manage favorites; the home screen supports swiping among locations. A separate Android widget resolves a selected or current city and refreshes weather on schedule or on demand. The graph includes the main app, city/location and favorites stages, weather presentation, and widget lifecycle. Some route and API details come from the SOURCE INDEX or README rather than sampled implementations, so uncertain connections are omitted.

Main entry points: [`src/app/search.tsx`](https://github.com/silentkeyboard1/justweather/blob/main/src/app/search.tsx) (Search screen), [`src/features/weather-widget/utils/resolveWidgetCity.ts`](https://github.com/silentkeyboard1/justweather/blob/main/src/features/weather-widget/utils/resolveWidgetCity.ts) (Widget city resolver), [`src/features/weather-widget/context/WidgetCityContext.tsx`](https://github.com/silentkeyboard1/justweather/blob/main/src/features/weather-widget/context/WidgetCityContext.tsx) (Widget city context), [`src/app/index.tsx`](https://github.com/silentkeyboard1/justweather/blob/main/src/app/index.tsx) (Home screen)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App experience"]
  node_home["Home screen<br/>[index.tsx]"]
  node_searchscreen["Search screen<br/>[search.tsx]"]
end

subgraph group_places["Cities and favorites"]
  node_citymodel["City model<br/>[city.ts]"]
  node_citysearch["City search API<br/>[searchCities.ts]"]
  node_searchform["Search form<br/>[CitySearchForm.tsx]"]
  node_searchresults["Search results"]
  node_favorites["Favorites context"]
  node_favoritestore[("Favorites storage")]
  node_location["Current location lookup<br/>[getCurrentCity.ts]"]
  node_locationstore[("Current city storage")]
end

subgraph group_weather["Weather experience"]
  node_weatherapi["Weather API<br/>[getWeather.ts]"]
  node_weatherpage["Weather page<br/>[WeatherPage.tsx]"]
  node_weathercard["Weather card<br/>[WeatherCard.tsx]"]
  node_weathericon["Weather icon<br/>[WeatherIcon.tsx]"]
  node_weathercondition["Condition mapping"]
  node_weathermodel["Weather model<br/>[weather.ts]"]
end

subgraph group_widget["Android widget"]
  node_widgetcontext["Widget city context"]
  node_widgetstore[("Widget city storage")]
  node_widgetresolve["Widget city resolver"]
  node_widgettask["Widget task handler"]
  node_widgetview["Current weather widget"]
  node_widgeticons["Widget icon SVG"]
end

subgraph group_shared["Shared presentation"]
  node_theme["App theme<br/>[theme.ts]"]
  node_basetheme["Base theme tokens<br/>[theme.ts]"]
  node_themedtext["Themed text<br/>[themed-text.tsx]"]
  node_themedview["Themed view<br/>[themed-view.tsx]"]
end

node_user(("Weather user"))
node_android{{"Android widget runtime"}}
node_weatherprovider{{"Weather data service"}}

node_user -->|"views weather"| node_home
node_user -->|"searches cities"| node_searchscreen
node_home -->|"gets current city"| node_location
node_home -->|"reads favorites"| node_favorites
node_home -->|"shows weather"| node_weatherpage
node_searchscreen -->|"searches cities"| node_citysearch
node_searchscreen -->|"renders form"| node_searchform
node_searchscreen -->|"renders results"| node_searchresults
node_searchscreen -->|"toggles favorite"| node_favorites
node_searchscreen -->|"shows selected city"| node_weatherpage
node_citysearch -->|"returns cities"| node_citymodel
node_searchresults -->|"displays cities"| node_citymodel
node_favorites -->|"loads and saves"| node_favoritestore
node_location -->|"searches resolved place"| node_citysearch
node_location -->|"persists current city"| node_locationstore
node_weatherpage -->|"fetches weather"| node_weatherapi
node_weatherpage -->|"renders weather"| node_weathercard
node_weathercard -->|"renders icon"| node_weathericon
node_weathericon -->|"maps condition"| node_weathercondition
node_weathercard -->|"maps condition"| node_weathercondition
node_weatherapi -.->|"requests data"| node_weatherprovider
node_widgetcontext -->|"loads and saves"| node_widgetstore
node_widgetcontext -->|"resolves location"| node_widgetresolve
node_widgetcontext -->|"fetches weather"| node_weatherapi
node_widgetcontext -->|"requests widget update"| node_widgetview
node_widgettask -->|"resolves location"| node_widgetresolve
node_widgettask -->|"fetches weather"| node_weatherapi
node_widgettask -->|"renders widget"| node_widgetview
node_android -->|"dispatches tasks"| node_widgettask
node_widgetresolve -->|"checks current location"| node_location
node_widgetresolve -->|"reads fallback city"| node_locationstore
node_widgetresolve -->|"reads override"| node_widgetstore
node_widgetview -->|"maps condition"| node_weathercondition
node_widgetview -->|"uses icon SVG"| node_widgeticons
node_widgeticons -->|"maps condition"| node_weathercondition
node_themedtext -->|"uses theme tokens"| node_basetheme
node_themedview -->|"uses theme tokens"| node_basetheme
node_weathercard -->|"uses app colors"| node_theme
node_searchscreen -->|"uses app colors"| node_theme

click node_home "https://github.com/silentkeyboard1/justweather/blob/main/src/app/index.tsx"
click node_searchscreen "https://github.com/silentkeyboard1/justweather/blob/main/src/app/search.tsx"
click node_citymodel "https://github.com/silentkeyboard1/justweather/blob/main/src/features/city-search/model/city.ts"
click node_citysearch "https://github.com/silentkeyboard1/justweather/blob/main/src/features/city-search/api/searchCities.ts"
click node_searchform "https://github.com/silentkeyboard1/justweather/blob/main/src/features/city-search/components/CitySearchForm.tsx"
click node_searchresults "https://github.com/silentkeyboard1/justweather/blob/main/src/features/city-search/components/CitySearchResults.tsx"
click node_favorites "https://github.com/silentkeyboard1/justweather/blob/main/src/features/favorites/context/FavoritesContext.tsx"
click node_favoritestore "https://github.com/silentkeyboard1/justweather/blob/main/src/features/favorites/storage/favoriteCitiesStorage.ts"
click node_location "https://github.com/silentkeyboard1/justweather/blob/main/src/features/location/api/getCurrentCity.ts"
click node_locationstore "https://github.com/silentkeyboard1/justweather/blob/main/src/features/location/storage/currentCityStorage.ts"
click node_weatherapi "https://github.com/silentkeyboard1/justweather/blob/main/src/features/weather/api/getWeather.ts"
click node_weatherpage "https://github.com/silentkeyboard1/justweather/blob/main/src/features/weather/components/WeatherPage.tsx"
click node_weathercard "https://github.com/silentkeyboard1/justweather/blob/main/src/features/weather/components/WeatherCard.tsx"
click node_weathericon "https://github.com/silentkeyboard1/justweather/blob/main/src/features/weather/components/WeatherIcon.tsx"
click node_weathercondition "https://github.com/silentkeyboard1/justweather/blob/main/src/features/weather/utils/getWeatherCondition.ts"
click node_weathermodel "https://github.com/silentkeyboard1/justweather/blob/main/src/features/weather/model/weather.ts"
click node_widgetcontext "https://github.com/silentkeyboard1/justweather/blob/main/src/features/weather-widget/context/WidgetCityContext.tsx"
click node_widgetstore "https://github.com/silentkeyboard1/justweather/blob/main/src/features/weather-widget/storage/widgetCityStorage.ts"
click node_widgetresolve "https://github.com/silentkeyboard1/justweather/blob/main/src/features/weather-widget/utils/resolveWidgetCity.ts"
click node_widgettask "https://github.com/silentkeyboard1/justweather/blob/main/src/features/weather-widget/widgetTaskHandler.tsx"
click node_widgetview "https://github.com/silentkeyboard1/justweather/blob/main/src/features/weather-widget/components/CurrentWeatherWidget.tsx"
click node_widgeticons "https://github.com/silentkeyboard1/justweather/blob/main/src/features/weather-widget/utils/getWidgetWeatherIconSvg.ts"
click node_theme "https://github.com/silentkeyboard1/justweather/blob/main/src/shared/theme/theme.ts"
click node_basetheme "https://github.com/silentkeyboard1/justweather/blob/main/src/constants/theme.ts"
click node_themedtext "https://github.com/silentkeyboard1/justweather/blob/main/src/components/themed-text.tsx"
click node_themedview "https://github.com/silentkeyboard1/justweather/blob/main/src/components/themed-view.tsx"

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_home,node_searchscreen,node_user toneBlue
class node_citymodel,node_citysearch,node_searchform,node_searchresults,node_favorites,node_favoritestore,node_location,node_locationstore toneAmber
class node_weatherapi,node_weatherpage,node_weathercard,node_weathericon,node_weathercondition,node_weathermodel toneMint
class node_widgetcontext,node_widgetstore,node_widgetresolve,node_widgettask,node_widgetview,node_widgeticons toneRose
class node_theme,node_basetheme,node_themedtext,node_themedview,node_android,node_weatherprovider toneIndigo
```

## Components

### App experience

- [Home screen](https://github.com/silentkeyboard1/justweather/blob/main/src/app/index.tsx): `src/app/index.tsx`
- [Search screen](https://github.com/silentkeyboard1/justweather/blob/main/src/app/search.tsx): `src/app/search.tsx`

### Cities and favorites

- [City model](https://github.com/silentkeyboard1/justweather/blob/main/src/features/city-search/model/city.ts): `src/features/city-search/model/city.ts`
- [City search API](https://github.com/silentkeyboard1/justweather/blob/main/src/features/city-search/api/searchCities.ts): `src/features/city-search/api/searchCities.ts`
- [Search form](https://github.com/silentkeyboard1/justweather/blob/main/src/features/city-search/components/CitySearchForm.tsx): `src/features/city-search/components/CitySearchForm.tsx`
- [Search results](https://github.com/silentkeyboard1/justweather/blob/main/src/features/city-search/components/CitySearchResults.tsx): `src/features/city-search/components/CitySearchResults.tsx`
- [Favorites context](https://github.com/silentkeyboard1/justweather/blob/main/src/features/favorites/context/FavoritesContext.tsx): `src/features/favorites/context/FavoritesContext.tsx`
- [Favorites storage](https://github.com/silentkeyboard1/justweather/blob/main/src/features/favorites/storage/favoriteCitiesStorage.ts): `src/features/favorites/storage/favoriteCitiesStorage.ts`
- [Current location lookup](https://github.com/silentkeyboard1/justweather/blob/main/src/features/location/api/getCurrentCity.ts): `src/features/location/api/getCurrentCity.ts`
- [Current city storage](https://github.com/silentkeyboard1/justweather/blob/main/src/features/location/storage/currentCityStorage.ts): `src/features/location/storage/currentCityStorage.ts`

### Weather experience

- [Weather API](https://github.com/silentkeyboard1/justweather/blob/main/src/features/weather/api/getWeather.ts): `src/features/weather/api/getWeather.ts`
- [Weather page](https://github.com/silentkeyboard1/justweather/blob/main/src/features/weather/components/WeatherPage.tsx): `src/features/weather/components/WeatherPage.tsx`
- [Weather card](https://github.com/silentkeyboard1/justweather/blob/main/src/features/weather/components/WeatherCard.tsx): `src/features/weather/components/WeatherCard.tsx`
- [Weather icon](https://github.com/silentkeyboard1/justweather/blob/main/src/features/weather/components/WeatherIcon.tsx): `src/features/weather/components/WeatherIcon.tsx`
- [Condition mapping](https://github.com/silentkeyboard1/justweather/blob/main/src/features/weather/utils/getWeatherCondition.ts): `src/features/weather/utils/getWeatherCondition.ts`
- [Weather model](https://github.com/silentkeyboard1/justweather/blob/main/src/features/weather/model/weather.ts): `src/features/weather/model/weather.ts`

### Android widget

- [Widget city context](https://github.com/silentkeyboard1/justweather/blob/main/src/features/weather-widget/context/WidgetCityContext.tsx): `src/features/weather-widget/context/WidgetCityContext.tsx`
- [Widget city storage](https://github.com/silentkeyboard1/justweather/blob/main/src/features/weather-widget/storage/widgetCityStorage.ts): `src/features/weather-widget/storage/widgetCityStorage.ts`
- [Widget city resolver](https://github.com/silentkeyboard1/justweather/blob/main/src/features/weather-widget/utils/resolveWidgetCity.ts): `src/features/weather-widget/utils/resolveWidgetCity.ts`
- [Widget task handler](https://github.com/silentkeyboard1/justweather/blob/main/src/features/weather-widget/widgetTaskHandler.tsx): `src/features/weather-widget/widgetTaskHandler.tsx`
- [Current weather widget](https://github.com/silentkeyboard1/justweather/blob/main/src/features/weather-widget/components/CurrentWeatherWidget.tsx): `src/features/weather-widget/components/CurrentWeatherWidget.tsx`
- [Widget icon SVG](https://github.com/silentkeyboard1/justweather/blob/main/src/features/weather-widget/utils/getWidgetWeatherIconSvg.ts): `src/features/weather-widget/utils/getWidgetWeatherIconSvg.ts`

### Shared presentation

- [App theme](https://github.com/silentkeyboard1/justweather/blob/main/src/shared/theme/theme.ts): `src/shared/theme/theme.ts`
- [Base theme tokens](https://github.com/silentkeyboard1/justweather/blob/main/src/constants/theme.ts): `src/constants/theme.ts`
- [Themed text](https://github.com/silentkeyboard1/justweather/blob/main/src/components/themed-text.tsx): `src/components/themed-text.tsx`
- [Themed view](https://github.com/silentkeyboard1/justweather/blob/main/src/components/themed-view.tsx): `src/components/themed-view.tsx`

### Other components

- **Weather user**
- **Android widget runtime**
- **Weather data service**

## Connections

- Weather user → Home screen: views weather
- Weather user → Search screen: searches cities
- Home screen → Current location lookup: gets current city (evidence: `src/app/index.tsx`)
- Home screen → Favorites context: reads favorites (evidence: `src/app/index.tsx`)
- Home screen → Weather page: shows weather (evidence: `src/app/index.tsx`)
- Search screen → City search API: searches cities (evidence: `src/app/search.tsx`)
- Search screen → Search form: renders form (evidence: `src/app/search.tsx`)
- Search screen → Search results: renders results (evidence: `src/app/search.tsx`)
- Search screen → Favorites context: toggles favorite (evidence: `src/app/search.tsx`)
- Search screen → Weather page: shows selected city (evidence: `src/app/search.tsx`)
- City search API → City model: returns cities (evidence: `src/features/city-search/api/searchCities.ts`)
- Search results → City model: displays cities (evidence: `src/features/city-search/components/CitySearchResults.tsx`)
- Favorites context → Favorites storage: loads and saves (evidence: `src/features/favorites/context/FavoritesContext.tsx`)
- Current location lookup → City search API: searches resolved place (evidence: `src/features/location/api/getCurrentCity.ts`)
- Current location lookup → Current city storage: persists current city (evidence: `src/features/location/api/getCurrentCity.ts`)
- Weather page → Weather API: fetches weather (evidence: `src/features/weather/components/WeatherPage.tsx`)
- Weather page → Weather card: renders weather (evidence: `src/features/weather/components/WeatherPage.tsx`)
- Weather card → Weather icon: renders icon (evidence: `src/features/weather/components/WeatherCard.tsx`)
- Weather icon → Condition mapping: maps condition (evidence: `src/features/weather/components/WeatherIcon.tsx`)
- Weather card → Condition mapping: maps condition (evidence: `src/features/weather/components/WeatherCard.tsx`)
- Weather API → Weather data service: requests data
- Widget city context → Widget city storage: loads and saves (evidence: `src/features/weather-widget/context/WidgetCityContext.tsx`)
- Widget city context → Widget city resolver: resolves location (evidence: `src/features/weather-widget/context/WidgetCityContext.tsx`)
- Widget city context → Weather API: fetches weather (evidence: `src/features/weather-widget/context/WidgetCityContext.tsx`)
- Widget city context → Current weather widget: requests widget update (evidence: `src/features/weather-widget/context/WidgetCityContext.tsx`)
- Widget task handler → Widget city resolver: resolves location (evidence: `src/features/weather-widget/widgetTaskHandler.tsx`)
- Widget task handler → Weather API: fetches weather (evidence: `src/features/weather-widget/widgetTaskHandler.tsx`)
- Widget task handler → Current weather widget: renders widget (evidence: `src/features/weather-widget/widgetTaskHandler.tsx`)
- Android widget runtime → Widget task handler: dispatches tasks
- Widget city resolver → Current location lookup: checks current location (evidence: `src/features/weather-widget/utils/resolveWidgetCity.ts`)
- Widget city resolver → Current city storage: reads fallback city (evidence: `src/features/weather-widget/utils/resolveWidgetCity.ts`)
- Widget city resolver → Widget city storage: reads override (evidence: `src/features/weather-widget/utils/resolveWidgetCity.ts`)
- Current weather widget → Condition mapping: maps condition (evidence: `src/features/weather-widget/components/CurrentWeatherWidget.tsx`)
- Current weather widget → Widget icon SVG: uses icon SVG (evidence: `src/features/weather-widget/components/CurrentWeatherWidget.tsx`)
- Widget icon SVG → Condition mapping: maps condition (evidence: `src/features/weather-widget/utils/getWidgetWeatherIconSvg.ts`)
- Themed text → Base theme tokens: uses theme tokens (evidence: `src/components/themed-text.tsx`)
- Themed view → Base theme tokens: uses theme tokens (evidence: `src/components/themed-view.tsx`)
- Weather card → App theme: uses app colors (evidence: `src/features/weather/components/WeatherCard.tsx`)
- Search screen → App theme: uses app colors (evidence: `src/app/search.tsx`)
