The Weather App is a responsive, dynamic React web application that allows users to search any city and view detailed current weather conditions. It integrates with the OpenWeather and OpenUV APIs, and visually enhances the user experience with background and icon updates that reflect real-time weather.
- 🔍 Search by City Name
- Instantly look up weather conditions by typing a city name.
- 🌡️ Current Weather Data
- Includes:
- Temperature (°C)
- Feels like temperature (°C)
- Maximum temperature (°C)
- Minimum temperature (°C)
- Weather description
- Weather icon
- Includes:
- 📈 5-Day Weather Forecast
- 🌬️ Extra Weather Details
- Includes:
- UV Index
- Wind speed
- Humidity & pressure
- Visibility
- Cloudiness
- Rainfall & Snowfall (last 1 hour)
- Includes:
- 🖼️ Auto-Updating Background & Icon
- Visuals dynamically change based on the current weather (e.g., clear, rainy, snowy).
- 📱 Responsive UI
- Designed to be mobile-friendly and adaptive across screen sizes.
| Layer | Technology |
|---|---|
| Frontend | React.js, JSX, CSS (Flexbox / Grid) |
| API | OpenWeather API, OpenUV API |
| Data Fetch | Axios |
| State Mgmt | React useState & useEffect |
| Build Tool | Vite |
| Env Config | Vite + .env file with VITE_ prefix |
| Version Control | Git, GitHub |
Before you begin, make sure the following are installed in your development environment:
⚠️ You must also register for API keys ( OpenWeather API and OpenUV API ) to use this app.
git clone https://github.com/TingWai-85/weather-app.git
cd weather-appnpm installCreate a .env file in the root directory:
touch .envOpen the .env file and add the following variables (replace with your actual API key):
VITE_OPEN_WEATHER_API=your_open_weather_api_key
VITE_OPEN_UV_API="your_open_uv_api_key
⚠️ Note: Environment variables must start withVITE_to be used in React (Vite projects).
npm run devOpen the local URL provided by Vite (e.g., http://localhost:5173) in your browser to use the app.
Watch the setup tutorial on YouTube.
- 📍 Auto-detect location & show local weather
- 🔔 Severe weather alerts
- 🌙 Dark mode toggle
- 🌐 Multi-language support
- OpenWeather API
- OpenUV API
- React
- Vite
- Pexels — for background images
- Flaticon — for weather icons
©2025 TingWai-85
This project is part of a personal learning journey in building modern, API-driven React applications.