This is a simple weather application built using React. It allows users to search for a location and retrieve current weather information. The app utilizes the OpenWeatherMap API to fetch weather data based on the user's input.
- Type the name of city whose weather has to be known OR allow location access(to check weather of present location).
- Displays the present weather conditions (Temperature, Humidity, Cloud Cover) along with forecasts for the future.
- Toggle between Celsius and Fahrenheit temperature units
- Responsive design for a seamless experience on different devices
- Error handling for invalid location searches or failed API requests
- Recent searches feature that displays a list of the last five cities that the user has searched for.
- Dark and Light Theme
WeatherApp
is built using the following technologies:
React.js
: A JavaScript library for building user interfaces. Used React features likes states, contexts etc.OpenWeatherMap API
: An API that provides access to weather data, including current weather conditions, forecasts, and more.Axios
: A promise-based HTTP client for making API requests from the frontend.
To run the WeatherApp locally, follow these steps:
- Clone the repository.
- Navigate to the project directory:
cd WeatherAPP
- Install the dependencies:
npm install
- Create a free account on OpenWeatherMap to obtain an API key.
- Create a .env file and replace
<YOUR_API_KEY>
with your actual API key. - Start the development server:
npm start
- Open your web browser and visit
http://localhost:3000
to access the WeatherApp.