System design

How Teachers That Tutor is put together

One curriculum spine feeds seven product areas. This page walks through the layers, the business flows behind each area, how data moves when a pupil answers a question, and the rule engine that decides what to recommend next.

System architecture

Four layers, each with a single responsibility

Experience layer

  • Next.js App Router (React server components)
  • Role-aware shell: sidebar, topbar, switchers
  • Route-level loading states for every navigation
  • Responsive layouts, fixed LTR direction in all languages

Domain layer

  • Curriculum service: year → subject → topic → lesson
  • Assessment service: questions, marking, attempts
  • Progress service: mastery, streaks, readiness
  • Recommendation rule engine and Ask TTT assistant

Data layer

  • Prisma schema as the single source of truth
  • Typed collections mirrored in the client store
  • Deterministic seed data for every environment
  • Audit log for every content and account change

Platform layer

  • Role-based access control per route prefix
  • Subscription and seat entitlements
  • Mapbox for centre locations
  • Safeguarding filters on generated content

Browser

Parent · Pupil · Teacher · Admin

App Router

Server components + route loaders

Domain services

Curriculum · Assessment · Progress

Prisma data model

Typed collections + audit log

Data flow: one answered question

From tap to updated reporting

  1. 1

    Pupil answers

    Practice runner

  2. 2

    Answer normalised

    Case, spacing, units

  3. 3

    Marked instantly

    Correct / incorrect

  4. 4

    Attempt stored

    Child, question, seconds

  5. 5

    Aggregates rebuilt

    Topic mastery, subject score

  6. 6

    Surfaces update

    Dashboard, Insights, Marking

Read paths

Selectors derive every number on screen from attempts, lesson progress and paper scores. Nothing is stored twice.

Write paths

Writes are small and append-only: an attempt, a progress row, an assignment toggle, an audit event.

Boundaries

A pupil write can only ever touch their own profile; teacher and admin writes touch content, never billing.

Business flows

The four journeys the platform is built around

Family onboarding

1

Parent signs in

2

Add child profile (year group, school)

3

Plan and seats checked

4

Curriculum filtered to the year group

5

Dashboard seeded with recommendations

Practice and marking

1

Pupil opens a practice set

2

Answer normalised and compared

3

Attempt written with time taken

4

Explanation shown immediately

5

Mastery and subject score recalculated

Content pipeline

1

Teacher drafts lesson or question

2

Second teacher reviews

3

Admin publishes

4

Content appears in Learn, Practice, Studio

5

Audit event recorded

SATs readiness

1

Paper downloaded

2

Score recorded against the child

3

Paper average recalculated

4

Weak topics surfaced in Insights

5

Revision practice suggested by Ask TTT

Recommendation rule engine

Deterministic rules, evaluated in weight order, that decide what a child sees next

RuleNameWhenThenWeight
R1Continue learningA lesson has progress above 0% and below 100%Pin it to the dashboard as the next action, ordered by most recent activityHighest
R2Weak topic focusTopic accuracy is below 60% with at least 4 answersRecommend the topic’s practice set and its explainer videoHigh
R3Assignment dueAn assignment is incomplete and due within 3 daysRaise it in Upcoming and mark it on the pupil dashboardHigh
R4Streak protectionNo answers recorded today and the streak is 3 days or moreOffer a 5-question set from the strongest topic to keep the streak aliveMedium
R5SATs windowChild is in Year 6 and within one term of the SATsBias recommendations towards arithmetic, reasoning and past papersMedium
R6StretchTopic mastery is 90% or aboveOffer greater-depth questions and mark the topic as secure in InsightsLow

Child signals

Attempts · progress · papers

Rule evaluation

R1 → R6, first match wins per slot

Ranked actions

Lesson · practice · video · paper

Surfaces

Dashboard · Insights · Ask TTT

Content pipeline

Draft to published, with review built in

Draft

Author-only. Invisible to families and pupils.

In review

A second teacher checks wording, marks and explanation.

Published

Live in Learn, Practice, Studio and Papers.

Archived

Hidden from pupils; historic attempts stay in analytics.

Status changes are recorded in the audit log with the actor and timestamp, so any piece of content can be traced from first draft to the moment pupils saw it.

Data model

Core entities and how they relate

YearGroup

has many Topics, Children, Papers

Subject

has many Topics

Topic

has many Lessons, Questions, Videos, PracticeSets

Lesson

has many LessonProgress rows

Question

has many Attempts, belongs to PracticeSets

Child

has Attempts, LessonProgress, Assignments, PaperAttempts

User

guardian of Children, author of Lessons and Questions

Subscription

has many Invoices, grants seats to a User

Role isolation

Access is granted per route prefix, so no workspace leaks into another

AreaParentPupilTeacherAdmin
Dashboard, Learn, Practice, Studio, Papers, AskAllowedAllowed
Insights and family reportingAllowedAllowed
Billing, plans and seatsAllowedAllowed
AchievementsAllowed
Authoring and markingAllowedAllowed
Curriculum and content managementAllowed
People, subscriptions and audit logAllowed

Ask TTT pipeline

How a question becomes an explanation and extra practice

Prompt

Parent or pupil question

Intent + keywords

Topic, child, task

Context assembled

Progress + published content

Answer drafted

Explanation in teacher voice

Practice generated

Saveable as a set

Generated questions are always attributed to the topic they came from and can be saved as a practice set. Safeguarding filters keep responses inside the Key Stage 2 curriculum, and any question the assistant cannot ground in published content is handed to the teaching team instead.