This single-page weather forecast application allows users to check the current weather details and a 5-day forecast for a selected city. The application utilizes the OpenWeatherMap API for weather data retrieval.
Weather Forecast App - Live Demo
Users can enter a city name to view the current weather details, including:
- Current Temperature
- Minimum and Maximum Temperature
- Humidity
- Wind Speed and Direction
- Description of the Weather
- Weather Icon reflecting the current conditions
The application provides a 5-day forecast for the selected city, displaying:
- Date
- Average Temperature
- Description of the Weather
- Weather Icon
Users can toggle between Celsius and Fahrenheit to view temperature details in their preferred units.
The application is implemented using HTML, CSS, and JavaScript with the ReactJS library. The code follows best practices, ensuring maintainability and readability.
-
src/components/: Contains React components.
- Day.jsx: Component for entering the city name and fetching weather data.
- FiveDay.js: Component to display weather details for next five days.
- Map.js: Component to display the Map of the selected city.
-
src/Context/: Contains the API service for fetching weather data.
- Context.jsx: To Handle all the API calls.
-
src/styles/: Holds CSS files for styling.
- App.module.css: Global styles for the application.
The application is designed to look and function well on both desktop and mobile devices. Responsive CSS ensures a seamless user experience across various screen sizes.
Clear error messages are displayed for scenarios such as invalid city names or API errors, providing a user-friendly experience.
- Clone the repository.
- Install dependencies using
npm install. - Obtain an API key from OpenWeatherMap and replace the placeholder in WeatherService.js.
- Run the application using
npm run dev.
Feel free to explore the codebase, make improvements, and contribute to the development of this weather forecast application. If you encounter any issues or have suggestions, please open an issue or submit a pull request.
Happy forecasting! 🌦️

