agenticSeek icon indicating copy to clipboard operation
agenticSeek copied to clipboard

feat: Make API base‑URL configurable for front‑end

Open strnadchristopher opened this issue 9 months ago • 1 comments

What problem does this solve?

Right now the React front‑end hard‑codes http://localhost:8000 when it calls the FastAPI back‑end.
If the app is hosted on another machine (e.g., http://raspberrypi.local:8000) the UI still points to localhost, so requests fail when opened from a different device on the same network.

Proposed solution

Allow the front‑end to read the base URL from configuration so users can:

  1. Deploy the back‑end on any LAN host / Docker container, and
  2. Access the UI from multiple devices without recompiling or editing source.

Implementation Plan

Approach Pros Cons
.env file inside /frontend/agentic-seek-front (e.g., VITE_API_BASE_URL=http://raspberrypi.local:8000) • Follows typical Vite/React pattern
• No code change on the back‑end
• Adds a second config surface separate from existing config.ini
// frontend/agentic-seek-front/src/App.js
const api = import.meta.env.VITE_API_BASE_URL || 'http://localhost:8000';

Acceptance criteria

  • [ ] Local dev (npm run dev) still defaults to http://localhost:8000 when no env var is set
  • [ ] Production build (npm run build) reads VITE_API_BASE_URL (or equivalent) and fetches from that host
  • [ ] README updated with a one‑liner on how to set the variable for remote deployments, perhaps with a .env.example like in the repo root

Next steps

If this direction looks good I’ll:

  1. open a branch feat/configurable-base-url-<issue#>
  2. update the front‑end config (+ docs)
  3. submit a PR referencing this issue (Closes #XYZ)

Let me know which config path you’d prefer, or if there’s an existing pattern I missed. Thanks!

strnadchristopher avatar May 29 '25 18:05 strnadchristopher

Thank you for the well structured issue! This is already done on the docker_deployement branch as it was a necessity. You can still submit a pull request tho, just have a look at the frontend on the docker_deployement branch first

Fosowl avatar May 29 '25 20:05 Fosowl

done in #298

Fosowl avatar Jun 06 '25 16:06 Fosowl