Spaces:
Sleeping
Sleeping
Frontend Fallback Behavior (Phase 5)
Overview
The UI uses Next.js /api/* route handlers as a proxy layer to the FastAPI backend.
If the backend is unavailable, these routes return safe defaults so the UI remains usable.
Proxy Routes (Next.js)
All routes forward to API_CONFIG.baseUrl (NEXT_PUBLIC_API_URL, default http://localhost:8000).
Search
POST /api/searchPOST /api/search/hybrid- Fallback: empty results with metadata stubs
Agents
POST /api/agents/generatePOST /api/agents/validatePOST /api/agents/rankPOST /api/agents/workflow- Fallback: empty payloads with
mock: trueflags (where applicable)
Explorer
GET /api/explorer/embeddings- Fallback:
503+ empty points
Ingestion
POST /api/ingest/pubmedPOST /api/ingest/uniprotPOST /api/ingest/chemblPOST /api/ingest/allGET /api/ingest/jobs/{job_id}- Fallback:
503+ error message
UI Empty‑State Handling
- Visualization page shows a “No points to display” message until a search runs.
- Workflow page shows “Run workflow to see results” until execution completes.
Recommendation
For demos, keep the FastAPI backend running to ensure real data/embeddings are shown.