feat: Make API base‑URL configurable for front‑end
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:
- Deploy the back‑end on any LAN host / Docker container, and
- 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 tohttp://localhost:8000when no env var is set - [ ] Production build (
npm run build) readsVITE_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:
- open a branch
feat/configurable-base-url-<issue#> - update the front‑end config (+ docs)
- 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!
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
done in #298