Overview

What Schrollar is

Schrollar teaches hard ideas in small pieces. Each idea is a box with up to five layers:

LayerPurpose
HookOne picture or line that makes you care.
WhyThe problem the idea solves.
HowThe mechanism, usually with a hands-on interactive.
CodeA short, real implementation.
TryA question answered with a confidence rating: "Guessing", "Kinda sure" or "Bet my chai".

Boxes belong to topics, and topics to worlds: Graphs, Algebra, Strings, Data Structures, Dynamic Programming, How AI Thinks, Speed and GPUs, and Music Theory. Boxes declare what they build on, so the app can order them, warn you when you skip ahead, and draw maps.

The learner loop

flowchart LR
  F[Feed<br/>planner picks the next boxes] --> B[Open a box]
  B --> D[Go deeper<br/>Why → How → Code → Try]
  D --> K{Worth remembering?}
  K -- Keep --> R[Review card<br/>FSRS schedule]
  K -- Move on --> F
  D -- confident and wrong --> R
  R -- due --> RV[Review: recall, then rate]
  RV --> R
  RV --> F

Around that loop: daily puzzles with shareable challenge links, search and exploration by world and topic, decks, maps of every topic, reminders, captions in English and Hinglish (Hindi in Latin script), and an account that syncs across devices.

Design principles

  1. Offline first. Every action is written to the device first and synced later. The app works on a train with no signal, and nothing a learner does is lost to a bad connection.
  2. Content is data, not code. Lessons, interactive parameters, release notes and remote switches ship as signed content. A new lesson never waits for an app store review.
  3. One codebase, three platforms. The same React app runs as a website and inside native shells on iOS and Android.
  4. Decide transparently. Every choice the app makes for a learner (what to show next, what to review) goes through a named policy and is logged with its alternatives and reasons, so it can be evaluated and improved.
  5. Pseudonymous by default. Analytics never carry account identifiers, typed text is scrubbed before it leaves the database, and research use needs explicit consent.
  6. Boring infrastructure. Postgres as the system of record, a modular monolith for the API, managed edge and storage. Few moving parts, each well understood.

The system at a glance

PartTechnologyRole
ClientReact 19, TanStack Router, Dexie (IndexedDB), Vite, service workerThe whole learner experience, offline-capable
Native shellsCapacitor 8 (iOS and Android)Store distribution, push, haptics
EdgeCloudflare Worker and Workers AssetsServes the app and content, link previews, API proxy, rate limits
Content storeCloudflare R2 and the edge cacheSigned manifest; immutable, hashed content files
APINode 22 and Hono, bundled with esbuild, on Fly.ioAccounts, sync, sharing, push registration
JobsSame codebase, separate processLearner models, reminders, retention, lake export
DatabasePostgres (Supabase), monthly partitions for analyticsSystem of record
Data lakeParquet files on R2Pseudonymous analytics for notebooks and models
PushAPNs, FCM, Web PushReminders when cards are waiting
EmailResendSign-in codes
MonitoringSentry, Prometheus metrics on Fly, uptime checksErrors, health, alerts

The codebase

A pnpm and Turborepo monorepo:

PackageHolds
apps/webThe client (also the code inside the native apps) and the Cloudflare Worker
apps/mobileCapacitor projects for iOS and Android
apps/apiThe API, background jobs and migrations
tools/content-cliValidates, builds, signs and publishes content
packages/content-schemaThe content format: boxes, layers, templates, release info
packages/protocolEverything the client and API exchange: sync mutations, payloads, responses
packages/learningSpaced repetition (FSRS), card derivation, learner state, mastery
packages/plannerThe feed planner: decides what comes next
packages/decisionsDecision logging: candidates, scores, propensities, explanations
packages/experimentsDeterministic experiment assignment, shared by client and server
packages/eventsThe analytics event catalogue: names, props, PII class, retention
packages/playables, scenes, renderer, uiInteractives, illustrations, box rendering, design tokens

${sch.nav()}