šŸŒ¤ļø Weather Forecast Website

A modern, responsive weather forecast website that provides current conditions and 7-day forecasts for any location worldwide.

Features

  • šŸŒ Global weather data using Open-Meteo API (no API key required)
  • šŸ“± Responsive design that works on desktop and mobile
  • šŸŽØ Beautiful, modern UI with weather icons and gradients
  • šŸ“Š Detailed weather information including:
    • Current temperature and conditions
    • 7-day forecast
    • Humidity, wind speed, and pressure
    • Hourly temperature chart
  • šŸ” Location search with autocomplete
  • šŸ“ Geolocation support

Tech Stack

  • Backend: Hono.js API framework
  • Frontend: React with TypeScript
  • Styling: TailwindCSS
  • Weather Data: Open-Meteo API
  • Geocoding: Open-Meteo Geocoding API

Project Structure

ā”œā”€ā”€ backend/
│   ā”œā”€ā”€ index.ts           # Main API server
│   └── routes/
│       └── weather.ts     # Weather API endpoints
ā”œā”€ā”€ frontend/
│   ā”œā”€ā”€ index.html         # Main HTML template
│   ā”œā”€ā”€ index.tsx          # React app entry point
│   └── components/
│       ā”œā”€ā”€ App.tsx        # Main app component
│       ā”œā”€ā”€ WeatherCard.tsx # Current weather display
│       ā”œā”€ā”€ Forecast.tsx   # 7-day forecast
│       └── SearchBar.tsx  # Location search
└── shared/
    └── types.ts           # Shared TypeScript types

Usage

  1. Visit the website
  2. Search for any city or location
  3. View current weather and 7-day forecast
  4. Click on forecast days for detailed information

API Endpoints

  • GET /api/weather?lat={lat}&lon={lon} - Get weather data for coordinates
  • GET /api/geocode?q={query} - Search for locations