
Testa LMS
An online learning platform for a school: courses, assignments, grades and exams in one place, plus a phone app for students. Held 10,000 people at once with a laptop as the server, restore rehearsed, not yet in use.
- Status
- Awaiting rollout
- Category
- Web
- Stack
- JavaVuePostgreSQLDockerSpring Boot
- Links
- No public links
01Overview
Teachers post materials, set assignments, open discussions and run exams inside a course; students sign in with their school account to submit work, sit exams and see grades. Rosters and courses sync read-only from the school database every day, so courses keep working when the school’s systems are down. Exam timing, submission and grading happen only on the server, and papers sent to students never contain answers; choice and fill-in questions grade themselves, and essays are graded anonymously by one or more teachers. Everything runs with Docker Compose on one host, with all data in PostgreSQL and daily backups; no Redis, no message queue, and responses still take 0.2 s with 6,000 people at once.
02Context and constraints
Testa is an online exam system for admission exams; Testa LMS branched off from it and grew into a school's online learning platform: teachers post materials, set assignments, open discussions and run exams inside a course, students sign in with their school account, and scores collect in one gradebook. The exam went from being the product to being one activity in a course; even the admission exam is just an exam in a course under the admissions office.
I built all of it alone: the web app, the backend, the deployment, and a phone app for students. Three constraints explain most of the decisions below:
- The people who will run it are not engineers. School staff have to handle backups, restores and settings from a document, without signing in to the server to edit files.
- The school's existing systems must not change. Accounts, courses and rosters live in the school's own database, which is old, shared by every system, and read-only to me.
- Getting an exam wrong is expensive. A candidate's computer must not be able to change the time, the paper must not carry the answers, graders must not know whose paper they are grading; the lab may be cut off from the Internet, and a restart mid-exam must lose nothing.
03Architecture
Everything runs with Docker Compose on one host. The frontend is Vue 3 + TypeScript, the app is Expo, the backend Java 21 + Spring Boot, data lives in PostgreSQL, and the schema is managed by Flyway, add-only. Sessions are in the database too, so restarting the backend signs nobody out.
04Key trade-offs
The school's database is slow and every system uses it. Pages read only the local copy: courses keep working when the school's systems are down, and no amount of clicking can drag the school down. The permission check (does this student take this course) runs on every request, so it has to be a local query as well. The sync has a guard: a read with under half the rows of the previous one is rejected whole, so a bad day on the school's side cannot wipe the rosters.
Where Redis would have gone, a local table with a sync time is the cache; background work is a table read with FOR UPDATE SKIP LOCKED, which survives a restart. One service fewer is one thing fewer to deploy, back up and monitor. This is not a guess: with a laptop as the server, responses still take 0.2 s at 6,000 people, and at 10,000 the first thing to run out is the processor, with no slow query in the database. Resilience is handled separately: restarting the backend and the database mid-exam is tested, backups run daily, and a backup has actually been restored into an empty database.
Once the platform took shape I went back and deleted: standalone exam units, the site-wide exam list, the staff home, the members page, emergency access, batch accounts. The admission exam kept only the three things that really differ: the roster file, the login slips and the candidate sign-in page; the rest is shared with any course exam. In a system one person maintains, every extra path is one more thing to test, document and explain at handover.
The assistant can answer "which students should I talk to", but that touches grades and absences. So the model reaches data only through a set of read-only tools, and the tools replace names and student numbers with codes before returning anything; it cannot post an announcement or change a score, only draft text. Each use leaves one line: who, which kinds of data, how many seconds; not the question and not the answer. If the school does not turn it on, it does not exist.
A browser's clock can be changed and a computer can crash. So the deadline exists only on the backend: a candidate who reconnects gets the remaining time from the server, candidates who never come back are submitted by the backend, and extra time only moves the server-side deadline. The countdown in the browser is display only. Papers sent to candidates use a separate data shape with no fields for answers, explanations or rubrics, and a test enforces it.
Candidates are not students yet and have no school account, and asking them to register adds one more step that can go wrong. The exam officer imports the roster (Excel or CSV, Big5 included), and login codes are generated only when the slips are printed: the database keeps only a hash, the code appears only on that slip, and reprinting issues a new one. A candidate can have only one active session, too many wrong codes lock the candidate out, and a proctor can reset it.
Administrators look after accounts, backups and the system, not teaching content. Every permission check goes through one guard, and a system administrator never passes its course-role checks: they can manage that a course exists, how much space it uses and its backups, but cannot read the questions or the scores inside.
The first requirement was exactly three; the school later changed it to one or more, so the number is not hard-coded. Graders see only a paper code, never the candidate's name or other graders' scores. When graders differ by more than 20% of a question's points, the officer is warned before publishing. A submitted score can't be changed by the grader; the officer reopens it with a reason.
Essays need teacher review, and the school announces results on its own website. So publishing means locking scores and exporting them to Excel for the school. Whether candidates can sign in to see their total and subtotals is the officer's choice for each exam, and they only ever see scores, never answers or comments.
The people who will run it are school staff, not engineers. So the grader disagreement threshold, data retention, sign-in lockout and the backup schedule are picked from menus in the system settings, with the defaults marked; restoring and deleting backups also happens in the admin pages, behind a confirmation, and the most destructive actions ask for typed text. The operation manual lives inside the system with short videos, and a script regenerates its screenshots and clips from demo data whenever the UI changes.
05Before launch
It is not in use yet. Everything that can be checked in development has been checked on the production images:
10,000 people at once. A second computer simulated 10,000 people spread over courses, grades, forums, hand-ins, exams, surveys and the app, with a laptop as the server. Up to 6,000 people the median response is 0.17 s and a whole page takes under half a second; at 10,000, about 1.26 million requests with 7 failures, no server error and no restart, a page taking about 2.5 s. How it went, including the run that broke, is in this post (in Chinese).
A class of 500. Roster, gradebook, progress table and hand-in list answer in 10 to 22 ms.
A full exam with no Internet. On a network with no Internet access, start-up, first-run setup and a whole exam all work, and the browser makes no external request.
A rehearsed restore. A backup restored into an empty database; the restore backs up the current data first and is refused during an exam or for a dump from another schema version.
Automated tests. 180 backend integration tests on a real PostgreSQL, plus a suite that walks every page in a real browser as a teacher, a student and a candidate.
What is left can only be checked on site: the real host, the school's network and proxy, and how fast the school's database actually answers.
06What I learned
- Put each rule in one place and let tests guard it. Timing only on the backend, one permission guard, no answers in papers: these hold because they live in one place with tests, not because I remember them every time.
- Measure before adding anything. I expected the database connection pool to be the limit; tripling it left the processor just as full. The real problems were the proxy's connection handling and a piece of repeated parsing. Without measuring I would have spent the time in the wrong place.
- Removing a feature is feature work. That round of deletions took nothing away from anyone, and made the manual, the tests and the handover document shorter.
- Test everything development can test first, so the site trial is only about the site. Load, offline, restarts and restores were all checked beforehand.
07Screens


