orchestrated-discussions/diagrams/notification-system-brainst...

40 lines
816 B
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@startuml
title MVP Notification System (Polling)
left to right direction
actor User
rectangle "Backend (Python)" {
component "App Logic" as App
database "notifications table" as DB
component "GET /api/notifications/unread" as API
}
rectangle "Frontend (React)" {
component "Poller (30s)" as Poller
component "Browser Notification API" as BrowserAPI
}
App -> DB: INSERT notification
Poller -> API: Poll every 30s
API -> DB: SELECT WHERE user_id AND read=false
API --> Poller: JSON array
Poller -> BrowserAPI: Show popup
BrowserAPI -> User: Desktop notification
note right of DB
Simple schema:
- id
- user_id
- event_type
- message
- created_at
- read (boolean)
end note
note bottom of Poller
No WebSockets needed
1000 users × 2 req/min
= ~33 req/s (trivial load)
end note
@enduml