A beautiful, feature-rich weather application built with React, Vite, and Tailwind CSS. Get real-time weather data, forecasts, and weather alerts for any city worldwide.
- 🌍 Global Weather Search - Search for weather in any city worldwide
- 📍 Location Detection - Automatic weather for your current location
- 🔄 Auto-refresh - Refresh weather data with one click
- 💾 Smart Memory - Remembers your last searched city
- 🌡️ Unit Toggle - Switch between Celsius and Fahrenheit
- ⚡ Fast & Responsive - Built with Vite for lightning-fast performance
- 📊 Current Weather - Real-time temperature, conditions, and more
- 📅 5-Day Forecast - Daily weather predictions
- ⏰ Hourly Forecast - Hour-by-hour weather for today
- 🌅 Sunrise & Sunset - Accurate sun times
- 💨 Wind Information - Speed and direction
- 💧 Humidity & Pressure - Detailed atmospheric data
- 👁️ Visibility - Current visibility range
- ☁️ Cloud Coverage - Cloudiness percentage
⚠️ Weather Alerts - Smart warnings for:- Extreme heat/cold
- Strong winds
- Low visibility
- High humidity
- Thunderstorms
- Snow conditions
- 🎨 Beautiful UI - Glassmorphism design with smooth animations
- ✨ Animated Background - Dynamic particle effects
- 📱 Fully Responsive - Works perfectly on all devices
- 🌈 Gradient Design - Modern purple/blue gradient theme
- Node.js (v16 or higher)
- npm or yarn
- OpenWeatherMap API key (free tier available)
-
Clone or download the repository
-
Install dependencies
npm install
-
Get your API key
- Visit OpenWeatherMap
- Sign up for a free account
- Get your API key from the dashboard
-
Configure environment variables
- The
.envfile is already created - Replace
your_api_key_herewith your actual API key:
VITE_OPENWEATHER_API_KEY=your_actual_api_key_here
- The
-
Start the development server
npm run dev
-
Open your browser
- Navigate to
http://localhost:5173 - Start searching for weather!
- Navigate to
# Development server (with hot reload)
npm run dev
# Build for production
npm run build
# Preview production build
npm run preview- Enter a city name in the search bar
- Press Enter or click the "Search" button
- View detailed weather information
- Click the "📍 My Location" button
- Allow location access when prompted
- Weather for your location will be displayed
- Click any of the quick-select city buttons (Baku, London, New York, Tokyo, Paris, Dubai)
- Click the °C/°F button to switch between Celsius and Fahrenheit
- Click the 🔄 button to refresh current weather data
- React 18 - UI library
- Vite 5 - Build tool and dev server
- Tailwind CSS 3 - Utility-first CSS framework
- OpenWeatherMap API - Weather data provider
- Canvas API - Animated background particles
- Glassmorphism - Modern frosted glass effect
- Gradient Accents - Purple to blue gradients
- Smooth Animations - Slide-up, float, and hover effects
- Custom Fonts - Orbitron (display) and Outfit (body)
- Responsive Grid - Adapts to any screen size
- Neon Glow Effects - Subtle glowing borders
- Particle Background - Animated particle connections
weather-app/
├── public/ # Static assets
├── src/
│ ├── components/ # React components
│ │ ├── Background.jsx # Animated particle background
│ │ ├── Forecast.jsx # 5-day + hourly forecast
│ │ ├── SearchBar.jsx # Search and controls
│ │ └── WeatherCard.jsx # Main weather display
│ ├── App.jsx # Main app component
│ ├── index.css # Tailwind styles
│ └── main.jsx # App entry point
├── .env # Environment variables (API key)
├── .env.example # Example env file
├── index.html # HTML entry point
├── package.json # Dependencies
├── tailwind.config.js # Tailwind configuration
└── vite.config.js # Vite configuration
Custom animations and theme extensions:
- Float animation for weather icons
- Slide-up animation for content
- Fade-in animation
- Custom font families (Orbitron, Outfit)
- Extended color palette
VITE_OPENWEATHER_API_KEY=your_api_key_here- Make sure you've activated your API key on OpenWeatherMap
- It may take a few minutes for new keys to activate
- Check that your key is correctly entered in the
.envfile - Restart the dev server after changing environment variables
- Allow location access in your browser
- Check browser permissions for location services
- Try using the search function instead
- Delete
node_modulesand runnpm installagain - Clear cache:
npm cache clean --force - Make sure you're using Node.js v16+
- Your API key is stored locally in
.envand not exposed in the frontend - Location data is only used when you explicitly request it
- No user data is collected or stored on external servers
- Weather data is fetched directly from OpenWeatherMap
This project is open source and available for educational and personal use.
- Weather data provided by OpenWeatherMap
- Icons and weather codes from OpenWeatherMap
- Built with ❤️ using React and Vite
Feel free to fork this project and submit pull requests for any improvements!
If you encounter any issues or have questions:
- Check the Troubleshooting section above
- Visit OpenWeatherMap Documentation
- Check Vite documentation for build issues
Enjoy using Weather Pro! ☀️🌧️❄️