This React Weather App is an interactive web application that provides real-time weather information. It allows users to select their country and city to view current weather conditions. The app automatically fetches the user's location using their IP address and displays the relevant weather data. It features a clean, user-friendly interface with dynamic weather updates.
- React: A JavaScript library for building user interfaces.
- Axios: A promise-based HTTP client for making HTTP requests.
- react-toastify: Used for displaying elegant notifications.
- Font Awesome Icons: For adding visually appealing icons.
- CSS: For styling the application.
- OpenWeatherMap API: To fetch real-time weather data.
- Clone the repository:
$ git clone https://github.com/your-username/weather_react.git
- Navigate to the project directory:
$ cd your-repo-name
- Install dependencies:
$ npm install
- Set up environment variables:
- Create a
.env
file in the root directory. - Add your OpenWeatherMap API key (You may have to create one first (https://openweathermap.org/)):
REACT_APP_WEATHER_API_KEY=your_api_key
- Run the app:
$ npm start
This runs the app in development mode. Open http://localhost:3000 to view it in the browser.
- On initial load, the app attempts to detect your location and display the weather for your city.
- You can change the location by selecting a country and a city from the dropdown lists.
- The app will display the current temperature, weather conditions, wind speed, and more.
- Contributions, issues, and feature requests are welcome. Feel free to check issues page for open issues or to open a new issue.
- Distributed under the MIT License. See LICENSE for more information.