Weather Forecast
summary
Real-time weather forecasting for every location. Current weather, hourly weather throughout the day.
tech stack
Next JS
React
TypeScript
Html
Tailwind CSS
Weather api
published date
last edited time
website link
Front End
Front end done with Next Js 14.2 app router
Back End
Weather data provided by weatherforecast.api it's a free api
Features
- Real-time, accurate weather conditions and forecast.
- Beautiful, clean UI and UX design fully responsive for all devices with dark and light themes.
Error Handling
- 404 Page: If the city doesn't exist in the weather API, a 404 error page is displayed.
- Action: Users can click on a "Go Back to Home" button to return to the home page.
This ensures that users are informed when attempting to access weather information for a non-existent city and provides an easy way to navigate back to the main page.
Weather Data Display
The weather forecast section will show:
- City Information: The city, state, and country.
- Current Time and Date: The current time and date.
- Temperature: Temperature in Celsius and Fahrenheit.
- Condition: Weather condition in bold.
- Feels Like Temperature: 'Feels like' temperature in Celsius and Fahrenheit.
- Last Updated: Time and date when the weather data was last updated.
Sun and Moon Section
- Sunrise Time: The time when sunrise happens.
- Sunset Time: The time when sunset happens.
- Total Daylight Time: Duration from sunrise to sunset.
- Moonrise Time: The time when moonrise happens.
- Moonset Time: The time when moonset happens.
- Total Moonlight Time: Duration from moonrise to moonset.
- Moon Phase: The moon phase for the day
Forecast for that day
- Temperature: Min, Max, and Avg in Celsius and Fahrenheit.
- Wind Speed: Max wind speed.
- Humidity: Average humidity.
- Visibility: Visibility range.
- Precipitation:
- Will it rain today? (Yes/No)
- Will it snow today? (Yes/No)
- Chances of rain (%)
- Chances of snow (%)
- Weather Conditions: Description in text.
Hourly Forecast
For 24 hours of the day, there will be 24 small cards shown in a vertical line:
- Weather Condition: Description in text and corresponding icon.
- Temperature: Temperature for that hour.
- Humidity: Humidity percentage.
- Wind Speed and Direction: Icon representation of wind speed and direction.
- Time: Hourly time.
Upon loading the page, the current time card will be centered and highlighted to indicate the current hour.