API_FLOW_DIAGRAMS.md 786 B

API Flow Diagrams (Maker–Checker Removed)

1. Mgnt Update Flow (Immediate Publish)

sequenceDiagram
  participant M as Mgnt User
  participant MgntAPI
  participant DB as MySQL/Mongo
  participant Redis

  M->>MgntAPI: Update content (ads/videos/channels)
  MgntAPI->>DB: Save changes with audit trails
  MgntAPI->>Redis: Update relevant keys
  MgntAPI-->>M: Success, published immediately

2. Ad Placement Flow

sequenceDiagram
  participant U as User
  participant App as App API
  participant Redis
  participant Mongo

  U->>App: GET /ads/placement
  App->>Redis: GET cached ad pool
  alt hit
    Redis-->>App: pool
    App-->>U: Ad response
  else miss
    App->>Mongo: Query ads
    App->>Redis: Rebuild ad pool
    App-->>U: Response
  end