← HOME

PROJECT

Codec

ACTIVE

CHANGELOG

CODECfeatureinfrastructure

Layer 2 Steps 1+2 — Riot account linking and match sync live

Features

  • Riot account linking live — /settings page accepts Riot ID (Name#TAG) + region, looks up PUUID via Account API, stores in user_profiles
  • Match sync operational — syncRecentMatches pulls last 20 TFT games, parses participant data (units, traits, augments, placement, duration), upserts into games + game_units
  • SyncButton component shows live feedback — new games synced count, already-stored count, error display
  • Gear icon in comp library header navigates to settings — visible on all screens, minimal footprint

Infrastructure

  • user_profiles schema extended with riot_puuid, riot_game_name, riot_tag_line columns
  • lib/riot/client.ts — Riot API utility: PUUID lookup, match history, match detail, region → routing value mapping, queue ID → mode string
  • RIOT_API_KEY added to Vercel env via file redirect (pipe fails on this CLI version)

Lessons

  • Riot dev key expires every 24h by design — personal project application required for persistent access; submitted to developer portal, approval pending
  • Vercel CLI env add requires file redirect (< /tmp/file), not pipe — pipe produces "Invalid number of arguments" on current CLI version
  • Riot Account API uses routing values (americas, europe, asia, sea) for PUUID lookup — distinct from platform values (NA1, EUW1); using the wrong one returns 404
  • TFT team planner codes changed format between Set 13 and Set 17 — old community spec (starts with 01, 1 byte per champion) doesn't match current codes; text paste via Claude API is more reliable than binary format decoding

TODO

  • Personal Riot API key approval pending — replace dev key in .env.local and Vercel when received
  • Layer 2 Step 3: fuzzy comp association — unit overlap + trait scoring → similarity_score + matched_comp_id on games
CODECfeaturelaunchinfrastructure

Layer 1 shipped — comp library, coaching view, and live deployment

Features

  • Comp Library (Step 4) live — filter bar (playstyle, rating, emblem trait, archived toggle), CompCard with channel numbers, tags, difficulty bars, star rating; 3-step AddComp wizard
  • Comp Detail + Coaching View (Step 5) live — unit roster grouped by FRONT / MID / BACK rows, CORE vs FLEX badge, per-unit items and coaching notes
  • INTEL BRIEF accordion — one panel per note type (general → adaptation), all panels open by default when content exists; adaptation panel uses amber accent to flag game-critical notes
  • Inline note editing — pencil icon per panel, textarea replaces content on click, optimistic update reverts on server error
  • Client-side filtering — useMemo over full comp set; show_archived: true on initial fetch so archive toggle works without refetch
  • App deployed at codec.understorylabs.co — Google OAuth working, all routes protected, user data isolated via Supabase RLS

Bug Fixes

  • Next.js 16 proxy convention: initial deploy used middleware.ts with export function middleware() — produced deprecation warning in Vercel build; fixed by creating proxy.ts with export async function proxy() and deleting middleware.ts
  • React 18 click-through on modal open: backdrop click handler and open trigger processed in same synchronous flush — modal opened and immediately closed; fixed with setTimeout(() => setIsModalOpen(true), 0)
  • OAuth redirect to localhost:5173 on live deployment: caused by Supabase shared project having only localhost in Redirect URLs; fixed by adding https://codec.understorylabs.co/auth/callback to Redirect URLs (Site URL unchanged)

Infrastructure

  • GitHub repo created at nrisacher-lang/codec — private; git remote set-url required after initial remote conflict
  • Vercel project configured — three env vars set, auto-deploy on push to main
  • codec.understorylabs.co CNAME routes through Cloudflare (DNS-only) to Vercel

Lessons

  • Next.js 16 prints a clear deprecation warning when middleware.ts is present — the message says "use proxy instead," which is exact; reading Vercel build output catches this immediately
  • Supabase shared projects (multiple apps on one instance): Redirect URLs is additive — add the new app's callback URL without touching Site URL; changing Site URL re-routes all apps sharing that project
  • Tailwind v4 CSS variable colors require inline style props for opacity variants — bg-my-color/80 silently outputs full opaque color when the token is a CSS variable; color-mix() is the fix
  • Optimistic UI with server actions: update local state and clear edit mode before awaiting the action, revert in catch — this keeps the UI snappy while preserving correctness on failure