The Weather App is a simple React application that allows users to fetch and display weather information for multiple cities using the OpenWeatherMap API. Users can also delete weather cards for specific cities.
- Fetch weather data for multiple cities using the OpenWeatherMap API.
- Display city names and temperatures in Celsius.
- Delete weather cards for specific cities.
To run the Weather App locally on your machine, follow the steps below:
- Clone this repository to your local machine using Git:
git clone https://github.com/your-username/weather-app.git
2.Navigate to the project directory:
cd weather-app
- Install the required dependencies using npm:
npm install
-
Get your OpenWeatherMap API key:
-
Sign up for a free account on OpenWeatherMap (https://openweathermap.org/).
-
Obtain your API key from the dashboard.
-
Replace YOUR_OPENWEATHERMAP_API_KEY in src/api.js and src/App.js with your actual API key.
-
Run the development server: npm start.
-
Open your web browser and visit http://localhost:3000 to access the Weather App.
- Enter the name of a city in the input field.
- Click the "Get Weather" button to fetch weather information for the specified city.
- The app will display the city name and temperature in Celsius.
The App
component is the main component of the Weather App. It handles fetching weather data, displaying weather cards, and managing delete functionality.
The fetchWeatherData
function in the api.js
file is responsible for making API requests to OpenWeatherMap to retrieve weather data.
- React (Create React App),
- HTML/CSS,
- OpenWeatherMap API,
- Weather data is fetched from the OpenWeatherMap API (https://openweathermap.org/).
- This project was created as part of a learning exercise.