← Back to systems
Flagship Production2026· Backend / Full-Stack Engineer (Contract)

School Platform: Landing + CRM + LMS

Production monorepo for an online exam-prep school · Sole engineer · Since March 2026

Status
Production
Running the school's daily operations since March 2026
Users
Daily use
Used daily by the school's students, teachers and admins

Architectural Trade-offs & Decisions

✓ One monorepo behind a single edge proxy
✕ Rejected: Separate deployments for the site, the CRM and the LMS
One routing layer and cross-subdomain SSO mean a single login, one deployment pipeline and shared types between the public site, staff tools and the student LMS.
✓ Prisma & PostgreSQL relational model for CRM and billing
✕ Rejected: Decoupled per-service databases
Payment confirmations, lesson billing and course access live in one transactional database, so a payment and the access it grants commit together.

Context

I built the platform solo to replace the rigid off-the-shelf CRM the school was using. It runs the school's daily operations: enrollment, scheduling, attendance, billing, payroll and course delivery.

Architecture

A single Next.js App Router monorepo serves three surfaces behind one edge proxy with cross-subdomain SSO:

  • Public site — the landing and lead intake, feeding applications straight into the CRM.
  • CRM — role-based tools for admins and teachers: students, groups, attendance, balances and payroll.
  • LMS — the student side: lessons, materials and embedded video with per-request access checks.

Engineering highlights

  • Race-safe lesson billing. After a review showed SERIALIZABLE + FOR UPDATE aborting concurrent writes, I redesigned it around READ COMMITTED with an explicit, deadlock-free lock order. The billing core is open source.
  • Payment webhooks with a timing-safe secret check, IP allowlist, idempotency keys and server-side re-verification with the provider, so no payment is credited twice or without confirmation.
  • Payroll engine with mid-cycle proration and idempotent lead-to-student conversion.
  • Enumeration-safe login, Postgres-backed rate limiting, and access checks on presigned storage URLs.
  • LLM features in production: a streaming AI tutor in the LMS and a report generator with prompt-injection sanitising, schema validation and hard timeouts.