Duplicates the team's Google Sheets matchup-matrix template once per
opposing team at a loaded event, pre-filled with names, factions,
career win% (all already computed by this page), and cleaned army
lists. New "Which team is yours?" selector + Generate Matrix button,
team-events only.
- Auth: Google Identity Services token client (drive.file +
spreadsheets scopes) — the viewer signs in with their own Google
account via a real OAuth popup, no backend, no client secret.
- Template layout is located at runtime by searching each tab for its
own placeholder text ("Player N - Faction", "Opponent N") rather
than hardcoded A1 ranges, so it survives the template changing later.
Distinguishes the real input area from the template's own "mobile
matrix" mirror and reference sections (which repeat the same
placeholder text) by checking for literal typed values vs formulas —
CSV export can't tell these apart, only the real Sheets API response
can, which is how this was actually verified before writing this.
Auto-picks between the template's 5-man/8-man tab variants by team
size.
- List cleaning via a vendored copy of desjani's 40k-compactor
(src/vendor/40k-compactor/, see NOTICE.md) — it isn't actually
published to npm despite documenting `npm install 40k-compactor`
(verified: 404 against the registry under every plausible name), so
it can't be a normal dependency; vendored instead, MIT per direct
confirmation from the maintainer. Verified against 40k-compactor's
own sample list fixtures with real Node before committing.
- Generating a matrix needs the same BCP auth token already used for
faction/disposition backfill (list text is a subscriber-gated
endpoint) — reuses the existing token UI/storage as-is; missing
lists are reported, not a hard failure.
- nginx CSP updated (script/connect/frame-src) for Google's identity
script and the Drive/Sheets REST APIs.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SBzcNkW7JcYipnAX6HfgmK
gateway-gamers.net
Monorepo for the *.gateway-gamers.net static sites. Each site is an independent
Vite + Tailwind v4 + daisyUI project, deployed to its own subdomain, but they
share a header shell, footer, and hero-carousel images so a logo/photo swap
doesn't need to happen four times.
Layout
shared/
header.template.html # full header markup, nav swapped in at build time
footer.html # byte-identical across every site
images/ # logo + carousel photos, one copy
scripts/
render-header.mjs # shared/header.template.html + sites/<site>/nav.html -> sites/<site>/public/header.html
sites/
40k-rankings/
aos-rankings/
kingmaker/
scouting/
Each sites/<name>/ is a full Vite project (own package.json, vite.config.js,
src/, index.html). Two things are not duplicated per site:
public/footer.htmlandpublic/imagesare symlinks into../../../shared/.public/header.htmlis generated (gitignored) fromshared/header.template.htmlplus that site's ownnav.html(just its<li>nav entries) — run automatically via thepredev/prebuildnpm scripts, sonpm run dev/npm run buildalways regenerate it fresh. Nothing else about the header (carousel, logo, theme toggle) varies per site.
To add a new site's nav, edit sites/<name>/nav.html. To change the shared photos,
logo, footer copy, or header markup/structure, edit under shared/ once.
Commands (per site)
cd sites/<name>
npm install
npm run dev # http://localhost:5173, regenerates header.html first
npm run build # -> dist/
npm run preview
Deploy
.gitlab-ci.yml at the repo root builds/deploys each site independently
(path-scoped via rules: changes:), plus a deploy:shared job that syncs
shared/images/ and shared/footer.html to
/var/www/domains/gateway-gamers.net/shared/ on the webserver — the box
the GitLab Runner executes on. Every site's nginx server block points
/images/ and /footer.html at that shared directory via alias, so the
webserver only ever holds one copy of the ~25MB of images. See each
sites/<name>/<name>.gateway-gamers.net.conf for the live nginx reference
config (applied manually on the box — CI doesn't touch nginx).