Skip to content
webdmamun
All work

E-Learning & Course Delivery Platform

A full-stack e-learning platform: course discovery, checkout, enrolment, secure lesson delivery, learner progress, quizzes, certification and public certificate verification.

Industry
Online education and regulated qualifications
Status
in development2026

Built with Next.js, React, TypeScript, MUI, PHP, Laravel, Filament, PostgreSQL, Redis, Stripe, Resend, Bunny Stream, PHPUnit, Nginx, Oracle Cloud, Vercel

This system holds sensitive client data, so it is described without naming the client, without a link, and without screenshots of real records.

The system in numbers

Domain modules
11
Admin resources
12
Database migrations
41
Automated tests
547
Frontend routes
24
Product surfaces
4

Source: Repository audit of the source monorepo, September 2026.

In this case study

The problem

An online training provider has to run four businesses at once, and they interlock badly.

A shop. Courses have prices, sale prices, categories and levels. Money has to be taken reliably, and the price shown has to be the price charged.

A content platform. Lessons, downloadable resources and video are the product. A URL that works without a purchase has given the product away.

An assessment body. Quizzes have to be marked consistently, and a marked attempt is evidence that must survive the quiz being edited afterwards.

A certificating body — but only sometimes. Some courses the provider certificates itself, issuing a numbered document a third party can verify. Others are regulated qualifications awarded by an external organisation, where issuing a platform certificate is not a feature but a compliance error. One system has to do both and never confuse them.

Underneath all four sits the ordinary hard problem of commerce software: the network is unreliable, people double-click, and payment providers deliver the same message more than once.

What was needed

One platform covering the whole lifecycle — discovery, purchase, enrolment, delivery, progress, assessment, certification and public verification — with the money and the evidence both correct under retries, concurrency and later edits.

What I built

Two applications over one database: a Next.js storefront and learner app, and a Laravel API that also hosts the administrative panel.

The API is a modular monolith — eleven domain modules, each with its own models, single-purpose actions, services and resources. Business rules live in those actions rather than in controllers, which is what lets one pricing service serve both the storefront display and the amount charged, and one completion rule serve both the progress bar and the certificate entitlement check.

The administrative panel carries twelve resources across catalogue, people and commerce, led by a system-health view that reports every integration the platform depends on. Around it: PostgreSQL, Redis for cache and queue, Stripe for payments, transactional email, a video service, and PDF and QR generation for certificates.

Who uses it

StorefrontVisitors
Course catalogue with search, category and level filters, qualification detail pages, basket and checkout.
LearnerStudents
Enrolled courses, the lesson player, downloadable resources, progress, quiz attempts and certificates.
AdminOperations
Courses and curriculum, media and video, users, enrolments, entitlements, unlock codes, certificates, orders and system health.
VerificationAnyone, without an account
A public page that checks a certificate from its token and shows the details frozen at the moment it was issued.

What it does

  • Course catalogue

    Search, category, level and sort filters over courses carrying study hours, assessment method and qualification structure.

  • Checkout

    Hosted checkout or in-page card entry, with eligibility and amount both decided on the server.

  • Basket

    One payment covering several orders, without weakening double-charge protection.

  • Enrolments

    Created from a paid order, or by an administrator directly, regardless of access type.

  • Lesson delivery

    Modules and lessons with text, resources and video — every content path gated on an active enrolment.

  • Progress tracking

    Lesson completions aggregated into course progress by one shared rule.

  • Quizzes

    Questions, options, pass marks and attempt policies, with each marked attempt frozen as evidence.

  • Certificate entitlements

    An eligibility lifecycle per learner and course, claimable on completion or released by an unlock code.

  • Certificate issuing

    Concurrency-safe, idempotent, numbered from the database, with the displayed details snapshotted.

  • Public verification

    A random token per certificate, checkable by anyone with no account and no enumeration.

  • Regulated qualifications

    Courses awarded by an external organisation are blocked from platform certification in the form and again at issue.

  • System health

    Environment, queue, cache, Redis, video, payments, email and storage reported on the first admin screen.

The storefront

Course catalogue with search, category and level filters, qualification detail pages, basket and checkout.

The storefront. Branding is obscured throughout — this case study is published without naming the client.
Discovery: filters by category and level, with the price resolved by the same service that will later charge it.
A regulated qualification. The page states plainly that the certificate comes from the awarding organisation, not from the platform.
The learner entry point. Sessions are cookie-based, so the frontend fetches a CSRF token before any mutating request.

The admin platform

Courses and curriculum, media and video, users, enrolments, entitlements, unlock codes, certificates, orders and system health.

System health first. With this many integrations, the operator’s first question is which dependency is down — so it is answered on the first screen.
The catalogue as operations sees it, including which courses are externally awarded.
The compliance branch. The rule is stated in the interface and enforced again at the point of issue.
Money is handled in minor units end to end. The field explains that 4999 means £49.99 and that this is the amount that will be charged.
The media library behind course and lesson content.
Empty states as documentation: the screen explains the mechanism to whoever opens it.
The certificate register. Issuing is transactional, idempotent and numbered from the database.

The hard parts

A webhook that arrives twice must not enrol twice

Payment providers guarantee at-least-once delivery, not exactly-once. The same "payment succeeded" event can arrive twice, or arrive while the first copy is still being processed — and fulfilling on receipt turns one card charge into two enrolments, two orders and two payment records.

I split receiving the event from acting on it. Every delivery is written to a receipt table first, keyed on the provider's own event id, so concurrent inserts are absorbed by a unique index rather than by application-level checking. The receipt is then re-read inside a transaction with a row lock, so a second delivery waits instead of racing, and a processed marker short-circuits anything already handled.

The part that matters is that the marker and every fulfilment write commit or roll back together. There is no window where a learner is enrolled but the event is not marked done, or the reverse. Fulfilment reads the originally verified payload, so a receipt written but never finished stays replayable rather than disappearing, and the transaction retries on deadlock.

Certificate numbers that cannot collide

Two clicks on "claim my certificate" must not produce two certificates, and two certificates must never share a number.

Issuing runs in a transaction that opens by locking the learner's certificate entitlement — the thing that is genuinely one-to-one with a certificate — which serialises simultaneous claims. If a certificate already exists for that entitlement, the loser of the race is handed the winner's certificate rather than an error.

The number is derived from the certificate row's own primary key. The alternative, reading the current maximum and adding one, is the bug: two claims committing at the same moment would both read the same answer before either inserted. Deriving it from the key means uniqueness comes from the database rather than from application-level care. The verification token is forty-eight random characters rather than a sequence, so certificates cannot be enumerated.

Evidence that survives its own source being edited

A certificate carries a name, a course title, a level and a provider. All of those stay editable afterwards. If the certificate renders live data, correcting a course title next year silently rewrites evidence issued this year.

So what a certificate displays is frozen into its own record at the moment of issue, and read back from there forever.

The same discipline applies one level down, to quiz attempts — with one extra decision I would defend hardest. The frozen attempt records what was asked, in order, what was chosen and how each answer was marked, and it is explicitly excluded from scoring. It is a record of what happened, not a source of truth for the live quiz. A snapshot that could have been used for marking, and deliberately is not.

One place decides what something costs

Prices lived in two columns for historical reasons, a sale price of zero has to mean "no sale" rather than "free", and a browser would happily choose its own amount.

A single pricing service resolves the payable amount, and the same service produces both the storefront display price and the figure sent to the payment provider, so the two cannot diverge. Money is handled in minor units throughout and converted from the fixed-point string rather than through a float. A non-null minor-unit value wins including zero, so a null sale price means no sale rather than falling back to a stale decimal mirror.

Eligibility is re-read from persistence at the moment of purchase: the policy refetches the course and checks the raw stored status, because an already-loaded model or a pending order is not permission to buy. The admin form states the contract to whoever types into it — four thousand nine hundred and ninety-nine means £49.99, and that is what will be charged.

A compliance rule enforced in two places

Some courses are regulated qualifications awarded by an external organisation. For those, issuing a platform certificate is not a feature — it is a compliance error.

The course editor asks the defining question first: what kind of thing are you creating? That choice rewrites the rest of the form, and for a regulated qualification the certificate policy is switched off and cannot be re-enabled, stated in plain language in the interface rather than hidden in a disabled control.

The issuing action then refuses independently, for a reason worth stating: an entitlement may predate the course being marked regulated. One enforcement point would have been a bug waiting for somebody to reclassify a course.

Making the basket work without weakening it

Originally one order meant one payment session, enforced by unique indexes. Basket checkout broke that: one session and one payment intent now cover several orders, so those columns cannot stay unique.

Dropping a unique index is exactly how replay protection gets lost by accident. So the migration that did it spends a paragraph explaining where the protection actually lives — a delivered event is recorded once by its provider event id and skipped if already processed, each order refuses fulfilment a second time once it is paid or refunded, and fulfilment still refuses to act when the session presented does not match the one the order was created with.

The schema change is a written argument, not just a schema change. Anyone later asking "why is this not unique any more?" gets the answer from the code.

Architecture

A Next.js application serves the storefront and the learner area and is deployed separately from the API. A Laravel API owns the domain and also hosts the administrative panel, running on a cloud instance behind nginx with PHP-FPM, alongside PostgreSQL and Redis.

Authentication is a cookie session rather than a bearer token, which is why both halves share a parent domain in production and why the frontend fetches a CSRF cookie before any mutating request. Roles and permissions sit on top of that.

Redis does double duty as cache and queue, with a systemd unit for the queue worker and another for the scheduler. Certificates are rendered to PDF with a QR code pointing at their public verification URL. The host is provisioned from templates in the repository — nginx and PHP configuration, service units, certificate issuance, and timer-driven backups with a written restore procedure.

tokenStorefrontLearner appPublic verificationAdmin panelSession auth & rolesDomain modulesOrders & paymentsEnrolments & progressQuizzes & certificatesPostgreSQLRedis · cache & queuePayments · email · video

Where it stands

The platform is built and running in a staging environment, with the schema migrated, the catalogue and certification model in place and the administrative panel in use. Domain cutover and content loading are the remaining work before public launch, so no learner numbers, order volumes or revenue are reported here — there are none yet, and inventing them would be the easiest lie in a portfolio.

What can be stated is behaviour that the test suite holds in place: a duplicated payment event cannot enrol a learner twice, two simultaneous certificate claims cannot produce two documents or two numbers, an issued certificate and a marked quiz attempt do not change when the course behind them is edited, the price displayed is the price charged, and a regulated qualification cannot be certificated by the platform.

More screens

Public verification needs no account. An invalid token is refused outright, and tokens are random rather than sequential so certificates cannot be enumerated.

Want something like this? Tell me how your business runs today.