sugar-cat7 / vspo-portal

WIP γ™γ½γ˜γ‚…γƒΌγ‚‹
https://vspo-schedule-sugar-cat7-s-team.vercel.app
MIT License
12 stars 4 forks source link

πŸ“Ž Temporary Multilingual Support with Proxy Implementation #406

Open sugar-cat7 opened 3 months ago

sugar-cat7 commented 3 months ago

Description

To facilitate temporary multilingual support in our current architecture, we need to implement a Proxy(BFF) layer. This BFF will act as an intermediary between the Frontend and the original Backend, ensuring translations are applied and responses are cached effectively. The goal is to minimize costs and create a disposable solution that can be easily decommissioned post-migration.

Objectives

  1. Implement a BFF layer using Cloudflare Workers.
  2. Cache translated responses using Cloudflare KV.
  3. Ensure the BFF forwards requests and responses between Frontend and Backend without altering the response structure.
  4. Apply the Cloud Transition API to Backend responses for translation purposes.
  5. Support multilingual frontends by detecting language preferences from request headers and user selections.
  6. Store user language preferences in local storage, with future considerations for persistence.

Sequence Diagram

Overview

sequenceDiagram
    participant Frontend
    participant BFF
    participant Backend
    participant CTA
    participant KVC

    Frontend->>BFF: Request
    BFF->>Backend: Request
    Backend->>BFF: Response
    BFF->>CTA: Translate
    CTA->>BFF: Translated Response
    BFF->>KVC: Cache Response
    BFF->>Frontend: Response

Additional Notes

TODO

sugar-cat7 commented 3 months ago

YouTube API Quota Application Done

sugar-cat7 commented 3 months ago

The ISO-639 codes https://cloud.google.com/translate/docs/languages

sugar-cat7 commented 3 months ago

TODO

----- Notify (X/Reddit) at this point -----