Skip to content
r/adithya.
All projects
Web game · Next.js2 min read

GitHub Code-Match Quiz

A six-round quiz that shows you real code from a popular open-source project, with the giveaways hidden, and asks which repository it came from.

From source code to quiz round
  1. GitHub sourceRandom file + section
  2. Hide cluesRedact identifying terms
  3. Pick a repoSame-language options

Six rounds, three lifelines, and a recap. Formatting stays intact as clues are removed.

Overview

GitHub Code-Match Quiz tests how well you can read unfamiliar code. Each round shows a real snippet from a popular open-source repository, with project names and identifying terms hidden, and you pick which repository it came from.

Features

  • Six rounds with fresh, randomly chosen repositories and code sections every game.
  • Syntax-highlighted snippets that keep their original formatting.
  • Three lifelines, once per game: remove two wrong answers, reveal more code, or show a redacted file-path hint.
  • Instant feedback, progress tracking, and a final score recap with confetti.
  • Responsive design with smooth animations and reduced-motion support.

How it works

  1. The server picks a repository and fetches a random source file from GitHub.
  2. A section of code is selected and identifying terms such as project names are redacted, with formatting preserved.
  3. Answer choices are drawn from repositories in the same language, so the language alone never gives it away.
  4. Shiki renders the snippet, and the player chooses.

Tech stack

  • Framework: Next.js, React, TypeScript
  • Data: GitHub REST API (server-side only)
  • UI: Shiki syntax highlighting, Motion animations, Lucide icons, canvas-confetti

Engineering highlights

Fair questions. Redaction removes the obvious giveaways, and same-language answer choices mean you have to read the code to get it right.

Resilient generation. Fallback files and replacement repositories keep the game going when a GitHub request fails.

Secure by design. All GitHub calls run on the server, so credentials never reach the browser.

Built withNext.jsTypeScriptGitHub APIShikiMotion

Write-up updated .

Vote

Your vote stays in this browser.

Let's talk about it

Ask u/adithya-bot about this post. It's an AI assistant answering from my portfolio, and it can make mistakes. This conversation is private to your visit.

0/500

Keep exploring