Math learning platform
SomeMath#
Courses and 27 arcade-style math games that teach understanding before speed. English and Thai, KaTeX formulas, CMS-managed content and PDF certificates.
- Next.js 16
- Sanity
- Clerk
- Stripe
- TanStack Start
- KaTeX
- Intlayer

Overview#
SomeMath is a bilingual mathematics learning platform built for English and Thai learners. It pairs structured video and LaTeX courses on somemath.com with Learning Space, a browser arcade at space.somemath.com containing 27 interactive math games.
The platform targets students who want conceptual intuition before drilling speed. Courses break topics into modules and lessons with inline formulas, per-lesson notes, and completion certificates, while the games turn arithmetic, fractions, algebra, geometry, graphing, trigonometry, and statistics into short playable exercises.
Features#
| Area | Capabilities |
|---|---|
| Courses & lessons | Modules and lessons managed in Sanity CMS, video playback via Plyr, Loom, Vimeo, and YouTube, inline math rendered with KaTeX and MathLive, and per-lesson student notes. |
| 27 math games | Dedicated Learning Space covering arithmetic (Speed Arithmetic, Numetric, Target 24, Math Bingo), algebra (Algebra RPG, Balance Scale, Function Machine, Coaster Slopes), fractions (Fraction Tug, Pizza Fractions, Potion Fractions), geometry (Angle Artillery, Laser Geometry), trigonometry (Pirate Trig), graphing (Space Graphing), and statistics (Sports Stats). |
| Bilingual UI | Full English and Thai interface switching across courses and games, with cookie-backed dark/light theme sync across *.somemath.com. |
| Enrollment & certificates | One-click enrollment for free courses, Stripe checkout and webhook fulfillment for paid courses, progress tracking per lesson, and on-demand PDF completion certificates generated at /api/certificate once course progress reaches 100%. |
| CMS authoring tools | Embedded Sanity Studio at /studio with custom LaTeX input components and an AI drafting endpoint (/api/ai/generate) routed through Vercel AI Gateway to generate structured Markdown and Portable Text lesson content. |
Screenshots#




How it's built#
The repository is a Bun workspace monorepo split into three applications under apps/, linted and formatted repo-wide with Biome:
apps/web— Main LMS on Next.js 16 (App Router, React 19, Tailwind CSS v4, shadcn/ui). Uses Sanity v6 (next-sanityand GROQ) as its data layer for courses, modules, lessons, students, enrollments, lesson completions, notes, and certificates. Uses Intlayer (next-intlayer) inno-prefixcookie/header mode for EN/TH localization, Clerk (@clerk/nextjs) for authentication, Stripe for paid checkout and webhooks, KaTeX and MathLive for math rendering,@react-pdf/rendererand@embedpdf/react-pdf-viewerfor PDF certificates, and PostHog plus Vercel Analytics for telemetry.apps/space— Standalone Learning Space on TanStack Start, Vite, React 19, and Nitro hosting all 27 interactive game components (src/components/learning/games/*) and their metadata registry (src/lib/gamesData.ts). Localized with Paraglide JS using unprefixed English routes (/algebra-rpg) and/th/*Thai routes.apps/meet— Sibling live-tutoring and classroom scheduling app on TanStack Start, Nitro, LiveKit, PostgreSQL, Clerk, Stripe, S3 storage, and Paraglide JS.
Theme preferences are mirrored into a cookie scoped to .somemath.com so navigating between the LMS (apps/web) and Learning Space (apps/space) preserves light or dark mode. apps/web is deployed on Vercel with reverse-proxied PostHog ingestion routes and HSTS/security headers configured in next.config.ts.
Using it#
- Open
https://space.somemath.comto play any of the 27 math games immediately in the browser—no account is required. Filter by keyword or topic tag, and use the top-rightEN | THtoggle to switch languages. - Open
https://somemath.com/coursesto browse available courses, inspect module outlines, and search by topic. - Sign in with Clerk to enroll in free or paid courses, track lesson completion under My Courses, save per-lesson notes, and download a PDF certificate once all lessons in a course are completed.