Skip to content
gitswagata1Public

About

Adaptive Python course with in-browser execution, LLM tutor, and federated learning

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

BridgeUp β€” Learn Python, the right way

No build step Vanilla JS Python via Pyodide Zero dependencies CI Live demo MIT License

BridgeUp is a Python learning platform for first-year students, built around one observation: every classroom has a hundred different starting lines. It begins with a short coding proficiency test, places each learner into Beginner, Intermediate, or Advanced, and then teaches through an interactive course where real Python runs in the browser β€” no installs, no setup, no lab configuration.

It's a single-page app in plain HTML, CSS, and JavaScript β€” no framework, no build step, no server. Serve the folder statically and it runs.


Contents


✨ Features

  • Proficiency test β†’ personalised track. A 10-question diagnostic (~2 minutes) scores the learner, places them into one of three levels, and shows a per-topic breakdown of strengths and gaps. The test gates the course β€” students unlock chapters by taking it first (faculty and admin can always preview).
  • A real course, not a slideshow. The Python Handbook β€” 8 chapters, 99 lessons adapted from the official Python Tutorial, with source attribution throughout. Topics that step beyond the basics carry an Advanced tag; optional extras carry a Bonus tag.
  • Python that actually runs. An in-page scratchpad executes real CPython via Pyodide (WebAssembly): 165 runnable examples, input() support, REPL-style expression echo, and an infinite-loop watchdog so the tab never freezes.
  • Completion that means something. A chapter closes only when its lessons are read, its quiz is passed at β‰₯70%, and its graded coding challenge produces the right output.
  • Gamification built in. XP for every action, five levels from Newcomer to Pythonista, daily learning streaks, and a downloadable certificate of completion with a verification code β€” see Gamification.
  • Faculty-authored tests with peer approval. Faculty build MCQ tests in a visual editor; a review panel of up to 5 faculty decides β€” majority approval publishes the test to students. One attempt per student, auto-graded, with a full answer review.
  • Marks for faculty. Every test's results roll into the faculty dashboard β€” per-student marks, attempt counts, and class averages, with a one-click CSV export for any test.
  • Faculty materials. Faculty add notes, links, or uploaded PDFs (up to 2.5 MB) to any chapter; they appear inside the chapter for every student. Admin has oversight of both tests and materials.
  • Personal AI tutor. A lesson-aware chat tutor on every lesson page, powered by each user's own free Gemini API key β€” the key lives only in their browser and calls Google directly; BridgeUp never sees it.
  • Federated Adaptive Learning (research / patent PoC). A privacy-preserving adaptive engine: struggle signals are captured on-device, and only anonymised, differentially-private difficulty estimates are aggregated (FedAvg-style) into a shared model β€” so personalisation improves across all learners while no raw student data ever leaves the browser. Powers the "recommended next module" card, a "commonly challenging" signal, and the tutor's memory. See docs/PATENT-DISCLOSURE.md.
  • Three roles, one login.
    • Student β€” takes the course and faculty tests, tracks progress, downloads chapter PDFs.
    • Faculty β€” class analytics and marks, plus authoring: tests (peer-reviewed) and chapter materials.
    • Admin β€” a full console: every account, live progress, role management, test/material oversight, database export, resets.
  • Offline study guides. Every chapter exports a formatted PDF (objectives, takeaways, practice, full lesson content) via jsPDF.
  • Installable app (PWA). Add BridgeUp to any phone or desktop home screen β€” it launches full-screen like a native app, and a service worker caches the shell (and the Python runtime after first use) so it opens and runs offline. No app store, no install fees.
  • Accessible by design. A skip-to-content link, aria-current navigation, aria-live announcements for code output and check results, labelled icon controls, prefers-reduced-motion support, and WCAG-AA contrast β€” usable by keyboard and screen reader.
  • Polished UX. Light and dark themes with a one-click toggle (persisted per browser; code surfaces stay dark in both), cross-fade view transitions, custom scrollbars, and zero horizontal overflow down to phone widths.

πŸ”‘ Demo accounts

BridgeUp runs in one of two modes (details). The hosted site runs in campus mode β€” real accounts, shared across devices. To explore instantly with a populated demo cohort and no signup, open …/bridgeup/?demo=1 β€” ?demo=1 seeds the accounts below into your browser (persisted; ?live=1 exits). The same accounts apply to any local clone (which defaults to demo mode).

Role Email Password
Admin admin@bridgeup.app admin123
Faculty rao@vit.ac.in teach123
Faculty iyer@vit.ac.in teach123
Student swagata@vitstudent.ac.in python123

More demo students, with varied progress for realistic dashboards (all python123): aisha@, ben@, cara@ β€” vitstudent.ac.in.

In campus mode, there is no demo cohort β€” everyone signs up for real, and roles are assigned server-side by email domain: @vitstudent.ac.in β†’ student, @vit.ac.in β†’ faculty.


πŸš€ Quick start

BridgeUp must be served over HTTP (not opened as a file:// URL) β€” the in-browser Python runtime and the Web Crypto password hashing both require a secure context, which localhost provides.

# clone
git clone https://github.com/gitswagata1/bridgeup.git
cd bridgeup

# serve (pick one)
python3 -m http.server 8750     # no dependencies
npm start                       # same command, via package.json
npx serve .                     # if you prefer Node

Then open http://localhost:8750.

The first time you run code, Pyodide downloads the Python runtime (~7 s). It's cached afterwards.


πŸ“š The course

Faithful to the official Python Tutorial, restructured into an interactive path. Each chapter ends with a quiz and a graded coding challenge.

# Chapter Level Lessons Time
1 Introduction to Python Beginner 6 ~45 min
2 More Control Flow Tools Beginner 19 ~1 hr
3 Data Structures Core 13 ~1.5 hrs
4 Modules Core 11 ~45 min
5 Input and Output Core 9 ~1 hr
6 Errors and Exceptions Core 11 ~45 min
7 Classes Advanced 18 ~1.5 hrs
8 A Tour of the Standard Library Advanced 12 ~1 hr

99 lessons Β· 269 code examples (165 runnable in-page) Β· 8 quizzes Β· 8 graded challenges. Topics that stretch beyond a chapter's baseline (e.g. match statements, *args/**kwargs, comprehensions, exception groups) are tagged Advanced; nice-to-know extras (coding style, legacy formatting, performance measurement) are tagged Bonus.


⚑ Gamification

Everything is derived from real progress β€” XP is computed, never stored, so it can't drift or be edited.

Action XP
Complete a lesson +10
Pass a chapter quiz (β‰₯70%) +25
Solve a coding challenge +50
Finish the proficiency test +20
  • Levels β€” 1,610 XP total across five levels: Newcomer β†’ Learner (150) β†’ Coder (450) β†’ Builder (900) β†’ Pythonista (1,400).
  • Streaks β€” any learning activity marks the day; consecutive days build a streak (with best-streak memory and a one-day grace period).
  • Certificate of completion β€” unlocks only when every lesson, quiz, and challenge is done. Downloads as an A4 PDF with the student's name, completion date, XP earned, and a deterministic verification code.

πŸ— How it works

Routing. A tiny hash-free router in app.js swaps the contents of #app per view (home, exam, result, course, chapter, section, faculty, admin, plus the auth screen). Navigation cross-fades via the View Transitions API where available; in-place updates repaint instantly and preserve scroll.

Two modes, one codebase. With js/config.js empty, BridgeUp runs as a local demo β€” accounts, progress, tests and materials live in the browser's localStorage (bridgeup_accounts with salted SHA-256 hashes, bridgeup_session, bridgeup:progress:<email>, bridgeup_tests, bridgeup_materials), and a demo cohort is seeded in code. Fill in a Supabase URL + anon key and the same app switches to campus mode: real auth, server-assigned roles, and cross-device sync, all enforced by Postgres row-level security (see supabase/schema.sql). A ?demo=1 URL forces the local demo even on a campus deployment (?live=1 exits).

In-browser Python. runner.js lazy-loads Pyodide on first run, then reuses it. Each run executes in a fresh namespace, captures stdout/stderr, feeds student-supplied input, echoes a trailing bare expression like the REPL, and a step-count watchdog aborts runaway loops.

Placement & progress. The test maps a score to a level in data.js; the course lives in handbook.js. Chapter completion (lessons + quiz + challenge) rolls up automatically into the student's own view, the faculty dashboard, and the admin console.

Federated adaptive learning. adaptive.js records struggle signals on the device, derives a compact per-module difficulty estimate, perturbs it with differential-privacy noise, and contributes only that estimate to a shared model via weighted averaging β€” never raw events or identity. In campus mode the merge runs server-side (contribute_adaptive() RPC). See docs/PATENT-DISCLOSURE.md.


πŸ—‚ Project structure

bridgeup/
β”œβ”€β”€ index.html                 # App shell: nav, mount point, asset includes
β”œβ”€β”€ css/styles.css             # Design system, views, responsive rules, themes, motion
β”œβ”€β”€ js/
β”‚   β”œβ”€β”€ config.js              # Deployment config: empty = local demo, filled = campus mode
β”‚   β”œβ”€β”€ cloud.js               # Supabase adapter: auth, sync, tests, marks (campus mode)
β”‚   β”œβ”€β”€ auth.js                # Accounts & roles β€” local store, or delegates to cloud
β”‚   β”œβ”€β”€ data.js                # Proficiency test, three levels, scoring
β”‚   β”œβ”€β”€ handbook.js            # Course content: 8 chapters / 99 lessons (official Python Tutorial)
β”‚   β”œβ”€β”€ runner.js              # In-browser Python via Pyodide (stdin, loop guard, REPL echo)
β”‚   β”œβ”€β”€ pdf.js                 # Chapter study guides + completion certificate (jsPDF)
β”‚   β”œβ”€β”€ adaptive.js            # Federated Adaptive Learning engine (on-device, FedAvg, DP, memory)
β”‚   └── app.js                 # Views, routing, progress, quizzes, challenges, gamification, seed
β”œβ”€β”€ manifest.webmanifest       # PWA manifest (installable app)
β”œβ”€β”€ sw.js                      # Service worker (offline shell + runtime caching)
β”œβ”€β”€ icons/                     # App icons (192, 512, apple-touch)
β”œβ”€β”€ supabase/schema.sql        # Campus-mode database: tables, RLS, roles, approval + adaptive RPCs
β”œβ”€β”€ tests/                     # node:test suite (content integrity, adaptive math, schema)
β”œβ”€β”€ .github/workflows/ci.yml   # CI: syntax check + tests on every push
β”œβ”€β”€ docs/
β”‚   β”œβ”€β”€ banner.svg
β”‚   └── PATENT-DISCLOSURE.md   # Technical disclosure: Federated Adaptive Learning
β”œβ”€β”€ SETUP-CLOUD.md             # 5-minute campus deployment guide
β”œβ”€β”€ package.json Β· LICENSE Β· README.md

🌐 Deployment

No build step β€” deployment is "host the files". This repo is live on GitHub Pages at gitswagata1.github.io/bridgeup (running in campus mode; append ?demo=1 for the instant demo).

  • GitHub Pages β€” push to main, then Settings β†’ Pages β†’ Deploy from branch β†’ main / root.
  • Netlify / Vercel β€” import the repo with no build command, publish directory = project root.
  • University intranet β€” copy the folder to any static web server.

🏫 Campus mode β€” real multi-device deployment

Out of the box the site runs as a per-browser demo. To deploy for a real cohort (~1,000 students + 15 faculty fit comfortably in Supabase's free tier), create a free Supabase project, run supabase/schema.sql, and paste two values into js/config.js β€” accounts, progress, tests, marks and materials become real and shared across every device, with roles assigned server-side and all rules enforced by Postgres row-level security. Full walkthrough: SETUP-CLOUD.md (β‰ˆ5 minutes).


πŸ”’ Security note

In local demo mode, accounts and progress live in each visitor's own browser (passwords stored only as salted hashes) β€” ideal for trying the product. In campus mode, authentication and data move to Supabase: real sessions, server-assigned roles, and Postgres row-level security on every table β€” see SETUP-CLOUD.md.


πŸ—Ί Roadmap

  • Scale β€” βœ… shipped: campus mode with a real cohort database (Supabase). Next: VIT SSO sign-in and section management.
  • Beyond Python β€” C and Java tracks to match first-year curricula.
  • Assessment β€” proctored test modes and LMS integration so progress flows into existing systems.
  • Federated Adaptive Learning β€” βœ… working PoC + patent disclosure; next: formal (Ξ΅, Ξ΄)-DP guarantees, secure aggregation, prior-art search with the VIT IP cell.

πŸ™Œ Credits

  • Course content adapted from the official Python Tutorial (Β© Python Software Foundation, PSF License).
  • Pyodide β€” CPython compiled to WebAssembly.
  • jsPDF β€” client-side PDF generation.
  • Type: Inter and Space Grotesk via Google Fonts.

Built for first-year students at VIT Vellore by Swagata Banerjee (the.swagata).


πŸ“„ License

Released under the MIT License.

About

Adaptive Python course with in-browser execution, LLM tutor, and federated learning

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages