One action. One consistent result.
- Validate the request
The server verifies the signed-in user and known lesson ID. The browser never chooses who earns a reward.
- Lock and record
A database transaction locks the learner row and records a unique lesson completion. Repeated requests count once.
- Derive and evaluate
The server calculates the completion total and passes absolute metrics to the engine using a repository bound to that same transaction.
- Commit, then display
Lesson completion and achievement state commit together. A failure rolls both back. The UI displays the committed snapshot.
Consistency comes from the database transaction. A retry may miss a celebration, but it cannot duplicate completed progress.
A playground with its own sandbox
The preview runs locally in memory. Safe configuration controls produce real definitions and complete code exports. Resetting the preview never touches saved learning progress.
Read the technical architecture