A simple weather dashboard app that allows users to search for weather conditions by city or use their current location to get weather updates. This app fetches weather data from the OpenWeatherMap API and provides a 5-day weather forecast.
- City Search: Enter a city name to get current weather conditions and a 5-day forecast.
- Current Location: Use your current location to get weather information.
- Responsive Design: Works well on various devices and screen sizes.
- Detailed Weather Data: Displays temperature, wind speed, and humidity.
- HTML: Structure of the web page.
- CSS: Styling for a modern, responsive design.
- JavaScript: Functionality for fetching and displaying weather data.
- OpenWeatherMap API: Provides weather data and forecasts.
To run this project locally, follow these steps:
-
Clone the Repository:
git clone https://github.com/your-username/weather-dashboard.git
-
Navigate to the Project Directory:
cd weather-dashboard -
Set Up Your Environment:
Ensure you have a
.envfile in the root of your project directory with your OpenWeatherMap API key:API_KEY=your-openweathermap-api-key -
Open the Project:
Open
index.htmlin your browser.
-
Search by City: Enter the name of a city into the input field and click the "Search" button to view current weather conditions and a 5-day forecast.
-
Use Current Location: Click the "Use Current Location" button to get weather information based on your current location.
Here is a screenshot of the app:
If you want to contribute to this project, follow these steps:
-
Fork the Repository.
-
Create a New Branch:
git checkout -b feature/new-feature
-
Commit Your Changes:
git add . git commit -m "Add a new feature"
-
Push to the Branch:
git push origin feature/new-feature
-
Create a Pull Request.
- OpenWeatherMap: For providing the weather data API.
