weather
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data β all from the browser, and deployed in milliseconds.
index.ts
https://dukky--7c5b29c640bf11f087df76b3cceeab13.web.val.run
A comprehensive weather forecast application for the UK featuring:
- Interactive weather map showing current conditions across the UK
- Location-specific detailed forecasts
- 7-day weather outlook
- Current weather conditions
- Responsive design for mobile and desktop
- Weather Map: Visual representation of weather conditions across the UK
- Location Search: Enter any UK location to get detailed forecasts
- Geolocation Support: Use your current location with one click
- Detailed Forecasts: Hourly and daily weather predictions
- Current Conditions: Real-time weather data
- Mobile Responsive: Works seamlessly on all devices
- Frontend: React with TypeScript, TailwindCSS
- Backend: Hono API framework
- Weather Data: Open-Meteo API (no API key required)
- Mapping: Leaflet for interactive maps
- Geocoding: Open-Meteo geocoding API
βββ backend/
β βββ index.ts # Main API server
β βββ routes/
β βββ weather.ts # Weather data endpoints
β βββ geocoding.ts # Location search endpoints
βββ frontend/
β βββ index.html # Main HTML template
β βββ index.tsx # React app entry point
β βββ components/
β β βββ App.tsx # Main app component
β β βββ WeatherMap.tsx # Interactive weather map
β β βββ LocationSearch.tsx # Location input component
β β βββ WeatherDisplay.tsx # Weather details display
β β βββ ForecastCard.tsx # Individual forecast cards
β βββ style.css # Custom styles
βββ shared/
βββ types.ts # Shared TypeScript types
GET /api/weather?lat={lat}&lon={lon}
- Get weather data for coordinatesGET /api/geocoding?q={location}
- Search for locationsGET /api/weather/map
- Get weather data for UK map overlay
- Visit the site to see the UK weather map with real-time weather markers
- Use your location by clicking the "Use My Location" button for instant local weather
- Search for locations using the search box to find specific places
- Click on the map anywhere to get weather for that specific location
- Click on weather markers to get detailed forecasts for major UK cities
- View detailed information including:
- Current weather conditions with temperature, wind, humidity, and pressure
- 24-hour hourly forecast with precipitation and wind details
- 7-day daily forecast with min/max temperatures and weather conditions
- Sunrise/sunset times and UV index information
- Real-time weather data for 15+ major UK cities
- Click anywhere on the map to get weather for that location
- Weather markers show current temperature and conditions
- Popup details with quick forecast access
- Search for any UK location by name
- Auto-complete suggestions with location details
- Prioritizes UK locations in search results
- Shows coordinates and administrative regions
- Current Conditions: Temperature, weather description, wind speed/direction, humidity, pressure, visibility, UV index
- Hourly Forecast: Next 24 hours with temperature, precipitation, wind, and weather icons
- Daily Forecast: 7-day outlook with high/low temperatures, precipitation, wind, UV index, sunrise/sunset
- Weather Icons: Emoji-based weather representations for easy understanding
- Mobile-friendly interface that works on all screen sizes
- Touch-friendly map controls and buttons
- Optimized layout for both portrait and landscape orientations