Skip to content

xdanny/waysight

Repository files navigation

WaySightAI

Privacy-first browser-based time series forecasting powered by Rust/WebAssembly

WaySightAI runs sophisticated forecasting models (ARIMA, Exponential Smoothing, ensemble methods) entirely in your browser. Your data never leaves your machine — all computation happens client-side via WebAssembly, delivering near-native performance with complete privacy.

TypeScript Rust Python License: MIT

Key Features

  • Privacy-First — All forecasting runs locally in your browser via WebAssembly. Zero data upload.
  • High Performance — Rust/WASM engine handles 1M+ rows in seconds.
  • AI-Powered Insights — Claude AI agent provides recommendations, data quality analysis, and plain-language explanations.
  • Advanced Models — ARIMA, ARIMAX, Exponential Smoothing, Linear Trend, and Ensemble methods.
  • Comprehensive EDA — Stationarity tests, ACF/PACF plots, outlier detection, and data quality checks.
  • Interactive Visualizations — ECharts with confidence intervals, diagnostics, and residual analysis.
  • No Code Required — Drag-and-drop CSV upload with automated model selection.

Architecture

┌──────────────────────────────────────────────────────┐
│                   Browser (React)                     │
│                                                       │
│   UI Components ──► WASM Engine (Rust)               │
│   TypeScript         ├─ Polars DataFrames            │
│   Tailwind CSS       ├─ ARIMA, Exp. Smoothing        │
│   ECharts            ├─ Statistical functions         │
│   Zustand            └─ Preprocessing pipeline        │
│                                                       │
│   All forecasting computation happens here            │
└─────────────────────────┬────────────────────────────┘
                          │ metadata only (no raw data)
                          ▼
┌──────────────────────────────────────────────────────┐
│              Backend (FastAPI + PostgreSQL)            │
│                                                       │
│   Claude AI Agent ─── intelligent recommendations     │
│   Clerk Auth ──────── user management                 │
│   PostgreSQL ──────── projects, usage (metadata only) │
└──────────────────────────────────────────────────────┘

Monorepo Structure

packages/
├── web/     # React frontend (Vite + TypeScript + Tailwind)
├── wasm/    # Rust WASM forecasting engine
└── api/     # FastAPI backend (AI agent, auth, projects)

tests/
├── wasm/    # Playwright browser tests for WASM
└── web/     # Frontend integration tests

Quick Start

Prerequisites

  • Node.js 18+
  • Rust 1.70+ with wasm-pack
  • Python 3.11+ (for backend)
  • PostgreSQL 14+ (for backend)

1. Install and build

git clone https://github.com/xdanny/waysight.git
cd waysight

npm install
npm run build:wasm    # Build Rust → WebAssembly

2. Start the frontend

npm run dev
# → http://localhost:3000

The frontend works standalone for all forecasting features (no backend needed).

3. Start the backend (optional — enables AI agent)

cd packages/api
python -m venv venv && source venv/bin/activate
pip install -r requirements.txt

cp .env.example .env
# Edit .env with your Clerk, Anthropic, and database credentials

alembic upgrade head
uvicorn app.main:app --reload --port 8000

Docker

cp .env.example .env
# Fill in your API keys
docker compose up

WASM Engine

The forecasting engine is written in Rust and compiled to WebAssembly:

Model Use Case Performance
Linear Trend Simple trending data < 100ms, 1M rows
Exponential Smoothing Level, trend, seasonality < 500ms, 1M rows
ARIMA Complex autocorrelation patterns 1-3s, 100K rows
Ensemble Combined model output 2-5s, 100K rows

Core Rust crates: wasm-bindgen, ndarray, statrs, serde

cd packages/wasm
cargo test              # Run Rust unit tests
cargo clippy            # Lint
wasm-pack build --target web   # Build WASM

Tech Stack

Layer Technologies
Frontend React 18, TypeScript, Vite, Tailwind CSS, Zustand, ECharts
WASM Rust, wasm-bindgen, ndarray, statrs
Backend FastAPI, SQLAlchemy, Alembic, PostgreSQL
AI Anthropic Claude (Google ADK)
Auth Clerk
Testing Playwright, Vitest, pytest
Build Turborepo, wasm-pack

Environment Variables

Copy .env.example files and fill in your values:

# Root
cp .env.example .env

# Frontend
cp packages/web/.env.example packages/web/.env

# Backend
cp packages/api/.env.example packages/api/.env

See each .env.example for required variables (Clerk keys, Anthropic API key, database URL).

Development

npm run dev           # Start all packages
npm run build         # Production build
npm run test          # Run all tests
npm run lint          # Lint TypeScript + Rust
npm run format        # Format code

Contributing

See CONTRIBUTING.md for guidelines. We use conventional commits.

License

MIT

About

Privacy-first browser-based time series forecasting — Rust/WASM engine, Claude AI agent, React UI

Topics

Resources

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors