How openpowerlifting/openlifter-custom works
Project Type and Purpose
• This is not a traditional full‑stack application but a set of prebuilt, static PWA/Electron “client” bundles.
• Each subfolder under releases/ (e.g. advanced-training-center, blue-collar-barbell, etc.) is a self‐contained build of the OpenLifter front‑end, packaged both as a Progressive Web App (PWA) and with an Electron wrapper (electron.js).
• The repo holds only the build‐output (HTML, CSS, JS, manifests, service worker scripts); the actual source lives on GitLab in “custom-” branches.
File Structure Analysis
• Root: index.html (likely a landing or redirect page), README.md, CNAME, LICENSE.
• releases/ top‑level directory: contains one folder per custom client.
• Each release folder contains:
• index.html – PWA entrypoint
• static/ – generated assets (CSS/JS chunks, maps, media)
• asset-manifest.json, manifest.json – PWA metadata
• service-worker.js or related precache manifests – offline caching
• electron.js – Electron main process script
• Sub‑directories for each app feature (about, debug, flight-order, lifting, meet-setup, registration, results, weigh-ins, etc.) each with their own index.html.
• No server‑side code here—only client‑side builds.
a. Main Components
• Static Host / CDN (e.g., GitHub Pages, S3/CloudFront) serving:
• HTML files (index.html per release + feature pages)
• Static asset bundles (static/css, static/js, media)
• Manifests and service worker scripts
• Client Runtime – two flavors:
1. Browser (PWA)
2. Electron App (desktop)
• Service Worker (caching & offline)
• Browser Storage (IndexedDB/localStorage) for offline data (if used)
• (Optional) External API Endpoint – if the PWA fetches data (not in this build output but likely present in source)
b. Relationships & Data Flows
• User’s browser/Electron starts by requesting index.html from Static Host.
• index.html loads JS bundles from /static/js/*.js.
• On first visit, Service Worker installs and caches assets; subsequent loads come from cache.
• Electron’s main process (electron.js) spawns a BrowserWindow pointed at the local index.html URL.
• In both runtimes, the SPA code renders feature pages and (optionally) calls out to external services (e.g. OpenPowerlifting API).
• Local data (user entries, registrations, results) persists in the browser’s IndexedDB or localStorage.
c. Architectural Patterns & Principles
• Static Pre‑Rendering + Client‑Side Routing (a “static SPA” architecture)
• Progressive Enhancement via Service Worker (PWA caching, offline capability)
• Desktop Wrapping via Electron (separation of main process vs renderer process)
• Reusable Build Pipeline – every release shares the same build artifacts pattern, just with different branding/config.
d. Key Technologies
• React (implied by chunk.js naming conventions) or other webpack‑based bundler
• Service Worker / Workbox (for precache manifests)
• Web App Manifest (manifest.json)
• Electron (for electron.js)
• Static hosting (GitHub Pages, S3, Netlify, etc.)