You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NOTE TO SELF — Do not change this README until the end of the project. I am actively updating everything I am doing here as I build.
CoderV — Python Learning Platform
A structured, interactive platform for learning Python through bug-fix labs, code visualisation, data structures, algorithms, system design, a HTML/CSS/JS sandbox, quizzes, and an AI assistant.
# Frontendcd frontend
npm install
npm run dev # http://localhost:5173# Backendcd backend
npm install
npm run dev # node --watch server.js (http://localhost:3001 by default)# One-time database seed (run after schema.sql is applied in Supabase)
node seed.js # Lesson data (6 lesson types, examples, steps, quizzes, graphs)
node seedQuizzes.js # Extra practice quizzes
Backend API Endpoints
Method
Route
Auth
Purpose
GET
/api/health
No
Service health check (reports python / supabase / firebase config)
POST
/api/users/sync
Yes
Upsert Firebase user into Supabase
GET
/api/progress
Yes
Get user's completed examples
POST
/api/progress/complete
Yes
Mark an example as complete
DELETE
/api/progress/reset
Yes
Wipe the user's progress
POST
/api/trace
No
Run Python code through tracer (validated by validateCode)
GET
/api/lessons
No
All lesson types (registry)
GET
/api/lessons/:lessonId
No
Lesson detail with difficulties + example titles
GET
/api/examples/:exampleId
No
Full example (steps, quiz, nodes, edges)
GET
/api/quizzes
No
All extra practice quizzes
GET
/api/quizzes/:quizId
No
Quiz with all questions and options
POST
/api/quizzes/:quizId/submit
Yes
Save quiz attempt result
GET
/api/quizzes/my-attempts
Yes
User's past quiz attempts
POST
/api/ai/quiz-hint
Yes
Socratic hint for the current quiz question (never reveals the answer)
POST
/api/ai/chat
Yes
General "Ask AI" tutor with progress + route context
Features Built
Authentication & Users
User authentication — Firebase email + password, custom UI
User data sync to Supabase on login and signup (/api/users/sync)
Protected routes — redirect to /login if not authenticated
AuthContext with user, loading, getToken, signOut
UI & Theme
Dark / Light mode toggle — persists to localStorage, on all pages
Consistent design system (hairline, mono, bg-elevated, text-fg, …) shared across pages
Loading skeleton system — SkeletonCard, SkeletonHero, SkeletonList
Global error boundary — friendly fallback UI for runtime JS errors
404 Not Found page with "Go back" button
Mobile-responsive visualizer — Code / Graph & Vars tab switcher on small screens
Consistent header tabs across pages
ScrollToTop route helper — resets scroll on every navigation
Lessons & Learning (fully dynamic from Supabase)
LessonsContext — eagerly fetches all module data on boot, caches for instant progress calculations
Lesson 1 — Basics to Know (Bug Fix Lab) — debug broken Python and run it to verify
Lesson 2 — Python Step Visualizer
Lesson 3 — Data Structures Explorer
Lesson 4 — Algorithm Patterns
Lesson 5 — System Design Basics
Lesson 6 — Customize the Website (Web Lab) — live HTML/CSS edits scoped to the real sidebar via scopeCssToSelector, plus a JavaScript "hack" stage that mutates dashboard scores client-side
Difficulty progression (Beginner → Easy → Medium → Hard) gated by lessonProgressGates
Visualize-first then quiz — quiz unlocks after interacting with the visualizer
Examples fetched on-demand from /api/examples/:id (no hardcoded data at runtime)
Graph module page (GraphModule.jsx) and GraphPreview component for tree/graph visualisations
Progress Tracking
useProgress hook — uses LessonsContext for totals (no hardcoded modules)
localStorage fast cache layer — hydrates instantly on page load
Supabase sync — progress persisted to backend on markComplete
progressLoading state — skeleton shown while remote data loads
"Waking backend…" cold-start status for Render free tier
Server-side input validation via validateCode middleware
Extra Practice Quizzes
Timed quizzes fully stored in Supabase (seeded via seedQuizzes.js)
Quiz listing page (/quiz) — fetches live from DB, shows count/difficulty/time
Quiz-taking page (/quiz/:id) with 3 phases: Ready → Active → Results
Countdown timer — auto-submits when time runs out, red pulse when ≤ 30s
Per-question instant feedback — correct (green) / incorrect (red) after each answer
Score ring on results screen with percentage, grade label, full answer review
Attempt saved to extra_quiz_attempts in Supabase after finish
"Try Again" resets the quiz; "All Quizzes" returns to listing
AI Assistant (live)
Quiz AI Bot (QuizAiBot.jsx) — opens beside any in-lesson quiz question; gives Socratic hints via POST /api/ai/quiz-hint and is hard-prompted never to reveal the answer letter or text
Ask AI page (/ai) — general programming tutor at POST /api/ai/chat
Sends the user's progress + available app routes to the model so replies can include in-app deep links (e.g. [Try Algorithm Patterns – Medium](/lessons/type-3/medium))
Strict topic policy — politely refuses off-topic questions and steers back to coding
Renders model output via AssistantMessage (markdown, code blocks, inline action links)