Skip to content

Backend

Nekeo edited this page Nov 25, 2025 · 3 revisions

Diagrams

Slots

V1

Enregistrement en base de donnée, puis envoie d'évènement (mise à jour de slots) via https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events

V2

sequenceDiagram
    actor user as User
    participant back as Back
    participant cache as Cache
    participant db as DB
    participant cron as Cron

    %% =======================
    %%      SLOTS CREATION
    %% =======================
    rect rgb(30,00,30)
    Note over user,db: Slots creation
    user->>back: Request for availability creation
    back->>db: Insert availability
    back-->>user: Availability response (async slot process)

    back->>back: Compute slots for the entire event
    back->>cache: Update slots in cache
    back->>user: Send updated slots event
    end

    %% =======================
    %%      SLOTS RECOVER
    %% =======================
    rect rgb(00,30,30)
    Note over user,db: Slots retrieval
    user->>back: GET /slots
    back->>cache: Read slots
    alt Slots found in cache
        cache-->>back: Cached slots
    else Slots not found
        back->>db: Read from database
        db-->>back: DB slots
    end
    back-->>user: Slots response
    end

    %% =======================
    %%      CACHE SYNCING
    %% =======================
    rect rgb(30,30,00)
    Note over back,cron: Cache syncing (hourly)
    cron->>back: Hourly sync
    back->>cache: Read all cached slot data
    cache-->>back: Cached slots
    back->>db: Persist slots to DB
    db-->>back: OK
    back->>cache: Delete persisted cached data
    end
Loading

Clone this wiki locally