No Tracking. No Servers. Just Math.
Every recommendation you see on Netflix, YouTube, or Spotify is decided by a black-box algorithm running on their servers, trained on your data, sold to advertisers.
GlassBox is the antithesis. A fully transparent, privacy-first recommendation engine that runs entirely in your browser. The algorithm is open. The data is yours. The math is all you need.
| Feature | Description |
|---|---|
| ๐ Zero-Knowledge Architecture | Your watch history, preferences, and interactions never leave your device. Data is stored in an embedded SurrealDB instance running inside your browser via IndexedDB. No servers. No telemetry. No exceptions. |
| ๐ง Client-Side SVD Engine | Recommendations are powered by a Singular Value Decomposition (SVD) algorithm compiled to WebAssembly. The linear algebra runs at near-native speed, directly in the browser โ no API calls to a recommendation server. |
| ๐ Universal Search | Search the entire TVMaze catalog of movies and shows. Results are fetched from the open TVMaze API (no authentication required), and every interaction feeds back into your local recommendation model. |
| โก Rust + WASM Performance | Built with Leptos and compiled to WebAssembly. The entire application โ UI, routing, database, and AI โ ships as a single static bundle. No JavaScript frameworks. No runtime overhead. |
Create an account and sign in โ all credentials are hashed and stored locally in the browser. No server ever sees your password.
Search for movies, save them to your library, and watch the SVD engine build your personalized feed in real-time โ entirely client-side.
GlassBox replaces opaque server-side recommendation pipelines with a transparent, client-side algorithm:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ YOUR BROWSER โ
โ โ
โ โโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ TVMaze โโโโโถโ Vectorizationโโโโโถโ User Profile (SVD) โ โ
โ โ API โ โ (19-dim โ โ Weighted genre vector โ โ
โ โ (Search) โ โ genre vec) โ โ from watch history โ โ
โ โโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโฌโโโโโโโโโโโโ โ
โ โ โ
โ โผ โ
โ โโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ Ranked โโโโโโ Scoring โโโโโโ Candidate Filtering โ โ
โ โ Feed โ โ (Dot Prod) โ โ (Remove watched) โ โ
โ โโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ SurrealDB (IndexedDB / In-Browser) โ โ
โ โ โ Watch History โ User Sessions โ โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โฒ
โ NOTHING leaves this box.
- Vectorization โ Each movie is converted into a 19-dimensional genre vector (Action, Drama, Sci-Fi, etc.)
- User Profiling โ Your watch history is aggregated into a weighted user preference vector, scaled by ratings
- Scoring โ Candidate movies are scored via dot product against your user vector
- Ranking โ Results are sorted by score, filtered against already-watched titles, and displayed
glassbox/
โโโ src/
โ โโโ main.rs # App entry point, router, DB init
โ โโโ api/ # TVMaze API integration
โ โ โโโ search.rs # Video search via TVMaze
โ โโโ model/ # Core engine
โ โ โโโ svd.rs # โญ SVD recommendation algorithm
โ โ โโโ video.rs # Video data model + DB persistence
โ โ โโโ db.rs # SurrealDB (IndexedDB) initialization
โ โ โโโ session.rs # Client-side session management
โ โ โโโ users.rs # Local user management
โ โ โโโ history.rs # Watch history tracking
โ โโโ components/ # Reusable UI components
โ โ โโโ feed.rs # Recommendation feed (uses SVD)
โ โ โโโ search.rs # Search interface
โ โ โโโ movie_modal.rs # Movie detail view
โ โโโ pages/ # Route-level pages
โ โ โโโ home.rs # Home page
โ โ โโโ login.rs # Login page
โ โ โโโ signup.rs # Registration page
โ โโโ cards/ # Card components
โ โโโ navbar/ # Navigation bar
โโโ assets/ # CSS, JS, favicon
โโโ Cargo.toml # Rust dependencies
โโโ Trunk.toml # WASM build configuration
โโโ Dockerfile # Multi-stage production build
โโโ nginx.conf # Production server config
โโโ index.html # HTML shell
| Tool | Version | Install |
|---|---|---|
| Rust | Nightly | rustup default nightly |
| WASM Target | โ | rustup target add wasm32-unknown-unknown |
| Trunk | Latest | cargo install trunk --locked |
# Clone the repository
git clone https://github.com/YADUNANDAN-SINGH/GlassBox-Rust-SVD-recommendation-system.git
cd GlassBox-Rust-SVD-recommendation-system
# Install dependencies (automatic with first build)
trunk serve# Start the dev server with hot-reload
trunk serve
# โ App available at http://localhost:8080# Build optimized WASM bundle
trunk build --release
# โ Output in ./dist/Build and run a production-ready container in two commands:
# Build the image
docker build -t glassbox .
# Run the container
docker run -d -p 8080:80 --name glassbox glassboxOpen http://localhost:8080 โ the app is served via Nginx with gzip compression and SPA routing.
| Layer | Technology | Why |
|---|---|---|
| Language | Rust | Memory safety, zero-cost abstractions, WASM compilation |
| Framework | Leptos 0.8 | Reactive, fine-grained UI with client-side rendering |
| Database | SurrealDB (IndxDB) | Embedded in-browser database โ no external servers |
| Algorithm | SVD / Dot Product | Linear algebra for content-based filtering |
| Data Source | TVMaze API | Open, free, no-auth movie/show metadata |
| Build | Trunk | WASM bundler with asset pipeline |
| Production | Docker + Nginx | Lightweight, cacheable, static deployment |
GlassBox is built on a simple principle: your data belongs to you.
- โ No cookies sent to external servers
- โ No analytics or tracking scripts
- โ No user data ever transmitted off-device
- โ All data stored in IndexedDB (browser-local)
- โ All recommendations computed client-side
- โ Full source code visibility
Built with โค๏ธ & ๐ฆ Rust โ because your recommendations should be transparent, not your privacy.

