A versioned-prompt curriculum engine for a medical education platform
Role-segmented learning for healthcare professionals, with course and assessment generation driven by prompt files under version control and a recommender that carried its own evaluation harness.
- Sector
- Medical education platform for healthcare professionals
- Engagement
- September 2023 – February 2024
- Next.js
- React
- Node
- Express
- Python
- FastAPI
- PostgreSQL
Context
The platform served healthcare professionals whose learning needs diverge sharply by role — a nurse, a medical student and a field medical liaison do not want the same curriculum, the same assessment or the same permissions. Authoring that by hand for every role does not scale. Generating it with a model instead moves the problem rather than solving it, unless you can answer two questions afterwards: why did this month's output differ from last month's, and once there is a catalogue, what should be put in front of whom.
What we built
Web app
49 top-level routes and 22 role-scoped trees, live video sessions and Socket.IO, with Jest and Testing Library configured.
Backend microservices
Four services — core, dbmanager, master and user — sharing config, middleware and utilities via file: dependencies.
AI service
Curriculum, quiz, poll and survey generation from versioned prompt files, plus the recommender and its scheduled jobs.
Architecture
Three parts. A Next.js web application with 49 top-level routes and 22 role-scoped route trees, so role differences were a routing and permission concern rather than conditionals scattered through a single dashboard. Node/Express microservices behind it, sharing internal core packages (config, lib, middleware, server, utils) plus a dbmanager through file: dependencies, so cross-cutting changes landed in one place. And a FastAPI AI service, which is where the interesting decisions were. Prompts were files in the repository, not strings in code: 22 of them, carrying explicit version suffixes and a separate variant per batch for the newer model, which makes a model migration a reviewable diff and ties an output change to a specific prompt change. The recommender was deliberately classical rather than another model call — content-based KNN with a real evaluation harness beside it (an evaluated-algorithm wrapper, an evaluation data split, an evaluator and a metrics module) so recommendation quality could be measured offline before shipping. The service was layered explicitly: database access, encryption, exceptions, cron, image-to-script, project library, prompts and utilities each their own layer. The front end carried Jest and Testing Library, which is not universal on projects of this age.
Stack
- Web app
- Next.js 13
- React 18
- Apollo Client + GraphQL
- Redux Toolkit
- Backend microservices
- Node
- Express
- shared internal core packages
- AI service
- Python
- FastAPI
- OpenAI
- PostgreSQL
- Integrations
- OpenAI — generation for curricula, quizzes, polls and surveys
- VideoSDK — live video sessions inside the web app
- Socket.IO — realtime updates
- GraphQL via Apollo Client — the web app's data layer
- AWS SDK and node-cron — scheduled backend work
- PostgreSQL — shared state across the services
Scale
Counts that can be re-derived from the same repositories. Nothing here is a business result — a repository cannot evidence one.
- 1,593 commits across three repositories (1,031 + 394 + 168).
- 49 top-level web routes and 22 role-scoped route trees.
- 22 versioned prompt files.
- 5 modules in the recommender's evaluation harness.
Where the evidence stops
- The generated curriculum content itself — the client's actual product — is not described.
- No business outcome is claimed.
Evidence
Each statement above, and the artefact it was read from. The client cannot be named, so the sources are given instead.
1,593 commits across three repositories.
Sourcesum of history.totalCount on each repository's default branch (1,031 + 394 + 168)
22 versioned prompt files, with explicit version suffixes and per-batch model variants.
Sourcebackend/prompts_layer/ directory listing in the AI service
22 role-scoped route trees.
Sourcepages/[role]/ directory listing in the web application
49 top-level web routes.
Sourcepages/ directory listing in the web application
The recommender's evaluation harness is 5 modules — ContentKNN, EvaluatedAlgorithm, EvaluationData, Evaluator, Rec_Metrics.
Sourcerecsys/ directory listing in the AI service
Front-end test setup: jest ^29.7.0 with @testing-library.
Sourcepackage.json in the web application repository
Engagement span: 2023-09-20 → 2024-02-06.
Sourcefirst and last commit dates on the default branches
Related capability