The Platform · how it works

Platform architecture

What each page does, what the platform stores, where every piece of data lives, and which page reads or writes it.

1. The big picture

WHO Students phones, tablets Teachers official-email account Content team reviewers, admins WEBSITE (STATIC FILES) play.html join with PIN, answer host · bank · suggest · leaderboard build quizzes, run games, browse review · admin portal · insights publish, import, control, analyse open FIREBASE (GOOGLE CLOUD) Authentication invisible for everyone · email for the team Realtime Database catalog · bank/questions · bank/los games · hostData leaderboards suggestions analytics/responses · analytics/games settings · users · quizzes · history database.rules.json: who may read / write question answer bank, answers games, scores everything bank, settings sign in
reads (blue)writes (orange)
The website is only files; it has no server of its own. Every page talks directly to Firebase: it signs in (students and teachers invisibly, the content team with email and password) and reads and writes the Realtime Database over one live connection. Changes appear on other screens within a fraction of a second.

2. Data map: what is stored, and who reads or writes it

R the page reads it   W the page writes it   RW both. All of this lives in the Firebase Realtime Database (in Demo mode, in the browser's own storage instead).

Students are anonymous everywhere: a name like "Blue Falcon 7" only identifies someone inside one game. No email, phone or real name is stored for students.

3. A live game, step by step

Teacher · host.html Firebase database Students · play.html 1 games/PIN · hostData/PIN quiz with answers stays private to the teacher 2 names/Blue-Falcon-7 · players/… lobby fills up live 3 current question (no answer) question appears on phones 4 answers/Q/student + server time answer counter goes up 5 reveal + scores/student (teacher's browser scores) each phone reads only its own score steps 3–5 repeat for every question 6 leaderboards/… · analytics/… 1 row per answer for Insights
The teacher's browser runs the game: it keeps the answers private, starts each question, and scores the answers when the time is up. Answer times come from Firebase's own clock, so they cannot be faked on a phone. Each phone listens only to the current question and its own score, so every extra player adds only a small, fixed amount of traffic.

4. Why it scales

Page opens e.g. Host a quiz catalog grades, subjects, chapters, sections + counts (a few KB) Teacher picks Grade 10 · AI bank/questions where gs = "10~artificial intelligence" (indexed) other grades + subjects never downloaded 1 2 3
Pages download the question bank one grade + subject at a time. With 50,000 questions across 40 subjects, opening the host page still downloads about 1,000 questions, not 50,000.

Built in

  • Split question bank: every question and learning outcome has a grade + subject key with a database index; pages load only what they show.
  • Catalog: a small outline rebuilt automatically after every import, approval or edit.
  • Small live traffic: phones listen to the current question and their own score only.
  • Date-indexed reads: leaderboards and Insights download only the chosen period; the review queue only the chosen status.
  • Clean-up: old live-game records can be deleted from the admin portal; leaderboards and Insights keep their own copies.
  • Stable IDs: question IDs never change, so reports and exports stay valid for years.
  • One design file (css/theme.css) and one settings screen (admin portal) instead of edits across many files.

Limits to plan for

  • Free Firebase plan: 100 devices connected at the same time (about 2–3 classes playing at once), 1 GB stored, 10 GB downloaded per month. The pay-as-you-go plan raises this to 200,000 connections.
  • Insights read raw answer rows. Beyond roughly a million answers per period, switch to daily summaries or export to Google BigQuery.
  • No accounts: students can't be followed across games, and the answers in the bank can be read by anyone who knows how. Add accounts + Cloud Functions when needed.

5. Where files come from

WhatFromUsed by
Pages, styles, scripts, sample lessonYour website (e.g. Firebase Hosting)All pages
Fonts (Baloo 2, Figtree)fonts.googleapis.comAll pages (set in css/theme.css)
Firebase SDK (sign-in + database)www.gstatic.comAll pages, only when Firebase is configured
QR code makercdnjs.cloudflare.comhost.html (lobby)
Excel reader and writer (SheetJS)cdnjs.cloudflare.comadmin.html, insights.html
Office.js (talks to PowerPoint)appsforoffice.microsoft.comaddin.html (the PowerPoint add-in)
Browser storageThe device itselfRejoin after refresh (play), sound settings, "My suggestions", Demo mode data