Add BRouter proxy, rate limiting, and spec updates (tasks 5.1-5.2) (#11)

This commit is contained in:
Ullrich Schäfer 2026-03-22 23:43:47 +01:00 committed by GitHub
parent 9deda5f125
commit 2d02ae3f9e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 173 additions and 5 deletions

View file

@ -59,12 +59,20 @@ The session owner (initiator) SHALL be able to manually close a session.
- **THEN** all connected participants are notified, the session triggers auto-save if a callback exists, and the session becomes inaccessible
### Requirement: User presence
The Planner SHALL display presence indicators showing which users are currently connected to a session.
The Planner SHALL display presence indicators showing which users are currently connected to a session, including live cursors on the map.
#### Scenario: Show connected users
- **WHEN** multiple users are connected to a session
- **THEN** each user sees a list of other connected users with assigned colors
#### Scenario: Live map cursors
- **WHEN** a user moves their mouse over the map
- **THEN** other participants see a labeled cursor at that position on their map, colored to match the user's assigned color
#### Scenario: Cursor disappears on leave
- **WHEN** a user disconnects from the session
- **THEN** their cursor disappears from all other participants' maps within 5 seconds
### Requirement: No user data collection
The Planner SHALL NOT collect, store, or track any personal user data. Sessions are anonymous by default.

View file

@ -37,12 +37,11 @@
- [x] 4.5 Implement session join page (GET /session/:id → connect to Yjs document)
- [x] 4.6 Implement session expiry (garbage collection cron, configurable TTL)
- [x] 4.7 Implement manual session close (owner action, notify participants)
- [ ] 4.8 Implement user presence display (Yjs awareness, colors, names)
## 5. Planner — BRouter Integration
- [ ] 5.1 Implement BRouter HTTP proxy endpoint (POST /api/route → forward to BRouter)
- [ ] 5.2 Implement rate limiting middleware (60 requests/session/hour)
- [x] 5.1 Implement BRouter HTTP proxy endpoint (POST /api/route → forward to BRouter)
- [x] 5.2 Implement rate limiting middleware (60 requests/session/hour)
- [ ] 5.3 Implement routing host election via Yjs awareness (host/participant roles)
- [ ] 5.4 Implement routing host failover (detect disconnect, elect new host by join timestamp)
- [ ] 5.5 Implement route computation trigger (host watches waypoint changes, debounce 500ms, call BRouter)
@ -51,7 +50,8 @@
## 6. Planner — Map UI
- [ ] 6.1 Integrate MapView component in Planner with full-screen layout
- [ ] 6.1 Integrate MapView component in Planner with full-screen layout and client-side Yjs connection
- [ ] 6.1a Implement user presence display (Yjs awareness, colors, names, live map cursors)
- [ ] 6.2 Implement waypoint add (click map → add to Y.Array)
- [ ] 6.3 Implement waypoint drag (move marker → update Y.Array)
- [ ] 6.4 Implement waypoint delete (right-click → remove from Y.Array)