If you have ever wanted to run a fast, self-hostable browser game portal—complete with offline caching, local play-time analytics, and shared-computer privacy controls—check out math_class (math_games v1.3.1).
Built with React, TypeScript, Tailwind CSS, esbuild, Vercel serverless functions, and a Cloudflare Worker, it bundles 637+ games (650+ listed in the repo summary) into a unified, static-first hub you can deploy anywhere or run locally in minutes.
Why math_class Stands Out
Most browser game sites are bloated, ad-heavy, or impossible to customize. math_class takes a different approach:
Zero User Accounts Required: Preferences, favorites, play statistics, and offline schedules all live locally in localStorage.
Built for Shared Computers: Includes a Tab Cloak (disguise the tab as Classroom or Docs), a one-key Panic Button, and a Site Lock password gate on refresh.
Offline-First PWA Support: Powered by service workers (sw.js, notification-sw.js) and generated offline manifests (offline-manifest.json, offline-packs.json), users can cache the hub and games for scheduled offline play.
Self-Host & Fork Friendly: MIT-licensed and designed to deploy cleanly to Vercel, Cloudflare Workers, or any static host.
Key Features Under the Hood
Feature
How It Works
Unified Game Catalog
Combines self-hosted HTML games (games/), externally hosted titles, and archived PolyTrack builds (0.5.0/ active, 0.3.1/ historical) via catalog.json and games/config.json.
Discovery & Layouts
Search, sort, and filter by status (Editor's Pick, Verified, Trending, Flash, Error:bug, Blocked), with classic row-card or cover-mosaic views.
In-Hub Launcher
Same-origin games open inside an in-page launcher with reload, favorite, panic, and auto-filled bug-report controls (or launch in a new tab).
Per-Device Play Stats
Tracks real elapsed time (automatically pausing when a tab sleeps or freezes), sessions, clicks, and most-played games—with an Always count toggle and hard reset.
Custom Appearance
Switch between halftone shaders, solid colors, or gradient backgrounds, and toggle the loading animation, side chat, visitor counter, footer, and optional ad space.
Moderation & Mirrors
Includes live reachability checks for mirrors/proxies, a standalone game submission form (submit/), and a password-protected admin panel backed by api/ and cf/.
Architecture & Tech Stack
Frontend (src/): React + TypeScript compiled with esbuild (scripts/build-client.mjs) into dist/home.bundle.js, styled with Tailwind CSS (dist/styles.css).
Serverless & Edge (api/, cf/): Vercel serverless functions handle admin actions, search, flags, and submissions, while a Cloudflare Worker powers proxy shortcuts, visitor/click analytics, and hub API routes.
Analytics: Optional build-time PostHog (posthog-js) integration via PUBLIC_POSTHOG_KEY and PUBLIC_POSTHOG_HOST.
License: MIT License.
Run It Locally
You only need Node.js 18+ and npm:
git clone https://github.com/NOTAM-bobk/math_class.git
cd math_class
npm install
npm run build
Then serve the repository root with any static file server:
npx serve .
or
python3 -m http.server
Deploying Your Own Instance
If you deploy the backend (api/ on Vercel and cf/ on Cloudflare Workers), set matching ADMIN_PASSWORD (or ADMIN_SECRET / VERCEL_ADMIN_PASSWORD) and HUB_INTERNAL_KEY environment variables across both deployments.
Try It Live & Contribute
Primary Site: poly2.benlaunches.icu
GitHub Repository: github.com/NOTAM-bobk/math_class
If you build a custom fork, add new games to games/config.json, or experiment with the offline service-worker packs, drop your feedback or questions in the comments!