GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - DevDataAnalyst/data-detective: Gamified prototype for learning data skills: short Duolingo-style statistics lessons plus a real Python (pandas) mission that runs in the browser.

BranchesTags
Open more actions menu

Latest commit

 

History

28 Commits
28 Commits

Folders and files

NameName
Last commit message
Last commit date
.claude
.claude
 
 
design/mascot
design/mascot
 
 
e2e
e2e
 
 
public
public
 
 
scripts
scripts
 
 
src
src
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
.prettierignore
.prettierignore
 
 
.prettierrc.json
.prettierrc.json
 
 
CLAUDE.md
CLAUDE.md
 
 
README.md
README.md
 
 
TESTING.md
TESTING.md
 
 
eslint.config.js
eslint.config.js
 
 
index.html
index.html
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 
playwright.config.ts
playwright.config.ts
 
 
tsconfig.app.json
tsconfig.app.json
 
 
tsconfig.e2e.json
tsconfig.e2e.json
 
 
tsconfig.json
tsconfig.json
 
 
tsconfig.node.json
tsconfig.node.json
 
 
tsconfig.test.json
tsconfig.test.json
 
 
vercel.json
vercel.json
 
 
vite.config.ts
vite.config.ts
 
 
vitest.python.config.ts
vitest.python.config.ts
 
 

Repository files navigation

Data Detective

A prototype of a gamified web app for learning data skills. It tests one idea: that short Duolingo-style lessons and a real hands-on mission belong together. Try it here : https://data-detective-omega.vercel.app/

There are four units. Each one opens with a message from a manager or a client, teaches in seven 3–5 minute lessons, and ends with a case on a real dataset where the obvious answer is wrong. In each mission the learner writes real Python (pandas) in the browser, then writes a recommendation for someone who is not technical.

  1. Data Detective (descriptive statistics). The Late Delivery Mystery: work out from 600 messy delivery records where deliveries are genuinely slow.
  2. The Churn Culprit (probability and Bayes' theorem). The False Alarm: a founder panics about record cancellations, but students leave before their summer break every April.
  3. Ship It or Skip It (hypothesis tests and A/B testing). The Checkout Redesign: a new checkout wins "significantly", but only because its visitors came at the weekend.
  4. Crack the Interview (SQL and pandas interview questions, and a six-step routine for any data problem: clarify, inspect, plan, build, check, explain). The Final Round: a live interview problem over three tables, where a dashboard's join counts each order once per item.
  • Lessons: ten question types, with instant feedback, XP, a daily goal and a streak. Six of them are built on real analyst work: triage a vague request, spot the lying chart, find the lurking variable in a courtroom, build a metric, call an A/B test (ship it, kill it, or wait), and put the steps of a method or the lines of a query in order. SQL and pandas questions show real code, and every answer is proven by running it in the tests.
  • Test out: a 10-question checkpoint in each unit, for people who already know the topic.
  • Boss battle: a 60-second round of questions the learner has already got right.
  • Mission: Python and pandas running in the browser through Pyodide (and SQL on the same data in Unit 4), with hidden checks, three levels of hints, and a portfolio summary at the end. Finishing a unit opens the next one.
  • Daily challenge at /daily: one lying chart or courtroom case a day, the same for everyone, with no lessons or sign-up needed and a result card to share.
  • Light and dark mode: it follows the device by default, with a toggle in the top bar and a choice on the profile page.
  • Professor Ponku, the mascot, turns up at the moments that matter: waving hello, thinking through a hint, a thumbs up for a right answer, celebrating a finished lesson or mission, and napping when a streak needs attention. The app's colours come from the mascot's palette. The art, palette and brand guide are in design/mascot.
  • Optional support: the mission complete screen ends with a way to chip in through UPI (a UPI app link on phones, a QR code on computers, and the UPI ID to copy). Nothing is unlocked by paying, and the QR code is drawn in the page rather than by an outside service. The UPI ID is in src/content/support.ts.
  • Everything is stored on the learner's device. There is no backend, no account and no analytics service.

Live prototype: https://data-detective-omega.vercel.app/ image

Run it locally

Node 22.22 or newer.

npm install
npm run dev

Then open http://localhost:5173. The mission downloads Python and pandas (about 25 MB) from the jsDelivr CDN the first time it opens, so that part needs an internet connection.

Task Command
dev server npm run dev
production build npm run build (type-checks, then builds to dist/)
preview a build npm run preview
unit tests npm test
grading tests npm run test:python (runs the mission's checks in real Pyodide)
end-to-end npm run test:e2e (Playwright, builds and previews first)
lint and format npm run lint, npm run format
datasets npm run generate:data (every mission's CSV files)

The end-to-end tests need browsers once: npx playwright install chromium. To use a Chrome that is already installed instead, run them as PLAYWRIGHT_CHANNEL=chrome npm run test:e2e. Each run starts with an empty browser cache, so the journey test downloads Python (about 25 MB) again each time and takes a few minutes.

To measure how long the mission takes to load Python:

RUN_SLOW_NETWORK=1 npm run test:e2e:slow

Measured on a connection of about 1.4 Mbit/s (close to Chrome's "Slow 4G" profile): 143 seconds from opening the mission to being able to run code, with a cold cache. The browser caches the download, so opening the mission again is nearly instant. The workspace explains the wait, shows what it is doing, and lets the learner read the tasks and write code while it loads.

Deploy to Vercel

The app is a static single-page app, so any static host works. For Vercel:

  1. Push this folder to a Git repository and import it at vercel.com/new.
  2. Vercel reads vercel.json: build with npm run build, serve dist/, and rewrite unknown paths to index.html so direct links such as /mission work.
  3. No environment variables are needed.

Or from this folder, with the Vercel CLI:

npx vercel deploy --prod

Regenerate the datasets

The missions' datasets in public/data/ are generated, not hand-written. Each generator plants the patterns its mission is about: missing values, outliers, a slow city and a dinner rush in deliveries.csv; a seasonal wave of student cancellations in churn.csv; a weekday/weekend mix-up in checkout.csv; and, across customers.csv, orders.csv and order_items.csv, big combo orders that a careless join counts several times. They are documented in scripts/README.md.

npm run generate:data

The mission's answers are worked out from the CSV when Python loads, so regenerating the data does not break grading. Re-run npm test afterwards: the reference-answer tests will tell you if any documented number changed.

Add a new unit

Content is data. A unit is a typed object, and no component needs to change to add one.

  1. Write src/content/unit4.ts following the types in src/content/types.ts: a unit has an opening hook message, lessons (6–8 questions each, at least three question types), a 10-question checkpoint, and a mission id.
  2. Numbers in prompts and explanations use placeholders like {mean}, filled from the question's own data, so nothing is typed in twice.
  3. Add a mission in the same shape as src/content/mission3.ts: tasks with starter code, the variables each task creates, three hint levels, the dataset facts it quotes, and the summary lines.
  4. Add the unit to courseUnits in src/content/index.ts and the mission to src/content/missions.ts, and add validateUnit and validateMission to the content tests. Validation runs in the test suite and fails the build on any problem: wrong answers, missing explanations, unknown placeholders, questions that are too long, and more. Units open in order, so the new one opens once the one before it is finished.
  5. Each mission's grading is its own Python module, such as src/mission/python/checks_checkout.py, listed in checkModules.ts. Each task gets a check that inspects the learner's variables and returns a specific, non-revealing message.
  6. For SQL, give the mission's data files a table name and mark tasks language: 'sql', as src/content/mission4.ts does. A query's result is saved as the task's variable, so the checks read it like any other.

CLAUDE.md in this folder is the working brief: conventions, content rules and the decisions behind the game logic.

Daily challenge

/daily shows one question a day: a lying chart one day, a courtroom case the next. Everyone gets the same question on the same date, and it needs no account or lessons, so it works as a link to share. The learner gets one try against the clock, then sees the full answer and a result card ("I spotted the lying chart in 8 seconds — can you?") that they can share, download as an image or copy as text. Results are kept on the device and earn no XP.

The questions are in src/content/daily.ts, checked by the same validation as the course. Days take them in order and start again after the last, so add new questions at the end: earlier days keep their questions.

Playtest data

While the prototype is being tested, the app keeps a log on the learner's device of what they did: lessons started and completed, answers with first-try results and time taken, checkpoint attempts, how long Python took to load, mission task runs and hints, and the answers to three one-tap surveys. It never leaves the device by itself.

Testers open Profile → Open playtest data (or go to /playtest), where they can:

  • see the summary the numbers add up to,
  • press Export data to download a JSON file to send back,
  • press Copy summary to paste a short version into a message,
  • press Clear playtest data to delete it.

The summary is broken down by unit. The export holds ids, counts and times, including daily challenge answers and shares. The only free text in it is the optional "What would you change?" note at the end of the mission.

About

Gamified prototype for learning data skills: short Duolingo-style statistics lessons plus a real Python (pandas) mission that runs in the browser.

data-detective-omega.vercel.app

Resources

Readme
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.