Stocks
Technical documentation for the Stocks app — a single-page market research dashboard built with vanilla ES modules.
Architecture
app.js— entry point; renders the dashboard shell.dashboard.js— top bar, ticker tape, and 3-zone grid layout.router.js— client-side routing between dashboard, detail, and compare views.charts.js— interactive price charts.indicators.js— technical indicator calculations.prediction.js— model-based price prediction.api.js— market data fetching and caching.
Data Pipeline
A scheduled GitHub Actions workflow (.github/workflows/stocks-data.yml) fetches market data and commits it to apps/stocks/data/market.json. The app reads this file, so it works without a backend.
Service Worker
sw.js uses a network-first strategy for market data and cache-first for the app shell, enabling offline access to the last cached snapshot.
Design System
All styling uses the root design tokens from /assets/css/base.css.