How kafle1/drs works
Project type and purpose
• This is a client-only Progressive Web App (PWA) for a cricket Decision Review System.
• Built with React + Vite + MUI, it performs video-based analyses (No-Ball, Run Out, LBW) entirely in the browser, with offline support via a service worker.
File structure
• Top-level:
• index.html, manifest.json, _redirects, sw.js
• vite.config.js (build config)
• package.json / package-lock.json (dependencies)
• src/ directory:
• main.jsx – renders the root React tree
• App.jsx – application shell & router
• components/ – feature pages (Home, Lbw, Runout, Footer)
• serviceWorker.js – registration logic for PWA
• No backend folder: all logic, including video processing, runs client-side.
README for additional insights
• Confirms PWA, offline support, tech stack (React + Vite + MUI).
• Use cases: upload raw video files, run umpire-assist algorithms in the browser.
a. Main components
1. Browser sandbox (the overall runtime)
2. Application Shell (App.jsx + index.html)
3. UI Components – Home, Lbw, Runout, Footer (React/MUI)
4. Video-Processing Modules – the JS functions handling No-Ball, Run Out, LBW analysis
5. Service Worker (sw.js + serviceWorker.js)
6. Cache Storage / Workbox (for offline assets)
7. External Network (for first-time asset fetch & PWA manifest)
b. Relationships & interactions
• On load, index.html → App.jsx initialized by main.jsx
• App.jsx routes to Home or analysis pages
• User uploads video (UI Component) → passed to Video-Processing Module → analysis results displayed
• Service Worker intercepts asset requests (HTML, JS bundles, MUI assets) and serves from cache when offline
• Manifest.json & _redirects allow “install as PWA” behavior
c. Key architectural patterns
• Application Shell pattern: core assets cached on first load, subsequent loads instantly functional offline.
• Component-based UI (React + MUI).
• Single-Page Application (SPA) routing within App.jsx.
• Client-side video analysis (no backend).
d. Important technologies
• React (component tree)
• Vite (build & dev server)
• MUI (styling & UI library)
• Service Worker API (sw.js) & Workbox strategies (cache-first for shell, network-first for updates)
• Browser Cache Storage