How faisal-666/odin-weather-app works
Weather App lets users search a location and view current conditions and a multi-day forecast, select forecast days, and switch temperature units. The handler owns the search-to-display workflow: it fetches data through the injected service, transforms the response, manages state and loading/errors, and updates the main and forecast views. Background selection and formatting are supporting presentation logic. README documents these capabilities; relationships not visible in the sampled source are omitted.
Main entry points: handler.js Main handler · mainContent.js Current conditions · aside.js Forecast and controls · weatherapi.services.js Weather service
Components 16
Application orchestration
- App entry
src/index.js - Main handler
src/handler.js
Weather data
- Weather service
src/services/weatherapi.services.js - Response transformer
src/utils/rawDataTransformer.js
Weather interface
- Search header
src/components/header/header.js - Current conditions
src/components/main-content/mainContent.js - Forecast and controls
src/components/side-content/aside.js - Loading indicator
src/components/loader/loaderComponent.js - Empty and error state
src/components/empty-state/emptyState.js
Presentation utilities
- Background selector
src/utils/backgroundChanger.js - Condition mapping
src/utils/mapCondition.js - Temperature formatter
src/utils/displayTemp.js - Date formatter
src/utils/formatTimeEpoch.js - Forecast day formatter
src/utils/getDayFromDate.js
Other components
- Weather user
- Visual Crossing API
Connections 18
- Weather user → Search header: searches location
src/components/header/header.js - App entry → Main handler: initializes
src/index.js - App entry → Weather service: injects API
src/index.js - Main handler → Search header: creates; handles search
src/handler.js - Main handler → Weather service: requests weather
src/handler.js - Weather service → Visual Crossing API: fetches weather
src/services/weatherapi.services.js - Main handler → Response transformer: transforms response
src/handler.js - Main handler → Loading indicator: shows during fetch
src/handler.js - Main handler → Empty and error state: shows errors and prompt
src/handler.js - Main handler → Current conditions: creates and updates
src/handler.js - Main handler → Forecast and controls: creates and updates
src/handler.js - Current conditions → Background selector: sets weather background
src/components/main-content/mainContent.js - Background selector → Condition mapping: maps conditions and time
src/utils/backgroundChanger.js - Current conditions → Temperature formatter: formats temperatures
src/components/main-content/mainContent.js - Forecast and controls → Temperature formatter: formats temperatures
src/components/side-content/aside.js - Current conditions → Date formatter: formats dates
src/components/main-content/mainContent.js - Forecast and controls → Date formatter: formats dates
src/components/side-content/aside.js - Forecast and controls → Forecast day formatter: formats forecast days
src/components/side-content/aside.js