Patient Website
The PatientWebsite is the only service with a frontend. It runs on http://localhost:8080.
It is a server-rendered Razor Pages application that allows patients to:
- Register — create their account (BSN + first name + last name)
- Sign in — authenticate and receive a session cookie
- Manage consent — approve or decline access for each healthcare company that has a dossier for them
Patient registration
Navigate to http://localhost:8080/Register. Enter your BSN and name. On submission the website:
- Creates a
BsnPseudoniemrecord (BSN → GUID mapping) - Creates a
Patientrecord (first name, last name, pseudoniem)
Both records are written directly to the shared database. The raw BSN is stored only in the BsnPseudoniem table.
Test BSN you can use: 123456780 (this is the default value in the Bruno environment).
Never use a real BSN — all BSNs in this workshop are fictional.
Sign in
Navigate to http://localhost:8080/SignIn. Enter the BSN and last name. The website calls POST /auth/login on IdentityApi and receives a JWT. That JWT is converted into a cookie-based session so the patient stays logged in across page loads without the browser ever handling the raw token.
Consent dashboard
After signing in, the home page (/) shows:
- The patient’s name
- A list of all healthcare companies that have created a dossier for this patient
- Approve / Decline buttons for each company
Clicking Approve sets Patient.GavePermission = true in the database. The next time DossierApi calls GET /dossier/{bsn}/permission for that company, it will return gavePermission: true.
Try the full flow
- Register a patient at
http://localhost:8080/Register - In Bruno, run
Dossier/RegisterCompanythenIdentity/GetTokenthenDossier/CreateDossier - Check
Dossier/CheckPatientPermission—gavePermissionshould be403 - Forbidden - Sign in to the patient website and click Approve
- Check
Dossier/CheckPatientPermissionagain —gavePermissionshould now be202 - OK
Now that you understand the full solution, let’s improve the local development experience by adding .NET Aspire.