Skip to content

codekshitij/HyperCast

Repository files navigation

HyperCast ๐ŸŒฆ๏ธ

AI-Driven Hyper-Local Weather Forecasting System

Python PyTorch FastAPI License

A machine learning-powered weather forecasting application that generates predictions without relying on traditional weather APIs. Built with LSTM neural networks, real NOAA data, and a stunning PWA interface.

HyperCast Demo


โœจ Features

  • ๐Ÿง  LSTM Neural Network - Custom-trained model for temperature prediction
  • ๐ŸŒ NOAA GFS Data - Downloads and processes real meteorological data
  • โšก FastAPI Backend - High-performance REST API
  • ๐ŸŽจ Premium UI - Glassmorphism design with animations
  • ๐Ÿ“ฑ Progressive Web App - Offline-capable, mobile-friendly
  • ๐Ÿ”ฎ No API Dependencies - Generates own predictions

๐Ÿš€ Quick Start

Prerequisites

  • Python 3.13+
  • Homebrew (macOS) or equivalent
  • 2GB+ free disk space

Installation

# 1. Clone repository
git clone https://github.com/codekshitij/HyperCast.git
cd HyperCast

# 2. Install system dependencies (macOS)
brew install eccodes

# 3. Set up data processing
cd data/processing
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt

# 4. Set up ML service
cd ../../services/ml
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt

# 5. Set up API
cd ../api
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt

Running the Application

# Terminal 1: Start API
cd services/api
source venv/bin/activate
uvicorn app.main:app --host 127.0.0.1 --port 8000

# Terminal 2: Start Frontend
cd frontend
python3 -m http.server 3000

# Open: http://localhost:3000

๐Ÿ“Š Architecture

NOAA GFS Data โ†’ GRIB Parser โ†’ Feature Engineering โ†’ LSTM Model
                                                         โ†“
Browser (PWA) โ† FastAPI โ† Inference Engine โ† Trained Model

๐Ÿง  Machine Learning

Model Architecture

  • Type: LSTM (Long Short-Term Memory)
  • Layers: 2 LSTM layers (64 hidden units each)
  • Parameters: 14,113 trainable weights
  • Framework: PyTorch 2.7.1
  • Training: Early stopping, GPU acceleration (MPS)
  • Validation Loss: 0.1398

Training Data

  • Source: NOAA GFS (Global Forecast System)
  • Format: GRIB2
  • Location: Atlanta, GA (MVP)
  • Variables: Temperature, Humidity
  • Resolution: 3-hour intervals

๐Ÿ“ Project Structure

HyperCast/
โ”œโ”€โ”€ data/
โ”‚   โ”œโ”€โ”€ ingestion/           # Download GRIB2 files
โ”‚   โ”œโ”€โ”€ processing/          # Parse and prepare data
โ”‚   โ”œโ”€โ”€ raw/                 # Downloaded GRIB2 files
โ”‚   โ””โ”€โ”€ processed/           # ML-ready datasets
โ”œโ”€โ”€ services/
โ”‚   โ”œโ”€โ”€ ml/                  # LSTM model & training
โ”‚   โ”‚   โ”œโ”€โ”€ models/          # Model architecture
โ”‚   โ”‚   โ”œโ”€โ”€ train.py         # Training script
โ”‚   โ”‚   โ””โ”€โ”€ inference.py     # Prediction module
โ”‚   โ””โ”€โ”€ api/                 # FastAPI backend
โ”‚       โ””โ”€โ”€ app/main.py      # REST endpoints
โ”œโ”€โ”€ frontend/                # PWA interface
โ”‚   โ”œโ”€โ”€ index.html
โ”‚   โ”œโ”€โ”€ script.js
โ”‚   โ””โ”€โ”€ styles-enhanced.css  # Premium UI
โ””โ”€โ”€ docs/                    # Documentation

๐ŸŽจ UI Features

Premium Design

  • โœจ Glassmorphism - Frosted glass effects
  • ๐ŸŒˆ Animated Background - 3 floating gradient orbs
  • โ„๏ธ Particle Effects - 50 animated particles
  • ๐Ÿ’ซ Smooth Animations - Entrance, hover, continuous
  • ๐ŸŽจ Gradient Text - Shimmer effects
  • ๐Ÿ“ฑ Responsive - Mobile-optimized

UI Preview


๐Ÿ”Œ API Endpoints

GET /health

Check API and model status

{
  "status": "ok",
  "model_loaded": true
}

GET /forecast

Get weather forecast

{
  "location": {
    "name": "Atlanta, GA",
    "lat": 33.749,
    "lon": -84.388
  },
  "current": {
    "temperature": 43.0,
    "humidity": 96.1
  },
  "forecast": {
    "temperature": 46.6,
    "forecast_hours": 12
  }
}

๐Ÿ“š Documentation


๐Ÿ› ๏ธ Tech Stack

Layer Technology
ML PyTorch, NumPy, scikit-learn
Data cfgrib, xarray, pandas
API FastAPI, Uvicorn
Frontend Vanilla JS, CSS3, PWA
System Python 3.13, eccodes

๐Ÿ“ˆ Performance

Metric Value
Inference Time <50ms
Model Size 14K parameters
API Response <100ms
Validation Loss 0.1398

๐Ÿšง Current Limitations (MVP)

  • โš ๏ธ Single location: Atlanta, GA only
  • โš ๏ธ Limited training data: 18 records
  • โš ๏ธ Few variables: Temperature & humidity only
  • โš ๏ธ Simple model: 2-layer LSTM

๐Ÿ—บ๏ธ Roadmap

Phase 2: Core Improvements

  • Download 1+ year historical data
  • Multi-location support
  • Add all weather variables
  • Deeper LSTM architecture

Phase 3: Advanced Features

  • Transformer models
  • Real-time updates (SSE)
  • User accounts & favorites
  • Mobile app

Phase 4: Production

  • Kubernetes deployment
  • Multi-region servers
  • Satellite imagery
  • Advanced NLP search

๐Ÿค Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


๐Ÿ™ Acknowledgments

  • NOAA - Free GFS weather data
  • PyTorch Team - Deep learning framework
  • FastAPI - Modern Python web framework
  • eccodes - GRIB2 file support

๐Ÿ“ง Contact

Project Link: https://github.com/codekshitij/HyperCast


Built with โค๏ธ using Python, PyTorch, and modern web technologies

โญ Star this repo if you find it helpful!

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published