Skip to content

About

Resources

Stars

1 star

Watchers

1 watching

Forks

Repository files navigation

System Thinking Playground

Interactive, educational visualizations of how real-world systems work — built for a YouTube channel. Each "demo" is a self-contained, animated explainer with no backend; everything is simulated in React state.

Stack: React · TypeScript · Vite · TailwindCSS · Framer Motion · lucide-react

Getting started

npm install
npm run dev      # start the dev server
npm run build    # type-check + production build

Demos

Each demo lives in its own folder under src/demos/ with its own README covering what it teaches, how to use it, and implementation notes.

Demo Teaches Docs
How WhatsApp Delivers Messages Queue · FIFO · Message IDs · Message Delivery README
How LinkedIn Finds Your Connection Level Graph · BFS · Queue · Shortest Path README
How APIs Prevent Abuse Rate Limiting · Time Windows · 429 Errors README
How Ctrl+Z Really Works Stack · Undo/Redo · State History · LIFO README
Why Apps Load Faster: The LRU Cache Cache · Hit vs Miss · LRU Eviction README

Architecture

src/
  components/            # app shell (Layout with sidebar + routed outlet)
  pages/                 # Home page (demo cards)
  shared/                # cross-demo UI (Button, Card, Phone, StatusBadge, WatchOnYouTube)
    tour/                # onboarding: spotlight Tour, useTour (auto-start once), TourButton
  lib/                   # tiny utilities (cn, time formatting)
  demos/
    types.ts             # DemoDefinition contract
    demoRegistry.ts      # single source of truth for all demos
    <demo-name>/
      README.md          # per-demo docs (usage + implementation notes)
      <Demo>.tsx         # top-level component (layout only)
      types.ts           # demo-specific models
      tourSteps.ts       # onboarding tour steps (auto-opens on first visit)
      hooks/             # demo state (custom hook, usually a reducer)
      components/        # small presentational pieces
  App.tsx                # React Router routes, generated from the registry

Routing: / is the Home page; each demo is served at /<id> (e.g. /whatsapp-delivery). Routes, the sidebar, and the Home cards are all generated from demoRegistry.ts — nothing is hardcoded.

Adding a new demo

  1. Create src/demos/<your-demo>/ following the structure above (state in a custom hook, UI in small presentational components).
  2. Write a short README.md in the demo folder: what it teaches, the controls, and any implementation notes.
  3. Add an onboarding tour (required for every demo): define steps in tourSteps.ts, tag the target regions with data-tour attributes, and wire up useTour(<demo-id>) + <Tour> + a header <TourButton> — see any existing demo for the pattern. It auto-opens on first visit and can be replayed from the header.
  4. Add one entry to src/demos/demoRegistry.ts (id, title, description, difficulty, concepts, icon, component). The id becomes the URL.
  5. Link the README in the Demos table above.

The route, sidebar entry, and Home card all appear automatically.

About

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages