Skip to content

Replace localStorage progress tracking with Firebase Auth + Firestore #11

Description

@plyfofun

Current behaviour

Learning path progress is currently stored in localStorage as an array of completed node IDs:

localStorage['progress_discord-python'] = ["login", "creating-the-bot", ...]

The locked/available/complete graph states work correctly, and "Mark as Complete" saves instantly to the browser with no login required.

Why this needs to change

  • Progress is per-browser only — clearing browser data or switching devices loses all progress
  • No way to see club-wide progress or completion rates
  • No identity tied to progress, so there's nothing to show on a leaderboard or profile

Proposed solution

Replace localStorage with Firebase Auth (Google Sign-In) + Firestore:

  • UserProgress Firestore collection — doc ID {uid}_{pathId}, fields: uid, displayName, email, pathId, completedNodes[], lastActivityDate
  • Sign-in button on the Learn page
  • Progress persists across devices and browsers

Files to update

  • js/base/auth.js — already stubbed, just needs the Google Sign-In implementation
  • js/pages/learn.js — replace getLocalProgress() with Firestore fetch + add auth UI
  • js/pages/learn-path.js — replace getLocalProgress() with Firestore fetch
  • js/pages/learn-node.js — replace saveLocalProgress() with Firestore write

Firebase Console setup required

  1. Authentication → Sign-in method → enable Google
  2. Authentication → Settings → Authorized domains → add cca-coding-club.github.io
  3. Add firebase-auth-compat.js CDN script to the three learn HTML pages

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions