AlgoHub is a Next.js playground that turns classic data-structures-and-algorithms practice into a set of cinematic mini-games. The hub blends Supabase-powered progression, animated UI, and WebGL scenes built with @react-three/fiber to deliver interactive lessons you can replay anywhere.
- Cinematic landing experience with iris transitions, animated cursors, global audio, and profile quick-access.
- Supabase integration for auth, profile data, achievements, and media uploads (license card, signatures).
- Shared audio bus that hands off between the global music player and per-game tracks.
- Custom hook wrappers (
useEffect,useMemo, etc.) instrumented for React 19 streaming safety across the App Router. - Responsive controls: keyboard for desktop, on-screen joystick (pointer + touch) for touch devices.
Playable and in-development experiences surface inside the Learn Carousel (app/components/sections/GameScroller.tsx).
| Title | Route | Status | What you'll learn |
|---|---|---|---|
| Stack 'Em Queue | /learn/parking |
Playable | Stacks + queues fundamentals via a 3D parking lot loop (enqueue/dequeue, state transitions, visualizing structure changes). |
| Binary Tree Pinball | /learn/pinball |
Playable | Binary tree traversals (preorder/inorder/postorder) in an arcade-style 3D pinball traversal runner. |
| Tower of Hanoi | /learn/tower-of-hanoi |
Playable | Recursion, constraints, and optimal move sequences through a staged UI that escalates into a terminal-style “system” flow. |
| Dungeon | /learn/dungeon |
Playable | Phaser-based mini-game experience (client-only) used as an interactive playground inside the Learn hub. |

- Built with
@react-three/fiber,three, and custom camera rigs. - Queue management logic lives in
app/learn/parking/ParkingScene.jsxwith helpers inhooks/andlib/. - Gameplay loop includes queue markers, countdown triggers, Supabase-powered license validation, and optional fast-forward.
- Mobile joystick: multi-input handling with pointer/touch fallbacks (
MobileJoystickcomponent insideParkingScene.jsx).
-
Enter a list of numbers to build a BST, then visualize it in 3D.
-
Choose a traversal (preorder / inorder / postorder) and watch the sequence play out.
-
Traversal and positioning logic live under
lib/pinball/.
-
Solve the Tower of Hanoi by moving disks between towers under the classic size constraints.
-
The experience is presented as a staged UI flow (logo → desktop → game → terminal-style sequence).
-
The flow and state live under
app/learn/tower-of-hanoi/.
-
Client-only Phaser experience loaded via dynamic import.
-
Uses sprite/map assets from
public/sprite/and related game files underapp/learn/dungeon/.
- Framework: Next.js 16 (App Router, React 19, Suspense-first architecture)
- 3D & Animation: three.js, @react-three/fiber, @react-three/drei, GSAP
- Auth & Data: Supabase (client + service role accessors)
- Styling: Tailwind CSS 4 + custom shaders and utility classes
- Audio: Custom Web Audio bus (
lib/audio/*) plus music/sfx routing between screens - Tooling: TypeScript, ESLint 9, custom React hook wrappers (
hooks/)
This project has been tested using the following tools during security validation activities:
- OWASP ZAP
- Nmap
- Wireshark
- Burp Suite
Notes:
- Network scanning and interception tools should only be used against environments you own or have explicit permission to test.
- Any detailed findings (if applicable) are tracked outside this repository; this README intentionally does not publish exploit details.
The repository includes an SBOM section here to document runtime components, libraries, dependency versions, origins, and vulnerability status.
Important: the sbom/ folder in this repo is currently empty, and no vulnerability scan report output is committed. Because of that, the “Vulnerabilities” column below reflects what is documented in-repo (not a guarantee of “no vulnerabilities”).
| Component | Purpose | Key Dependencies (version as declared) | Origin | Vulnerabilities (in-repo) |
|---|---|---|---|---|
| Web App (Next.js / App Router) | UI, routing, server rendering, API routes | next@^16.0.7, react@19.2.0, react-dom@19.2.0 |
npm registry | No report committed (run npm audit / SBOM tooling) |
| Supabase Integration | Auth, profiles, achievements, storage | @supabase/supabase-js@^2.80.0 |
npm registry | No report committed (run npm audit / SBOM tooling) |
| 3D / WebGL Games | Three.js scenes and interactions | three@^0.181.0, @react-three/fiber@^9.4.0, @react-three/drei@^10.7.6, @react-three/cannon@^6.6.0, gsap@^3.13.0 |
npm registry | No report committed (run npm audit / SBOM tooling) |
| Arcade / 2D Engine | Phaser-based client game(s) | phaser@^3.90.0 |
npm registry | No report committed (run npm audit / SBOM tooling) |
| Realtime / Multiplayer Plumbing | Socket messaging (where used) | socket.io@^4.8.3, socket.io-client@^4.8.3 |
npm registry | No report committed (run npm audit / SBOM tooling) |
| AI Integration (optional) | AI utilities where enabled | @google/generative-ai@^0.24.1 |
npm registry | No report committed (run npm audit / SBOM tooling) |
| Validation / Utilities | Input validation and class composition | zod@^4.3.4, clsx@^2.1.1, class-variance-authority@^0.7.1, tailwind-merge@^3.3.1 |
npm registry | No report committed (run npm audit / SBOM tooling) |
| UI Icons | Icon set | lucide-react@^0.552.0 |
npm registry | No report committed (run npm audit / SBOM tooling) |
| Build / Type / Lint Tooling | TypeScript + lint rules | typescript@^5, eslint@^9, eslint-config-next@16.0.1, eslint-plugin-security@^3.0.1, @types/* |
npm registry | No report committed (run npm audit / SBOM tooling) |
| Unit Testing | Jest unit tests | jest@^30.2.0, @types/jest@^30.0.0 |
npm registry | No report committed (run npm audit / SBOM tooling) |
actions/ Server actions (auth, profiles, achievements, admin)
app/ Next.js App Router pages, UI components, game routes
admin/ Admin dashboard pages
api/ App Router API routes (scoped under app)
components/ Landing + learn section UI and shared UI primitives
learn/ Game routes (dungeon, parking, pinball, tower-of-hanoi)
profile/ Profile page
sign-in/ Sign-in page
components/ Shared components (sections, ui)
credits/ Credits page
data/ Local JSON data (e.g., developers list)
hooks/ Custom React hooks + React wrapper hooks
lib/ Shared utilities (audio, parking/pinball helpers, Supabase, transitions)
pages/api/ Pages Router API (Socket.IO endpoint)
public/ Static assets (models, textures, audio, sprites)
sbom/ SBOM artifacts folder (currently empty)
types/ Shared TypeScript types
unit_tests/ Jest unit tests
- Node.js 20+
- npm (ships with Node) — yarn/pnpm/bun also work with matching scripts
- Supabase project (for auth, storage, and achievements)
Create a .env.local at the workspace root with:
NEXT_PUBLIC_SUPABASE_URL=your-project-url
NEXT_PUBLIC_SUPABASE_ANON_KEY=public-anon-key
SUPABASE_SERVICE_ROLE_KEY=service-role-key
SUPABASE_SERVICE_ROLE_KEY is required for server actions that query achievements. In non-production setups you can reuse the anon key, but service-role keys should be kept server-side in real deployments.
npm install
npm run devVisit http://localhost:3000 to explore the landing experience. The Learn carousel lives at /learn, and the primary game scene at /learn/parking.
# Production build
npm run build
# Start optimized server
npm run start
# Static analysis (ESLint + Next rules)
Integration tests are maintained as a Postman Collection and can be run in Postman or headlessly via Newman.
Run the integration suite (starts a dev server and runs Newman against it):
npm run test:integrationIf you already have a server running (or want to point at a different baseUrl in Postman), run only the Newman step:
npm run test:integration:only- The runner uses postman/AlgoHub.local.postman_environment.json.
- Set
EXPECT_EXTERNAL_SERVICEStotrueif your.env.localis configured for Supabase/Gemini and you want those routes to be required to return200. - Leave it as
falseto allow external-service routes to return{ "error": "..." }(useful for running the suite without secrets configured).
- Landing: Sign in (or continue as guest). Global music plays via the shared audio bus.
- Learn Carousel (
/learn): Browse and launch games. - Play a game:
- Stack 'Em Queue (
/learn/parking): Drive through a 3D parking lot scenario to practice stack/queue operations with in-world triggers and overlays. - Binary Tree Pinball (
/learn/pinball): Build a BST from input values, choose a traversal type, then watch the traversal play out as a pinball sequence. - Tower of Hanoi (
/learn/tower-of-hanoi): Play the classic disk-moving puzzle through a staged UI flow (including a terminal-style sequence). - Dungeon (
/learn/dungeon): Launch a Phaser-based client-only game experience.
- Stack 'Em Queue (
- Progress Saving (where enabled): Profiles, achievements, and uploads (license snapshots/signatures) sync through Supabase + server actions.
- 3D assets live under
public/models,public/car-models, andpublic/car-show(GLTF + textures + HDR environments). - Audio loops and SFX can be found in
public/audioandpublic/car-audio. - Custom license textures and UI sprites sit alongside the main
publicdirectory.
AlgoHub deploys like any App Router project. Provision Supabase environment variables in your hosting provider (Vercel, Netlify, etc.) and ensure storage buckets exist for licenses/ and signatures/ uploads. Run npm run build during your CI step.
(MIT License)[https://github.com/red-sakai/Algohub/blob/main/LICENSE]



