This Weather App provides current weather data and a 5-day forecast for a user-specified location. The application dynamically updates the background based on the weather condition (e.g., sunny, cloudy, rainy) and offers a detailed 3-hour forecast when clicking on any day in the 5-day forecast.
- Current Weather Display: Shows the temperature, weather condition, humidity, and wind speed for the selected city.
- 5-Day Forecast: Displays weather data for the next five days, including temperature and weather icons.
- 3-Hour Forecast: Detailed forecast for the selected day.
- Dynamic Backgrounds: Updates based on weather conditions.
- Responsive Design: Adjusts to various screen sizes.
- Clone the repository:
git clone <repository-url>
- Navigate to the project directory:
cd weather-app
- Install dependencies:
npm install
- Start the development server:
npm start
- Open
http://localhost:3000
in your web browser.
The app uses the OpenWeatherMap API for weather data. To use the app:
- Sign up for an API key at OpenWeatherMap.
- Replace the
API_KEY
variable in theWeather.js
file with your own API key.
To verify API responses:
- Set up Postman and create a GET request with the URL:
https://api.openweathermap.org/data/2.5/weather?q={CITY_NAME}&appid={YOUR_API_KEY}&units=metric
- Replace
{CITY_NAME}
with the desired city and{YOUR_API_KEY}
with your API key. - Refer to the screenshots below for example Postman results.
- React: Front-end library for building user interfaces.
- Material-UI: Styling and component library for React.
- Axios: HTTP client for making API requests.
- OpenWeatherMap API: Provides weather data.
Developed for Lab Test 2 as part of the coursework.
This project is licensed under the MIT License.