A multi-role LMS that measures a student's attention, perception and reading skills, then prescribes and delivers the training that targets the gap — with commerce, entitlements and a video pipeline built in.
Client context
Kapsül Hafıza is a Turkish education company specialising in cognitive-skills training — speed reading, memory techniques, mind mapping and study strategy — for school-age students in grades 1 to 12. Their curriculum was mature and proven in person. Their delivery was not: it depended on instructors running exercises manually, scoring paper diagnostics by hand, and tracking cohorts in spreadsheets.
The operational challenge
Cognitive training is not content consumption. It is a measure → prescribe → practise → re-measure loop, and every step of that loop resisted a generic LMS:
- Diagnostics have to be scored against grade-specific norms. A perception score of 62 means something different for a 3rd-grader than for a 7th-grader. Off-the-shelf quiz engines score one way for everyone.
- The exercises are interactive, timed and visual. Peripheral-vision drills, letter-grid scans, flash-word tracking, Burdon attention tests. None of them are a multiple-choice question with a video attached.
- The same exercise must be re-parameterised per grade. A 4th-grader and a 9th-grader do the same drill at different speeds, grid sizes and durations.
- Commercial access and pedagogical access are different problems. A family buys a package; a teacher assigns a class exercise. Both have to resolve to the same answer: may this student open this thing, right now?
- A single wrong permission leaks a minor's data. Multiple roles, real children, one shared tenant.
Product strategy
The decision that shaped everything else was to treat exercises as parameterised templates, not content records. Rather than authoring 881 separate exercises, the platform ships 52 interactive React templates and stores each exercise as a template reference plus a parameter set — grid rows and columns, target letter, target count, search duration, grade levels. Staff tune sliders against a live preview and publish. Adding a new drill type is an engineering task; adding a new drill is a two-minute authoring task.
The second decision was to make entitlements category-bound and resolved at read time. Packages grant categories, not fixed lists of exercises. When the team adds an exercise to the "attention" category, every family who already owns an attention package gets it immediately — no backfill job, no migration, no support ticket.
The core solution
A single Next.js 15 application on PostgreSQL, serving five roles from one permission model:
| Capability | What it does |
|---|---|
| Diagnostic assessments | 7 test families (attention, perception, reading, memory, focus, Burdon, a 40-question 360° screen), scored against grade-band thresholds and rendered into levelled narrative reports |
| Training engine | 52 interactive templates, 881 published exercises across 6 categories, per-grade parameter overrides, timed sessions |
| Curriculum delivery | Courses → modules → lessons, HLS video with a distinct variant per grade band, position-level watch telemetry |
| Class operations | Classes, enrolment, manual ordering, homework, live sessions via BigBlueButton |
| Commerce | Package store, iyzico 3DS checkout, refunds, invoice PDFs, a reconciliation cron that settles stuck orders |
| Entitlements | Read-time gate resolving package grants, class prescriptions and individual assignments |
| Gamification | 94 themed badges, points ledger, streaks, leaderboard |
| Operations | Staff analytics, a User-360 support console, audit log, certificate issuance and public verification |
Primary workflows
Buy → grant → measure → train. A parent buys a grade-appropriate package. iyzico completes 3DS; both the callback and the webhook fire, so order finalisation is race-guarded and idempotent. Entitlements open. The student takes a diagnostic, the platform scores it against their grade band and produces a levelled report. Teachers see the cohort result and assign exercises. The student trains; sessions, points and badges accrue. After the configured retake interval, they re-test and the delta is visible to staff.
Author once, deliver per grade. A staff member configures an exercise template against a live preview, tags the grade levels it applies to, and publishes. Students in grades 5 and 6 receive it with the parameters set for them; students in grades 7 and 8 receive the same drill tuned differently. Lesson videos follow the same rule — one HLS variant per grade band, transcoded by a background worker.
My role
Sole engineer across product, architecture, implementation and production operations: schema and migration strategy (99 applied migrations), the permission model, the exercise and assessment engines, payments and entitlements, the video pipeline, CI/CD, and live incident response against real user traffic.
Technical approach
Three choices a buyer should care about:
Permissions are declarative, not scattered. A capability registry exposes three primitives — can() for UI, authorize() for mutations, scopedWhere() for list queries. scopedWhere() is the load-bearing one: it returns the tenant-and-ownership predicate that every list query must apply. Migrating pages onto it surfaced two real cross-tenant defects that role-only checks had hidden. A test asserts the registry's shape and blocks deploys.
Risky behaviour ships behind flags with a shadow mode. The entitlement gate ran in shadow first — reporting what it would have blocked — until the production data proved complete. Only then was enforcement switched on. It is on in production today.
The pipeline is the safety net. Eleven checks gate every deploy — typecheck, lint, the permission registry, a design-token ratchet, and behavioural tests for the specific regressions that had previously reached users. Migrations apply before the build; the release is blue/green with a post-deploy health verification. Deploy time was cut from 23 to 10 minutes by reusing unchanged worker images, persisting the build cache on a weekly key, and shipping through a registry instead of copying tarballs.
Outcomes and evidence
Verified against the running application and, for aggregate counts, read-only queries:
- Operating in production since March 2026, serving a full school cohort across student, teacher, manager, staff and admin roles on one tenant.
- The access model resolves at real cohort size, not on seed data — students provisioned end to end across course enrolments, class memberships and package entitlements.
- 881 published exercises from 52 templates across six categories, plus 51 diagnostic assessments and 2,400 authored questions.
- 226 lesson videos transcoded and serving, with zero variants stuck in a failed or queued state.
- A real payment integration handling real money — iyzico 3DS checkout with refunds and order reconciliation — live, at early volume.
No performance-improvement, time-saved or revenue figures are claimed, because none have been measured.
Confidentiality
Published with the client's agreement. Screenshots come from a development instance and are limited to screens with no personal data; cohort, pricing and commerce figures are the client's business data and are withheld.
Need a similar product or workflow? If you are turning a proven offline methodology into a measured, multi-role platform — with the commerce, permissions and media pipeline that implies — I build these end to end.



