Skip to content

Refactor: Decouple Frontend for Static Hosting #165

@bigtcze

Description

@bigtcze

Summary

To support Scale-to-Zero architecture, the Frontend must be decoupled from the Backend. The Frontend must be served as a static SPA (Single Page Application) from a central point (CDN/Nginx), while the Backend runs in private containers.

Requirements

  1. Build Process: Update Vite config to generate a completely independent build (assets with absolute paths or relative to root).
  2. API URL: Frontend must allow dynamic API Endpoint configuration (not hardcoded localhost:3000) to query the backend on the same domain via /api proxy.
  3. CORS: Enable CORS on Backend for the frontend domain (if not on the same origin).
  4. Standalone: Frontend must not rely on being served by the Backend Express server.

Complexity

5/10 (Requires changes to build, deploy pipeline, and Axios config)

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureLet's update application to work even better

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions