A professional-grade, full-featured weather web application built with Next.js 14+, Tailwind CSS, and WeatherAPI.com.
- 🌡️ Current temperature, feels-like, dew point
- 💧 Humidity with visual indicator
- 💨 Wind speed, direction, compass visualization
- 👁️ Visibility with quality description
- 🌡️ Atmospheric pressure (hPa/inHg/mmHg)
- ☁️ Cloud cover percentage
- 🌅 Sunrise/Sunset times
- 🌙 Moon phase with emoji indicators
- ☀️ UV Index with gauge visualization
- ⏱️ 24-Hour Forecast — 3-hour intervals with chart
- 📅 7-Day Forecast — High/low temps, rain chance, moon phase
- 📊 Interactive Charts — Recharts-powered temperature & precipitation
- 🌬️ Wind Compass — Real-time directional visualization
- 💨 Air Quality Index — PM2.5, PM10, O₃, NO₂, SO₂, CO breakdown
- 🌡️ Pressure Trends — With unit conversion
- 🌫️ Visibility Analysis — Quality descriptions
- ☁️ Cloud Cover — Visual cloud representation
- 🔍 City Search — Auto-suggest with debounce
- 📍 Geolocation — Browser-based current location
- ⭐ Favorites — Save up to 10 locations (localStorage)
- 🕐 Recent Searches — Last 5 searches remembered
- 🌡️ Temperature: °C / °F
- 💨 Wind: km/h / mph / m/s
- 🌡️ Pressure: hPa / inHg / mmHg
- 📏 Distance: km / miles
⚠️ Weather Alerts panel- 🔄 Manual refresh button
- 💀 Beautiful loading skeletons
cd weather-app
npm installGo to weatherapi.com and sign up for a free account.
- Free tier: 1,000,000 calls/month
- Includes: Current weather, 3-day forecast, search, astronomy
For more forecast days (up to 14) and Air Quality, the free tier works fine.
Optional: For standalone AQI data, also get a free key from openweathermap.org
cp .env.local.example .env.localEdit .env.local:
WEATHERAPI_KEY=your_actual_key_here
OPENWEATHER_API_KEY=your_openweather_key_here # Optionalnpm run devweather-app/
├── app/
│ ├── api/
│ │ ├── weather/route.ts # Main weather data endpoint
│ │ ├── search/route.ts # Location search endpoint
│ │ └── aqi/route.ts # Air quality endpoint
│ ├── city/[city]/page.tsx # Dynamic city weather page
│ ├── layout.tsx # Root layout with providers
│ ├── page.tsx # Home/landing page
│ └── globals.css # Global styles
├── components/
│ └── weather/
│ ├── Navbar.tsx # Navigation with search
│ ├── SearchBar.tsx # Search with autocomplete
│ ├── CurrentWeather.tsx # Main weather hero card
│ ├── HourlyForecast.tsx # 24-hour forecast + chart
│ ├── DailyForecast.tsx # 7-day forecast + chart
│ ├── WeatherDetails.tsx # Wind compass, AQI, humidity, etc.
│ ├── WeatherAlerts.tsx # Severe weather alerts
│ ├── SettingsPanel.tsx # Unit preferences modal
│ └── LoadingSkeleton.tsx # Loading state UI
├── context/
│ └── WeatherContext.tsx # Global state (preferences, favorites)
├── lib/
│ ├── weatherApi.ts # API fetching functions
│ └── utils.ts # Unit conversion utilities
├── types/
│ └── weather.ts # TypeScript interfaces
└── public/
└── manifest.json # PWA manifest
| Technology | Purpose |
|---|---|
| Next.js 14 | Framework (App Router) |
| TypeScript | Type safety |
| Tailwind CSS | Styling |
| Recharts | Charts & visualizations |
| Lucide React | Icons |
| Framer Motion | Animations |
| React Hot Toast | Notifications |
| WeatherAPI.com | Weather data |
- Dark glassmorphism aesthetic with backdrop blur effects
- Syne display font + DM Sans body font
- Animated gradients and noise texture overlays
- Custom weather icons from WeatherAPI CDN
- Fully responsive mobile-first design
| Route | Description |
|---|---|
GET /api/weather?q=London&days=7 |
Fetch weather + forecast |
GET /api/search?q=Lon |
Search locations |
GET /api/aqi?lat=51.5&lon=-0.12 |
Air quality data |
npm run build
npm startEdit FEATURED_CITIES in app/page.tsx
Edit the color tokens in tailwind.config.js
Integrate OpenWeatherMap Tiles or Windy API
Use Next.js PWA libraries like next-pwa and the Web Push API
Built with ❤️ using Next.js 14 + WeatherAPI.com