Repository navigation
Architecture
amalps565 edited this page Sep 30, 2026
·
2 revisions
Built as designed: Spring Boot 4.1 backend, React + Vite frontend, PostgreSQL 17.
flowchart LR
subgraph Browser
UI[React app<br/>floor grid]
Store[(Desk store<br/>by desk ID)]
UI <--> Store
end
subgraph Server[Spring Boot]
API[REST controllers]
Svc[Booking service<br/>locked check-and-save]
Pub[After-commit<br/>publisher]
WS[STOMP broker]
API --> Svc
Svc -- DeskStatusChanged --> Pub
Pub --> WS
end
DB[(PostgreSQL)]
UI -- "REST + JWT" --> API
Svc -- JPA --> DB
WS -- "per-desk updates" --> Store
- The browser loads a floor snapshot over REST, then subscribes to the floor's WebSocket topic.
- A booking is a REST call. The booking service locks, checks, and saves it in one transaction.
- Only after the transaction commits does the publisher send a small per-desk update to every open map.
Smart-Workspace-Seating-Chart/
├── CLAUDE.md shared rules and the API/WebSocket contract
├── .claude/ Claude Code skills, agents, and shared settings
├── backend/ Spring Boot app (Maven wrapper)
│ ├── CLAUDE.md backend commands and conventions
│ └── CHANGELOG.md
├── frontend/ React + TypeScript app (Vite)
│ ├── CLAUDE.md frontend commands and conventions
│ └── CHANGELOG.md
├── e2e/ Playwright end-to-end tests
└── docker-compose.yml PostgreSQL 17 for local development
-
Layers: REST controllers → services → Spring Data JPA repositories.
- Controllers use DTOs (records) and never expose entities.
- Services own transactions and all booking rules.
-
Neighbour policy: one component computes a desk's neighbours from the floor's
neighbour_mode. Nothing else implements neighbour logic. - Booking service: performs the locked check-and-save described in Booking Concurrency.
-
Error handling: one
@RestControllerAdvicemaps domain errors and constraint violations to a{code, message}body with 400, 403, 404, or 409. -
Publishing: a
@TransactionalEventListener(phase = AFTER_COMMIT)sends updates to/topic/floors/{floorId}/{date}. - Security: Spring Security validates the JWT on REST calls and on the STOMP connection.
-
Schema: Flyway migrations only, including seed data. Never
ddl-auto.
- Pages: login, and a floor page with a date picker and the grid.
- Store: desks normalized by desk ID, loaded from the snapshot and patched by socket updates.
-
Grid: memoized
DeskCellcomponents. Each cell reads only its own desk. - See Frontend Design for details.
Repository · The CLAUDE.md files in the repo are the source of truth for rules and the API contract. If this wiki disagrees with them, the repo wins.