This repository contains the source code for a weather application built using React.js. The app fetches weather data from the OpenWeatherMap API and displays the current weather conditions for a specified location. It includes features like temperature, humidity, wind speed, and weather descriptions.
- React.js: A JavaScript library for building user interfaces.
- CSS: For styling the application.
- OpenWeatherMap API: For fetching weather data.
- Fetch: For making HTTP requests.
- Current Weather Information: Displays the current weather conditions for a specified location.
- Temperature: Shows the current temperature in Celsius or Fahrenheit.
- Humidity: Displays the current humidity level.
- Wind Speed: Shows the current wind speed.
- Weather Description: Provides a brief description of the current weather conditions.
- Search Functionality: Allows users to search for the weather in different cities.
Follow these steps to set up the project locally:
-
Clone the repository
git clone https://github.com/yourusername/weather-app.git cd weather-app
-
Install dependencies
npm install
-
Set up OpenWeatherMap API Key
- Go to OpenWeatherMap and sign up for an API key.
- Create a
.env
file in the root directory of the project and add your API key:REACT_APP_WEATHER_API_KEY=your_api_key_here
-
Start the development server
npm start
The app should now be running on
http://localhost:3000
.
- Enter City Name: Type the name of the city you want to search for in the input field.
- View Weather Data: The app will display the current weather information for the specified city, including temperature, humidity, wind speed, and a brief description.
- The temperature can be toggled between Celsius and Fahrenheit by updating the relevant code or UI component that handles this functionality (implementation may vary).
Contributions are welcome! Please follow these steps to contribute:
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch
). - Make your changes.
- Commit your changes (
git commit -m 'Add new feature'
). - Push to the branch (
git push origin feature-branch
). - Create a pull request.
- Thanks to the developers of React and Axios for their excellent libraries.
- Special thanks to OpenWeatherMap for providing the weather data API.
- Thanks to all contributors who have helped improve this project.