Tables now fit on phone screens (the Delete button was clipped)
README screenshots retaken
3. Tests + CI
Backend: 42 xUnit integration tests (packages/backend.Tests) using WebApplicationFactory with a fake lock
Frontend: 37 Vitest tests for useApi, the auth middleware, LoginForm, UserCodeList, PeopleList
CI runs both suites before building
Notes for review
Behaviour changes: phone numbers must now be international format (+61400000000); the auth cookie is SameSite=Strict (assumes the frontend and API share a site, which was already needed for the previous default Lax cookie); failed lock writes return 502 and unexpected errors 500 rather than 400.
Not exercised: a real Z-Wave lock, real Twilio SMS, the Docker builds, and the updated CI workflow (only the equivalent commands were run locally).
Out of scope:dotnet build reports known advisories on OpenTelemetry 1.15.0, SQLitePCLRaw.lib.e_sqlite3 2.1.11 and Microsoft.OpenApi 2.4.1; worth a separate dependency update.
backend.Tests isn't added to YaleAccess.sln (CI/dotnet test don't need it).
Test plan
dotnet test packages/backend.Tests (42 passing)
pnpm test and pnpm typecheck in packages/frontend (37 passing, clean)
pnpm build in packages/frontend
Manual run in mock mode (login, wrong password, code list, edit validation, People page, mobile layout)
CI green on this branch
Docker images build
## Summary
Three commits, one per area:
### 1. Backend hardening
- Rate limit login (5 attempts/min per IP) with a JSON 429 response
- Constant-time password comparison; login refused if no password is configured
- Explicit `SameSite=Strict` auth cookie; failed logins logged with client IP
- Stop logging door codes (update log lines and the SMS body)
- Global exception handler (JSON 500) instead of per-action `try/catch -> 400`; 404 for a missing person, 502 for failed lock writes
- Codes must be ASCII digits only (`int.TryParse` accepted `+123`, `-123`, whitespace)
- Person name and E.164 phone number validation; sending an unset code is rejected
- `TwiloOptions` -> `TwilioOptions`, typo fixes
### 2. Frontend: Nuxt 4 + Nuxt UI
- Upgrade to Nuxt 4 (sources under `app/`), add `@nuxt/ui`, Tailwind v4 and Lucide icons; drop `@nuxtjs/tailwindcss`
- Replace the custom `Yale*` components, `Modal`, `Navbar` and icon components with Nuxt UI equivalents (`UTable`, `UModal`, `UCard`, `UHeader`, `UBadge`, toasts, ...)
- Dark/light toggle and a logout button
- New `useApi` composable: central base URL/credentials, JSON-encoded bodies, error handling, redirect to login when the session expires
- Fixes: modal listener leak, missing People heading, unhandled fetch errors, hand-built JSON bodies (passwords with `"` broke login), logged-in users hitting `/login`
- Tables now fit on phone screens (the Delete button was clipped)
- README screenshots retaken
### 3. Tests + CI
- Backend: 42 xUnit integration tests (`packages/backend.Tests`) using `WebApplicationFactory` with a fake lock
- Frontend: 37 Vitest tests for `useApi`, the auth middleware, `LoginForm`, `UserCodeList`, `PeopleList`
- CI runs both suites before building
## Notes for review
- **Behaviour changes:** phone numbers must now be international format (`+61400000000`); the auth cookie is `SameSite=Strict` (assumes the frontend and API share a site, which was already needed for the previous default `Lax` cookie); failed lock writes return 502 and unexpected errors 500 rather than 400.
- **Not exercised:** a real Z-Wave lock, real Twilio SMS, the Docker builds, and the updated CI workflow (only the equivalent commands were run locally).
- **Out of scope:** `dotnet build` reports known advisories on `OpenTelemetry` 1.15.0, `SQLitePCLRaw.lib.e_sqlite3` 2.1.11 and `Microsoft.OpenApi` 2.4.1; worth a separate dependency update.
- `backend.Tests` isn't added to `YaleAccess.sln` (CI/`dotnet test` don't need it).
## Test plan
- [x] `dotnet test packages/backend.Tests` (42 passing)
- [x] `pnpm test` and `pnpm typecheck` in `packages/frontend` (37 passing, clean)
- [x] `pnpm build` in `packages/frontend`
- [x] Manual run in mock mode (login, wrong password, code list, edit validation, People page, mobile layout)
- [ ] CI green on this branch
- [ ] Docker images build
- Rate limit login (5 attempts/min per IP) with a JSON 429 response
- Constant-time password comparison; refuse login if no password is configured
- Explicit SameSite=Strict auth cookie; log failed logins with client IP
- Stop logging door codes (update log lines and the SMS body)
- Replace per-action try/catch -> 400 with a global exception handler (JSON 500)
- Return proper statuses: 404 for missing person, 502 for failed lock writes
- Validate codes as ASCII digits only (int.TryParse accepted +/-/whitespace)
- Validate person name and E.164 phone number; reject sending an unset code
- Rename TwiloOptions -> TwilioOptions and fix message typos
- Expose Program for integration tests
- Upgrade to Nuxt 4 (sources under app/), add @nuxt/ui, Tailwind v4 and
Lucide icons; drop @nuxtjs/tailwindcss
- Replace the custom Yale* components, Modal, Navbar and icon components with
UButton/UInput/UModal/UTable/UCard/UHeader/UBadge/UAlert and toasts
- Add dark/light mode toggle and a logout button
- Add a useApi composable: central base URL/credentials, JSON-encoded bodies,
error handling, and redirect to login when the session expires
- Fix modal listener leak, missing People heading, unhandled fetch errors and
login redirect for already-authenticated users
- Make the code and people tables fit on phone screens
- Retake README screenshots
- Backend: xUnit integration tests (auth, rate limiting, people, lock codes,
validation, error handling) using WebApplicationFactory with a fake lock
- Frontend: Vitest + Nuxt test utils for useApi, the auth middleware,
LoginForm, UserCodeList and PeopleList
- Run both suites in CI before building
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
Three commits, one per area:
1. Backend hardening
SameSite=Strictauth cookie; failed logins logged with client IPtry/catch -> 400; 404 for a missing person, 502 for failed lock writesint.TryParseaccepted+123,-123, whitespace)TwiloOptions->TwilioOptions, typo fixes2. Frontend: Nuxt 4 + Nuxt UI
app/), add@nuxt/ui, Tailwind v4 and Lucide icons; drop@nuxtjs/tailwindcssYale*components,Modal,Navbarand icon components with Nuxt UI equivalents (UTable,UModal,UCard,UHeader,UBadge, toasts, ...)useApicomposable: central base URL/credentials, JSON-encoded bodies, error handling, redirect to login when the session expires"broke login), logged-in users hitting/login3. Tests + CI
packages/backend.Tests) usingWebApplicationFactorywith a fake lockuseApi, the auth middleware,LoginForm,UserCodeList,PeopleListNotes for review
+61400000000); the auth cookie isSameSite=Strict(assumes the frontend and API share a site, which was already needed for the previous defaultLaxcookie); failed lock writes return 502 and unexpected errors 500 rather than 400.dotnet buildreports known advisories onOpenTelemetry1.15.0,SQLitePCLRaw.lib.e_sqlite32.1.11 andMicrosoft.OpenApi2.4.1; worth a separate dependency update.backend.Testsisn't added toYaleAccess.sln(CI/dotnet testdon't need it).Test plan
dotnet test packages/backend.Tests(42 passing)pnpm testandpnpm typecheckinpackages/frontend(37 passing, clean)pnpm buildinpackages/frontend