Skip to content

Let the frontend call the API #67

Open

Description

@selvarajuv

Problem

The frontend and backend run on different origins, and the backend sends no CORS headers, so the browser blocks every API call from the frontend. The frontend also has no setting for where the API lives.

Goal

The frontend can call the backend locally and once deployed, with the API address set per environment.

Scope

  • CORS middleware on the backend, with allowed origins read from a new setting (e.g. CORS_ORIGINS) in config.py and listed in .env.example.
  • The frontend reads the API base URL from a Vite env variable (e.g. VITE_API_URL), with a local default.
  • Optionally a Vite dev proxy for local development; pick one approach and note it in the README.
  • Not in scope: the frontend API client and pages (frontend issues).

Considerations

  • Allow only the listed origins; no * in production.
  • If logins use cookies, CORS must allow credentials, which also rules out *. Agree this with the auth work.

Acceptance criteria

  • From the frontend running locally, a call to GET /health succeeds against just dev.
  • A request from an origin that isn't listed is blocked.
  • The new settings are listed in .env.example.

Activity

  1. added
    featureIntroduces a new and complete feature
    plumbingPlumbing and integration: CORS, settings, deploy, scheduler, CI, tests, frontend-API wiring
    on Oct 21, 2026
  2. changed the title [-]Rates refresh by themselves and show when they were last updated[/-] [+]Let the frontend call the API[/+] on Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureIntroduces a new and complete featureplumbingPlumbing and integration: CORS, settings, deploy, scheduler, CI, tests, frontend-API wiring

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions