Hands-on Labs
Five self-contained exercises that build on each other. Each lab has a goal, steps, and an expected outcome you can verify by running the tests.
| Lab | Title | Concepts | Time |
|---|---|---|---|
| Lab 01 | Extend the Domain Model | Entities, types, associations | ~20 min |
| Lab 02 | Create a Service Projection | Service definitions, projections, @readonly | ~20 min |
| Lab 03 | Add Handler Logic | before/on/after hooks, validation | ~30 min |
| Lab 04 | Role-Based Authorization | @requires, @restrict, roles | ~20 min |
| Lab 05 | Test by Layer | Model tests, handler tests, assertions | ~30 min |
Prerequisites
- Node.js >= 20 installed
npm installcompleted incap/- Basic familiarity with JavaScript and JSON
How to use these labs
- Read the lab README in full before starting.
- Make changes to the files listed in the lab.
- Run
npm run testor the specific command given in the lab to verify. - If stuck, check the Hints section at the bottom of each lab.
Starting fresh
Each lab builds on the existing codebase. If you want to experiment safely:
bash
git stash # save your changes
# ... work on the lab ...
git stash pop # restore when done