Pokemon Tracker — Progress & Handoff

Pokemon Tracker — Progress & Handoff

What this is

A multi-user Pokemon card tracker replacing the old static missing_cards.html. Built as a separate app at /pokemon/tracker/ — the old checklist is intentionally preserved.

What’s done

Files in this directory

FileStatusNotes
index.html✅ CompleteApp shell + all CSS. No generated content.
app.js✅ CompleteFull app logic — auth, Firestore, TCG API, all 4 tabs.
firebase-config.js⚠️ TemplatePlaceholder values — must be replaced with real Firebase config.
firestore.rules✅ CompleteReady to paste into Firebase Console → Firestore → Rules.

Migration script (local only, not in this repo)

/Users/joy/Documents/pokemon/export_owned.py

  • Reads personal.xlsx, queries Pokemon TCG API to map card numbers to API IDs
  • Outputs owned_cards.json{ "base1-4": true, ... }
  • Run once: conda run -n base python3 /Users/joy/Documents/pokemon/export_owned.py
  • Then import via the yellow banner in the app

What needs to happen before the app works

Step 1 — Firebase project setup (~10 min, one-time)

  1. Go to console.firebase.google.com
  2. Create a new project (free Spark plan)
  3. Enable Google Sign-In: Authentication → Sign-in method → Google → Enable
  4. Enable Firestore: Firestore Database → Create database → Start in production mode
  5. Apply security rules: Firestore → Rules tab → paste contents of firestore.rules
  6. Get config: Project Settings → Your Apps → Add web app → copy the config object
  7. Fill in firebase-config.js: replace all REPLACE_WITH_... values

Step 2 — Push to GitHub

The branch feature/pokemon-tracker has the new files committed locally. The GitHub push is currently blocked (previous PAT token was exposed in chat; must be revoked).

  1. Revoke old token at github.com/settings/tokens
  2. Create new token: Settings → Developer settings → Personal access tokens → Classic → repo scope
  3. Set remote URL and push:
    cd /Users/joy/Desktop/Research/website/overjoyroy.github.io
    git remote set-url origin https://<NEW_TOKEN>@github.com/overjoyroy/overjoyroy.github.io.git
    git push -u origin feature/pokemon-tracker
    
  4. Merge into master when ready to go live (PR or direct merge)

Step 3 — Add friends

When a friend signs in for the first time, their UID appears in the browser console:

[Tracker] To add this user to FRIENDS, paste: { uid: '...', displayName: '...' }

Edit app.js:

  1. Add friend’s email to ALLOWED_EMAILS array
  2. Add { uid: '...', displayName: '...' } to FRIENDS array
  3. Push updated app.js to GitHub

_pages/personal.md currently links to /pokemon/missing_cards.html. Add a second button linking to /pokemon/tracker/ when ready to expose the new app.


Architecture summary

Frontend: GitHub Pages (free static hosting) — index.html + app.js Backend: Firebase Spark plan (free)

  • Firebase Auth → Google Sign-In with email allowlist
  • Firestore → per-user data (owned cards, tracked sets, want lists)

Card data: Live from api.pokemontcg.io — CORS-enabled, free, no key needed

  • Responses cached in sessionStorage (cleared on tab close)

Firestore schema:

users/{uid}         → { displayName, email, photoURL, trackedSets: [setId, ...] }
collections/{uid}   → { "base1-4": true, "basep-5": true, ..., updatedAt }
wantlists/{uid}     → { "dragonite": { displayName, addedAt }, ... }

App features (all implemented)

FeatureTabNotes
Google Sign-In with allowlistNon-allowlisted accounts are signed out immediately
Per-user card collectionMy ChecklistSynced to Firestore in real-time
Set pickerMy ChecklistChoose from all TCG sets, grouped by era
Owned/missing trackingMy ChecklistToggle updates Firestore; offline-tolerant
Card detail modaleverywhereImage, prices by finish type, eBay link
Filter + missing-only toggleMy ChecklistReal-time name filter
Search all cards by Pokémon nameSearchQueries TCG API live; debounced 400ms
Track all [Pokémon] want listSearchStored in Firestore wantlists
Want list progressWant ListsOwned / total per species
Friends’ collections (read-only)FriendsHardcoded UID list in app.js
Import from owned_cards.jsonMy ChecklistOne-time migration from xlsx
Persistent loginFirebase Auth + IndexedDB offline persistence

Known gaps / future ideas

  • personal.md still only links to old missing_cards.html — add a second link when ready
  • export_owned.py may warn about unmatched xlsx sheet names; those sets just get skipped
  • Friends tab requires manually adding UIDs to app.js — no self-service onboarding
  • No trade view yet (Phase 4 from the plan) — was designed but not built
  • Search results don’t paginate (capped at 50 cards per query by API)

Key files elsewhere

Documents/pokemon/
  export_owned.py         ← run to generate owned_cards.json (one-time)
  personal.xlsx           ← source of owned card data (archive after migration)
  missing_cards.py        ← old script (no longer needed)
  generate_checklist.py   ← old script (no longer needed)

overjoyroy.github.io/
  pokemon/missing_cards.html   ← old static app — keep, do not delete
  _pages/personal.md           ← links to old app; update when ready
  _data/navigation.yml         ← has "Personal" nav entry