A full-stack web application that helps users assess the likelihood of adverse weather conditions for any location and day of the year, using 20 years of historical weather data.
- Interactive MapLibre Map Interface: Click anywhere on the map or search for a location
- Location Search: Powered by OpenStreetMap Nominatim geocoding
- Date Selection: Pick any day of the year to analyze
- AI Weather Insights: Client-side AI-powered summaries using WebLLM (runs in your browser!)
- Weather Categories:
- Very Hot (>90Β°F) - NOAA Heat Index Guidelines
- Very Cold (<32Β°F) - NOAA Freeze Warning
- Very Windy (>25 mph) - NWS Wind Advisory
- Very Wet (>0.5 inches) - NOAA Heavy Rain
- Very Uncomfortable (heat+humidity OR wind+rain)
- Historical Data Analysis: 20 years of weather data (2004-2024)
- Probability Calculations: Statistical analysis with detailed counts ("9 of 20 years")
- Visual Charts: Interactive bar and line charts using Recharts
- Data Export: Download results as CSV or JSON
- Climate Trend Analysis: Track how weather patterns have changed over time
- AI-Powered Insights: Get intelligent summaries with actionable tips (WebGPU-powered)
- Scientific Definitions: NOAA/NASA-based thresholds with citations
- Detailed Tooltips: Raw counts and exact thresholds in hover tooltips
- Mobile-Friendly: Responsive design for all devices
- Fast & Clean UI: Built with Tailwind CSS
- Real-time Analysis: Instant results after location selection
- Professional Design: Modern, gradient-based interface
- Framework: Next.js 14 with App Router
- UI Library: React 18
- Language: TypeScript
- Styling: Tailwind CSS
- Maps: MapLibre GL + react-map-gl
- Charts: Recharts
- Icons: Lucide React
- Date Handling: date-fns
- AI: WebLLM (client-side LLM via WebGPU)
- API Routes: Next.js API Routes
- Data Source: Open-Meteo Historical Weather Archive API
- Geocoding: OpenStreetMap Nominatim
- Node.js 18 or higher
- npm or yarn package manager
- Clone the repository
git clone <your-repo-url>
cd Project-BlueSky- Install dependencies
npm install
# or
yarn install- Run the development server
npm run dev
# or
yarn dev- Open your browser Navigate to http://localhost:3000
-
Select a Location:
- Click anywhere on the map to drop a pin
- OR use the search bar to find a specific city/address
-
Choose a Date:
- Use the calendar widget to select any day of the year
- The current date is selected by default
-
Analyze Weather:
- Click the "Analyze Weather" button
- Wait for the historical data to be fetched and analyzed
-
View Results:
- See probability percentages for each weather category
- View interactive charts
- Check climate trends over the past 20 years
- Read the summary statement
-
Enable AI Assistant (Optional):
- Click "Enable AI" in the AI Weather Assistant card
- Wait for model to load (30-60 seconds first time)
- Get personalized, intelligent summaries with actionable tips
- Ask follow-up questions in chat mode!
- Example: "What's the best time for outdoor activities?"
- Works entirely in your browser (privacy-first!)
-
Export Data:
- Click "CSV" to download as spreadsheet
- Click "JSON" to download raw data
- Runs 100% locally in your browser using WebLLM
- Multi-turn conversations - Ask follow-up questions!
- Context-aware - AI remembers your conversation
- No data sent to servers - completely private
- Generates intelligent summaries based on probabilities and trends
- Provides actionable recommendations
- Advanced controls: Adjust temperature and response length
- Export chat transcripts as text files
- Falls back to template mode on unsupported browsers
- Chrome 113+ or Edge 113+ (WebGPU support)
- Modern GPU (NVIDIA GTX 900+, AMD RX 400+, Intel Iris+)
- ~500MB storage for model cache (one-time download)
- Works on all devices and browsers
- Rule-based summaries when WebGPU unavailable
- Fast and reliable alternative
See AI_INSIGHTS_GUIDE.md for detailed documentation
- App queries Open-Meteo Archive API for historical weather data
- Fetches data for the selected date across 20 years (2004-2024)
- Retrieves: temperature, precipitation, wind speed, humidity
- Very Hot: Days when max temperature β₯ 95Β°F
- Very Cold: Days when min temperature β€ 32Β°F
- Very Windy: Days when max wind speed β₯ 25 mph
- Very Wet: Days when precipitation β₯ 0.5 inches
- Very Uncomfortable: Days with (high heat + high humidity) OR (wind + rain)
Probability = (Days meeting criteria / Total days analyzed) Γ 100
- Data split into two 10-year periods
- Compares probability changes between periods
- Identifies increasing, decreasing, or stable trends
- Helps visualize climate change impacts
Analyzes weather probabilities for a specific location and date.
Request Body:
{
"latitude": 37.7749,
"longitude": -122.4194,
"date": "2024-07-15T00:00:00.000Z"
}Response:
{
"probability": {
"veryHot": 45.0,
"veryCold": 0.0,
"veryWindy": 15.5,
"veryWet": 5.0,
"veryUncomfortable": 25.0
},
"trendAnalysis": [
{
"category": "Very Hot",
"trend": "increasing",
"changePercent": 12.5
}
],
"historicalData": [...],
"dataPoints": 20
}Project-BlueSky/
βββ src/
β βββ app/
β β βββ api/
β β β βββ weather/
β β β βββ analyze/
β β β βββ route.ts # Weather analysis API
β β βββ layout.tsx # Root layout
β β βββ page.tsx # Main page
β β βββ globals.css # Global styles
β βββ components/
β βββ MapComponent.tsx # Interactive map
β βββ DateSelector.tsx # Calendar picker
β βββ WeatherAnalysis.tsx # Results display
βββ public/ # Static assets
βββ package.json
βββ tsconfig.json
βββ tailwind.config.js
βββ next.config.js
You can customize weather thresholds in src/app/api/weather/analyze/route.ts:
const VERY_HOT_THRESHOLD = 95 // Β°F
const VERY_COLD_THRESHOLD = 32 // Β°F
const VERY_WINDY_THRESHOLD = 25 // mph
const VERY_WET_THRESHOLD = 0.5 // inches
const UNCOMFORTABLE_HEAT_INDEX_TEMP = 85 // Β°F
const UNCOMFORTABLE_HUMIDITY = 70 // %To change the analysis period, modify:
const startYear = currentYear - 20 // Change 20 to desired yearsnpm install -g vercel
vercelnpm run build
npm start- Check browser console for errors
- Ensure you have internet connection
- MapLibre requires WebGL support
- Some remote locations may have limited historical data
- Try a major city to verify functionality
- Check Open-Meteo API status
- Fetching 20 years of data takes time
- Consider implementing caching for frequently queried locations
- API calls are made sequentially to respect rate limits
This project is open source and available under the MIT License.
- Open-Meteo: Historical weather data API
- OpenStreetMap: Geocoding and map tiles
- MapLibre: Open-source map library
- Recharts: Beautiful charting library
- Cache historical data to improve performance
- Add more weather categories (severe storms, snow, etc.)
- Compare multiple locations side-by-side
- Historical event correlation (e.g., El NiΓ±o years)
- Share analysis via URL
- Dark mode support
- Multi-language support
For issues, questions, or contributions, please open an issue on GitHub.
Built using Next.js, React, and Open-Meteo API