Welcome to my Weather App! This app provides current weather updates and weekly forecasts using the OpenWeatherMap API. With a sleek interface and accurate data, it’s your go-to tool for planning your days.
- Search Functionality: Look up the current weather for any location.
- Current Weather Display: View detailed information about the current weather.
- Weekly Weather Forecast: See the weather forecast for the upcoming days.
- Responsive Design: Optimized for various screen sizes.
- Frontend: React.js
- API: OpenWeatherMap API
- State Management: React Hooks (
useState
) - Data Fetching: XMLHttpRequest and Fetch API
- Clone this repository:
git clone https://github.com/yourusername/weather-app.git
- Navigate to the project directory:
cd weather-app
- Install dependencies:
npm install
- Start the development server:
npm run dev
- Open the app in your browser:
http://localhost:3000
- Search for a location: Enter the name of the city in the search bar and hit enter.
- View current weather: The app will display the current temperature, weather conditions, and more.
- Check the weekly forecast: Scroll down to see daily weather summaries for the week.
The app integrates with the OpenWeatherMap API to fetch weather data:
- Current Weather API: Retrieves real-time weather data.
- Forecast API: Provides 5-day weather forecasts.
Make sure to replace the API key in the code with your own from OpenWeatherMap:
const API_KEY = "YOUR_API_KEY";
- Home Page:
- Weekly Forecast:
- Ensure the API key is valid and active.
- The app currently uses static latitude and longitude values for weekly weather forecasts. Dynamic location functionality will be added in future updates.
- Add support for location-based searches (dynamic latitude/longitude).
- Improve UI/UX design with animations and enhanced responsiveness.
- Display more detailed hourly forecasts.
- Fork the repository.
- Create a new branch:
git checkout -b feature-name
- Commit your changes:
git commit -m 'Add feature name'
- Push to the branch:
git push origin feature-name
- Create a Pull Request.
This project is licensed under the MIT License. See the LICENSE file for details.
- OpenWeatherMap API for providing weather data.
- React.js documentation for guidance on building components.
Thank you for using the Weather App! Feel free to contribute or provide feedback.