A follow-along course · 11 modules · 50 lessons · about 40 hours
Build a multi-tenant app from an empty folder, then give its authorization to Cedar.
You build Caretaker, a building-maintenance application, with Express, PostgreSQL and server-rendered pages. When the hand-written permission checks start to hurt, you replace them with Cedar policies, one route at a time, with the same tests passing. Nothing is a black box: you trace every request from the session cookie to the Cedar decision.
Every command, output and screenshot in the lessons comes from an automated replay that builds the application from an empty directory. How the course is verified.
What you will build




What you will understand
- How an HTTP request flows through Express middleware, a route, SQL and a template.
- How to design tables, constraints and migrations, and why every query is parameterized.
- How sessions, cookies, password hashing and CSRF protection fit together.
- Why hand-written role checks explode as buildings and roles grow.
- Exactly where Cedar's principal, action, resource, context and entity attributes come from.
- RBAC, ABAC, parent relationships, forbid rules and policy templates, on one scenario.
- How to filter lists without leaking data across tenants, and how to test it.
- Which data the server can trust, and what Cedar cannot protect you from.
Before you start
- You can read JavaScript and know what a function, an object and a
Promiseare. - You have used a terminal a little. Lesson 0.3 covers what we need.
- A Mac, Linux machine, or Windows with WSL 2. macOS is the main walkthrough.
- Node.js 22 or 24 LTS, Git, Docker Desktop and an editor. Lesson 0.2 installs and checks them.
- No cloud account, no paid service and no AWS credentials. Everything runs locally.
How a request becomes a Cedar decision
This animation replays a real request from the finished application: Alice opens issue 101. Step through it now, or come back after Module 6. The values are the actual values from the reference implementation.
The technology, and why
| Layer | Choice | Why |
|---|---|---|
| Runtime | Node.js 22/24 LTS, ES modules | Built-in test runner, --watch and --env-file mean fewer dependencies. |
| Web | Express 5 | Small and explicit. You can see every middleware. |
| Database | PostgreSQL 18 in Docker Compose | Real constraints and transactions, identical on every machine. |
| Data access | pg, parameterized SQL, no ORM | Authorization depends on exact queries. You should see them. |
| UI | EJS, HTML, CSS, a little JavaScript | Server-rendered pages keep the trust boundary visible. |
| Authentication | Sessions in PostgreSQL, argon2id, CSRF tokens | Standard, inspectable and easy to revoke. |
| Authorization | @cedar-policy/cedar-wasm 4.14.0 | The official open-source Cedar engine, in-process, no service to run. |
| Tests | node:test + Supertest + a test database | Real HTTP requests against the real app and real SQL. |
The journey
- 0Orientation and environment setupSee the finished application, meet the scenario, and prepare a working toolchain.
- 1Our first Express applicationHTTP, routing, middleware, errors, EJS views and the first tests, with data kept in memory.
- 2Persistence and the relational data modelPostgreSQL in Docker, tables and constraints, migrations, seed data, and an app that reads and writes with parameterized SQL.
- 3Build real CRUD featuresOrganisations, buildings, issues and inspections with forms, validation, safe deletes, paging, sorting, filters and transactions.
- 4Authentication and user managementUsers, argon2id password hashing, sessions in PostgreSQL, login and logout, session fixation, cookie settings, CSRF and login throttling.
- 5Authorization before CedarMemberships and building roles, permission checks in plain JavaScript, tenant isolation for every list, and the point where hand-written rules stop scaling.
- 6Introduce CedarInstall the real Cedar engine, make the smallest real decision, add a schema, map database rows to entities, and move every route behind Cedar without changing behaviour.
- 7RBAC, ABAC, scoped roles and policy managementRoles as facts, parents and action groups, templates as a comparison, controlled onboarding, and grant/revoke that is itself authorized.
- 8Lists, writes and multi-tenant isolationKeep SQL list filters and Cedar policies aligned and prove it, make per-item checks fast, authorize creates and moves against the right parents, and test isolation everywhere.
- 9Trust boundaries and architectureForged input, what Cedar cannot detect, PDP/PIP/PEP/PAP, an optional authorization service, and defence in depth in the database.
- 10Complete, test and operate the applicationHardening and safe logging, the whole application as six users, a run from a clean checkout, production considerations, and a capstone feature.