mirror of
https://github.com/Dvorinka/MyClubServer.git
synced 2026-06-05 03:02:56 +00:00
dev day #92
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
%%{init: {'theme': 'neutral'}}%%
|
||||
sequenceDiagram
|
||||
autonumber
|
||||
participant Visitor as Visitor
|
||||
participant Editor as Editor/Admin
|
||||
participant FE as Frontend
|
||||
participant BE as Backend API
|
||||
participant DB as Postgres
|
||||
|
||||
Note over Visitor,BE: Public create (same-site only)
|
||||
FE->>BE: POST /api/v1/shortlinks/public {url, note}
|
||||
BE->>BE: RateLimit(30/min) + origin checks
|
||||
BE->>DB: Insert ShortLink
|
||||
DB-->>BE: id, code
|
||||
BE-->>FE: 201 Created {code, short_url}
|
||||
|
||||
rect rgba(220,255,220,0.2)
|
||||
Note over Editor,BE: Editor/Admin management
|
||||
FE->>BE: POST /api/v1/shortlinks (editor)
|
||||
BE->>DB: Insert ShortLink
|
||||
BE-->>FE: 201 Created
|
||||
|
||||
FE->>BE: GET /api/v1/shortlinks (editor)
|
||||
BE->>DB: List
|
||||
BE-->>FE: 200 OK [shortlinks]
|
||||
|
||||
FE->>BE: GET /api/v1/admin/shortlinks/:id/stats (admin)
|
||||
BE->>DB: Aggregate LinkClick
|
||||
BE-->>FE: 200 OK {stats}
|
||||
end
|
||||
|
||||
rect rgba(230,230,255,0.2)
|
||||
Note over FE,BE: Public redirect
|
||||
FE->>BE: GET /s/:code (root)
|
||||
BE->>DB: Lookup ShortLink by code
|
||||
BE->>DB: Insert LinkClick
|
||||
BE-->>FE: 302 Redirect to target
|
||||
end
|
||||
Reference in New Issue
Block a user