A simple and intuitive weather application built using React that provides real-time weather updates for any city. This app fetches data from the OpenWeather API and displays temperature, humidity, wind speed, and weather conditions with a clean and responsive UI.
✅ Search Weather by City – Get weather details for any location in the world. ✅ Real-time Weather Data – Fetches up-to-date weather data using OpenWeather API. ✅ Dynamic UI – Changes background and icons based on weather conditions. ✅ Temperature, Humidity, and Wind Speed – Essential weather information at a glance. ✅ Fully Responsive Design – Works across all devices (mobile, tablet, desktop). ✅ Error Handling – Displays meaningful messages for invalid city searches.
- Frontend: React
- API: OpenWeather API
- State Management: useState, useEffect
-
Clone the repository:
git clone https://github.com/your-username/weather-app.git cd weather-app -
Install dependencies:
npm install
-
Get API Key from OpenWeather:
- Visit OpenWeather
- Sign up and get your API key
-
Create an
.envfile and add your API key:REACT_APP_WEATHER_API_KEY=your_api_key_here
-
Run the application:
npm start
-
Open in Browser: The app will be running at http://localhost:3000
weather-app/
├── public/
│ ├── index.html
│ └── assets/
├── src/
│ ├── components/
│ │ ├── WeatherCard.js
│ │ ├── SearchBar.js
│ ├── pages/
│ │ ├── Home.js
│ ├── utils/
│ │ ├── api.js
│ ├── App.js
│ ├── index.js
├── .env
├── .gitignore
├── package.json
├── README.md
- 🌍 Weather Forecast – 5-day forecast with hourly updates.
- 🎨 Dark Mode – A toggle option for dark/light themes.
- 📍 User Location – Auto-detect user’s location for local weather updates.
- 📊 Additional Weather Data – Air quality index, UV index, and more.
Contributions are welcome! If you’d like to improve this project, follow these steps:
- Fork the repository
- Create a feature branch:
git checkout -b feature-branch - Commit changes:
git commit -m 'Added new feature' - Push to GitHub:
git push origin feature-branch - Create a Pull Request
This project is licensed under the MIT License.