This is a simple React-based Weather Application that allows users to search for current weather conditions in any city. The app fetches weather data from the OpenWeatherMap API and displays it in an easy-to-read format.
- City Search: Enter a city name to get the current weather information.
- Weather Details: Displays temperature, humidity, and wind speed.
- Dynamic Weather Icons: Shows different icons based on the current weather conditions.
- Error Handling: Alerts users when an error occurs, such as entering an invalid city name.
- React: A JavaScript library for building user interfaces.
- React Query: For fetching, caching, and updating asynchronous data in React.
- OpenWeatherMap API: Provides current weather data for any location.
- CSS: For styling the components.
-
Clone the repository:
git clone https://github.com/yourusername/weather-app.git
-
Navigate to the project directory:
cd weather-app -
Install the dependencies:
npm install
-
Create a
.envfile in the root directory and add your OpenWeatherMap API key:REACT_APP_API_KEY=your_openweathermap_api_key
-
Start the development server:
npm start
- Enter a city name in the input field.
- Click on the search icon or press
Enterto fetch the weather details. - The app will display the current temperature, humidity, and wind speed for the entered city.
You can deploy this app to platforms like Vercel, Netlify, or GitHub Pages.
-
Build the project:
npm run build
-
Deploy the contents of the
buildfolder to your hosting platform.
- OpenWeatherMap for providing the weather data.
- Icons used in the app are sourced from various free icon libraries.
Feel free to contribute to the project or open an issue if you find any bugs!
