Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Local development frontend API calls failing

Open
#446 0 comments 0 reactions 1 assignee View on GitHub

@sahilds1 is already working on this.

Since Jan 20, 2026.

  • #447 by @sahilds1 — merged

Assessment

This issue has not been assessed yet.

Description

Bug

Steps to Reproduce

  1. Start local Docker environment: docker compose up
  2. Navigate to frontend at http://localhost:3000
  3. Trigger any API call (e.g., fetch medication list)
  4. Observe error in browser console and Vite terminal

Possible Fix: Vite proxy

Background

The API client uses relative URLs (/api/...), so requests go to the frontend's origin unless a proxy forwards them to the backend. In development, Vite runs a Node.js server that serves the React app and can proxy requests. In production, Vite compiles React into static files served by nginx or a CDN — the infrastructure handles API routing instead.

Fix

Add a proxy to frontend/vite.config.ts:

  server: {
    proxy: {
      '/api': {
        target: 'http://backend:8000',
        changeOrigin: true,
      },
    },
  },

Rebuild with docker compose down && docker compose up --build.

Dominant language
TypeScript
Stars
21
Forks
19
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from CodeForPhilly/balancer-main

All issues in CodeForPhilly/balancer-main

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.