proxies and deploy

Dev (Vite :5173) in vite.config.ts:

  • /api/github → https://github-stats.tashif.codes with the prefix stripped
  • same for leetcode, codeforces, gfg, codechef, hackerrank, tuf
  • /ph → https://eu.i.posthog.com

If VITE_GITHUB_API=http://localhost:8001 (and the rest), the client bypasses the proxy and talks to uvicorn. CORS then matters. The backends already allow_origins=["*"].

Prod (vercel.json):

  • Same seven /api/{platform}/(.*) rewrites onto the stats hosts
  • /ph/(.*) → /api/ph?path=$1 (Node serverless, bodyParser: false)
  • filesystem then SPA fallback to /index.html

puppeteer is in package.json and unused in src/. Not a feature.

scripts/start-apis.py#

STAT_APIS = REPO.parent, so it expects ~/Projects/Stats APIs/{GitHub,LeetCode,...}. Directory names: CodeForces not Codeforces. App modules: GitHub/CodeChef/HackerRank main:app; LeetCode/Codeforces/GFG/TUF app:app.

--stop frees 8001–8007. Launch is uv run python -m uvicorn … --reload, detached, logs logs/<name>.log. Health: any HTTP response on /docs or / counts, including 404. 40s deadline. GitHost is not in the list.

Claim internals#

supabase/migrations/202607030001_saved_profiles.sql:

  • public_profiles: PK = auth.users.id, username unique, ^[a-z0-9][a-z0-9_-]{2,29}$
  • profile_configs: jsonb { platform: string[] }, is_primary unique per user, is_public
  • RLS: profiles readable by anyone; configs readable if public and primary, else owner only

Reserved names were widened in the short-link migration (account, docs, leetcode, tuf, s, share, onboarding, …). Client RESERVED_PROFILE_USERNAMES should stay in sync. Claimed handle with empty config is still a profile. Owner sees “attach platform ids”. Strangers see a waiting state, not 404.