How kaiju-no-9/mlab-speedtest works
What this project is (type + purpose)
This repo is a static, client-side AngularJS (1.x) web application that powers https://speed.measurementlab.net (“mlab-speedtest”). There is no backend service in this repo; the “system” is primarily:
• A browser SPA + static assets
• A build step (Gulp) that prepares localization artifacts
• A deployment pipeline (GitHub Actions) that publishes to Firebase Hosting
Key top-level items and what they imply:
Runtime (what runs in production)
• app/ — the entire deployed site root for Firebase Hosting
• app/index.html + app/app.js — AngularJS app entrypoints
• app/services/gaugeService.js — client-side service module (core UI logic)
• app/measure/measure.html, app/measure/measure.js — a feature/module page
• app/assets/ — CSS/JS/images/fonts used by the SPA
• app/assets/translations/*.js — generated/checked-in translation JS consumed at runtime
• app/<lang>/index.html — per-language entry HTML wrappers (routing-by-path / localized bootstrap)
• app/404.html — SPA/static hosting fallback behavior
Build-time (what transforms sources before deploy)
• gulpfile.js — build automation; README says it “integrate[s] language localizations prior to deployment”
• translations/source/application.pot — translation template
• translations/languages/*.po — language catalogs
• package.json — Node/Gulp dependencies and scripts
Deploy-time (how it gets published)
• firebase.json, .firebaserc — Firebase Hosting configuration, site target(s)
• .github/workflows/firebase-hosting-*.yml — CI/CD to Firebase Hosting (PR sandbox + prod on merge)
README cues to include explicitly
• Angular.js app; deployed on Firebase Hosting
• Gulp is used specifically for localization integration (e.g., gulp inject, gulp copy_libs)
• Two environments:
• PR-triggered sandbox: mlab-sandbox.web.app
• main-merge production: speed.measurementlab.net
• Local preview via simple static server ⇒ confirms it’s static hosting + client-side logic
Firebase Hosting → Browser: returns HTML/CSS/JS/fonts/images
3. Browser loads AngularJS SPA: index.html bootstraps Angular; includes assets/js/* and chosen assets/translations/<lang>.js
Runtime behavior
4. AngularJS SPA → External Measurement Endpoints: XHR/fetch/WebSocket (whatever code uses) to run speed measurements
External endpoints → SPA: returns measurement data
6. SPA → UI rendering: updates gauge/visuals (tie to gaugeService.js and measure module)
Localization build flow
7. Transifex (optional) → repo: translators produce .po → downloaded into translations/...
8. **Gulp inject/build → app/assets/translations/*.js and per-language index updates**: show as “build outputs”
9. GitHub Actions → Firebase Hosting: deploys built/static content based on branch/PR triggers
Architecture patterns/design principles present
• Static-site + SPA architecture (no server-side rendering in this repo)
• Build-time localization compilation/injection (PO/POT → JS translation bundles)
• Environment-based deployment (Sandbox vs Production via CI triggers)
• Separation of concerns inside app/
• services/ for business/UI services
• measure/ as a feature module/page
• assets/ for static resources
Technologies/frameworks that matter
• AngularJS 1.x
• Gulp + Node (>=10.15.1) build tooling
• Firebase Hosting (static hosting + routing rules)
• GitHub Actions (CI/CD)
• gettext-style translations (.po, .pot) and generated JS bundles
• (Optional) Transifex (localization management upstream)