How abdulrhman-hosseini/weather-dashboard works
WeatherNow is a React weather dashboard. Users search a city or choose a popular city; the root app invokes the weather hook, which geocodes the city and fetches current, hourly, and seven-day data from Open-Meteo. The app then renders current conditions, hourly trends, daily forecasts, and a sunrise/sunset widget. Component-to-app and hook-to-API relationships are evidenced by excerpts; the external API calls are visible in the API client. Styling and responsive presentation are not expanded into separate components.
Main entry points: App.jsx Dashboard coordinator · weather.js Open-Meteo client · SearchBar.jsx City search form · useWeather.js Weather state hook
Components 11
City Search
- Dashboard coordinator
src/App.jsx - City search form
src/components/SearchBar.jsx
Weather Retrieval
- Weather state hook
src/hooks/useWeather.js - Open-Meteo client
src/api/weather.js
Weather Views
- Current conditions
src/components/HeroCard.jsx - Hourly trends chart
src/components/HourlyChart.jsx - Seven-day forecast
src/components/Forecast.jsx - Sunrise sunset arc
src/components/SunriseSunset.jsx
Other components
- Dashboard user
- Open-Meteo geocoding
- Open-Meteo forecast API
Connections 13
- Dashboard user → City search form: enters city
src/components/SearchBar.jsx - Dashboard user → Dashboard coordinator: selects quick city
src/App.jsx - City search form → Dashboard coordinator: submits search
src/App.jsx - Dashboard coordinator → Weather state hook: starts search
src/App.jsx - Dashboard coordinator → Current conditions: renders conditions
src/App.jsx - Dashboard coordinator → Hourly trends chart: renders hourly data
src/App.jsx - Dashboard coordinator → Seven-day forecast: renders daily data
src/App.jsx - Dashboard coordinator → Sunrise sunset arc: renders sun data
src/App.jsx - Weather state hook → Open-Meteo client: calls geocode and fetch
src/hooks/useWeather.js - Open-Meteo client → Open-Meteo geocoding: requests coordinates
src/api/weather.js - Open-Meteo client → Open-Meteo forecast API: requests forecast
src/api/weather.js - Current conditions → Open-Meteo client: interprets weather code
src/components/HeroCard.jsx - Seven-day forecast → Open-Meteo client: interprets weather code
src/components/Forecast.jsx