This project is a weather application built with React and Vite. It fetches and displays current weather, weekly forecasts, and hourly data for selected locations using WeatherAPI.com.
- Current Weather: Displays current temperature, condition, and additional info.
- Weekly Forecast: Shows a 7-day weather forecast.
- Hourly Data: Provides hourly temperature, precipitation, and wind data.
- Location Search: Autocomplete search for locations with saved locations.
- Unit Toggle: Switch between Celsius and Fahrenheit.
Check out the live demo of the app here.
-
Clone the repository:
git clone https://github.com/jcowens/vite-weather-app.git cd vite-weather-app
-
Install dependencies:
npm install
-
Create a
.env
file in the root directory and add your WeatherAPI key:VITE_WEATHER_API_KEY=your_api_key_here
-
Start the development server:
npm run dev
- Search for a Location: Use the search bar to find and select a location. The selected location will be saved in local storage.
- View Weather Data: The app displays current weather, weekly forecast, and hourly data for the selected location.
- Toggle Units: Switch between Celsius and Fahrenheit using the unit toggle.
- Sunrise and Sunset Chart
- Live Radar
- React
- Vite
- Material UI
- Axios
- Date-fns
- React Chart.js 2
Contributions are welcome! Please open an issue or submit a pull request on GitHub.