How abdalla-shaker/mentor-weather-app works
This React weather app lets users search for a location, fetch current and forecast conditions, and view them in a responsive dashboard. The main flow is search input → Redux location state → weather hook → geocoding and forecast APIs → Redux weather state → current, future, and hourly forecast views. Unit selection triggers the same fetch path; recent searches persist in localStorage. The graph also preserves the documented autocomplete, error/loading, and unit-display capabilities. Some components are connected based on the README or source-index references; unsampled implementation details are not inferred.
Main entry points: store.js Weather state · WeatherContent.jsx Weather content and states · UnitsMenu.jsx Units menu · useWeather.jsx Weather request hook
Components 29
Search and controls
- App composition
src/App.jsx - Header and fetch trigger
src/components/header/Header.jsx - Units menu
src/components/header/UnitsMenu.jsx - Temperature units
src/components/header/Temp.jsx - Wind units
src/components/header/Wind.jsx - Precipitation units
src/components/header/Precipitation.jsx - Imperial option
src/components/header/Imperial.jsx - Location search
src/components/hero/Hero.jsx - Search history
src/components/hero/Hero.jsx
Weather data and state
- Weather request hook
src/hooks/useWeather.jsx - Weather state
src/store/store.js - Geocoding service
- Forecast service
- Browser local storage
Forecast presentation
- Weather content and states
src/components/weather content/WeatherContent.jsx - Forecast layout
src/components/main/Main.jsx - Today details
src/components/main/TodayDetails.jsx - Today summary
src/components/main/TodayHeader.jsx - Weather measurements
src/components/main/DetailList.jsx - Measurement output
src/components/main/Output.jsx - Future forecast
src/components/main/FutureWeatherDetails.jsx - Daily forecast cards
src/components/main/FutureData.jsx - Future loading state
src/components/main/LoadingFutureDetails.jsx - Hourly forecast selector
src/components/aside/Aside.jsx - Hourly forecast list
src/components/aside/HourlyList.jsx - Hourly loading state
src/components/aside/HourlyListIsLoading.jsx
Shared formatting
- Date and time formatting
src/utils/formatDate.js - Weather code icons
src/utils/getIcon.js
Other components
- User
Connections 38
- User → Location search: searches
src/components/hero/Hero.jsx - Location search → Weather state: dispatches location
src/components/hero/Hero.jsx - Location search → Search history: updates history
src/components/hero/Hero.jsx - Search history → Browser local storage: persists terms
src/components/hero/Hero.jsx - Header and fetch trigger → Weather state: reads units and location
src/components/header/Header.jsx - Header and fetch trigger → Weather request hook: invokes
src/components/header/Header.jsx - Units menu → Temperature units: renders
src/components/header/UnitsMenu.jsx - Units menu → Wind units: renders
src/components/header/UnitsMenu.jsx - Units menu → Precipitation units: renders
src/components/header/UnitsMenu.jsx - Units menu → Imperial option: renders
src/components/header/UnitsMenu.jsx - Temperature units → Weather state: updates units
src/components/header/Temp.jsx - Wind units → Weather state: updates units
src/components/header/Wind.jsx - Precipitation units → Weather state: updates units
src/components/header/Precipitation.jsx - Imperial option → Weather state: updates units
src/components/header/Imperial.jsx - Weather request hook → Geocoding service: looks up location
src/hooks/useWeather.jsx - Weather request hook → Forecast service: requests forecast
src/hooks/useWeather.jsx - Weather request hook → Weather state: dispatches results and status
src/hooks/useWeather.jsx - App composition → Header and fetch trigger: renders
src/App.jsx - App composition → Weather content and states: renders
src/App.jsx - Weather content and states → Weather state: reads state
src/components/weather content/WeatherContent.jsx - Weather content and states → Location search: renders
src/components/weather content/WeatherContent.jsx - Weather content and states → Forecast layout: renders
src/components/weather content/WeatherContent.jsx - Weather content and states → Hourly forecast selector: renders
src/components/weather content/WeatherContent.jsx - Forecast layout → Today details: renders
src/components/main/Main.jsx - Forecast layout → Future forecast: renders
src/components/main/Main.jsx - Today details → Today summary: renders
src/components/main/TodayDetails.jsx - Today details → Weather measurements: renders
src/components/main/TodayDetails.jsx - Weather measurements → Measurement output: renders
src/components/main/DetailList.jsx - Future forecast → Daily forecast cards: renders
src/components/main/FutureWeatherDetails.jsx - Future forecast → Future loading state: renders while loading
src/components/main/FutureWeatherDetails.jsx - Hourly forecast selector → Hourly forecast list: renders
src/components/aside/Aside.jsx - Hourly forecast list → Hourly loading state: renders while loading
src/components/aside/HourlyList.jsx - Hourly forecast list → Weather code icons: maps weather codes
src/components/aside/HourlyList.jsx - Hourly forecast list → Date and time formatting: formats times
src/components/aside/HourlyList.jsx - Hourly forecast selector → Date and time formatting: formats selected day
src/components/aside/Aside.jsx - Daily forecast cards → Date and time formatting: formats dates
src/components/main/FutureData.jsx - Daily forecast cards → Weather code icons: maps weather codes
src/components/main/FutureData.jsx - Today summary → Date and time formatting: formats date
src/components/main/TodayHeader.jsx