# UI Stock Tracker — Project Documentation **Status:** ✅ Complete and running **Last updated:** 2026-06-06 --- ## Purpose Monitors product pages on [store.ui.com](https://store.ui.com/us/en) for stock availability and sends a Telegram alert the moment a watched item comes back in stock. Runs as a single persistent Docker container on Unraid with a clean web UI for managing tracked products. --- ## Stack | Layer | Technology | |---|---| | Frontend | React 18 + TypeScript, Vite, Lucide icons | | Backend | Node.js 20 + TypeScript, Express | | Database | SQLite via `better-sqlite3` (WAL mode) | | Scraper | Puppeteer-core + system Chromium | | Alerts | Telegram Bot API (direct HTTP) | | Container | Single Docker container — nginx + Node.js managed by supervisord | | Web server | nginx — serves frontend, proxies `/api/` to Node.js on port 3001 | --- ## Container Architecture One container runs three processes via **supervisord**: ``` supervisord ├── nginx → serves React build on :8080, proxies /api/ → localhost:3001 └── node → Express API, SQLite, Puppeteer scheduler, Telegram sender ``` The SQLite database is stored on a mounted volume at `/app/data/tracker.db` so it persists across rebuilds. --- ## Key Features ### Stock Detection Puppeteer navigates to each product URL and waits for React hydration (2.5s delay), then: - `