BioQuery is a biomedical literature research workspace built with React, TypeScript, Vite, and Supabase. It helps researchers discover PubMed papers, inspect paper details, generate AI-assisted paper analyses, and turn research directions into structured research plans.
- Frontend: React + TypeScript + Vite, deployed on Vercel.
- Authentication and data: Supabase Auth and Supabase database.
- Backend API: Python + FastAPI, deployed on Render.
- Literature source: NCBI PubMed E-utilities.
- AI: Google Gemini API, with a configurable fallback model.
The frontend communicates with the API through VITE_API_URL. The API keeps the existing /api/* routes and response shapes used by the frontend.
From the repository root:
npm install
npm run devCreate a root .env.local file with the frontend configuration:
VITE_SUPABASE_URL=your_supabase_project_url
VITE_SUPABASE_PUBLISHABLE_KEY=your_supabase_publishable_key
VITE_API_URL=http://localhost:5000Use the Supabase project URL and publishable/anon key from your Supabase project settings. Never put a service-role key or database password in frontend variables.
See backend/README.md for virtual environment setup, dependencies, environment variables, and the Render deployment configuration.
- Frontend: Vercel project connected to this repository.
- Backend: Render Web Service
bioquery-api-python, withbackendas its root directory. - Production API URL:
https://bioquery-api-python.onrender.com
Set VITE_API_URL in the Vercel project to the production API URL, then redeploy the frontend. Vite environment variables are compiled into the frontend at build time.
| Method | Route | Purpose |
|---|---|---|
| GET | /api/health |
API health check |
| GET | /api/pubmed/search?q=... |
Search PubMed |
| GET | /api/intelligence/trends?q=... |
Annual PubMed publication counts and exploratory trend forecast |
| GET | /api/pubmed/paper/{pmid} |
Retrieve a PubMed metadata and abstract record |
| POST | /api/ai/analyze-paper |
Generate a structured paper analysis |
| POST | /api/ai/research-plan |
Generate a structured research plan |
Interactive API documentation is available at /docs on the running FastAPI service.\n\n## Research trend analysis
GET /api/intelligence/trends?q=...&start_year=2015&end_year=2025&forecast_years=3retrieves annual PubMed counts for a query and returns growth indicators plus a simple linear forecast.- The endpoint queries completed publication years only, accepts up to 30 years of history, and caches results for one hour.
- Forecasts describe publication volume, not scientific breakthroughs. Residual-based ranges are exploratory indicators rather than calibrated confidence intervals.
Paper source ingestion\n\n- PMC full text is available only when PubMed links the PMID to a PMC article with extractable body text. BioQuery does not bypass publisher access controls.\n- PDF uploads accept text-based PDFs up to 15 MB and 100 pages. Scanned/image-only PDFs are rejected with an explicit OCR-required message.\n- Ingested source passages include stable passage IDs and section or page locators. This is the source layer for later evidence-grounded analysis; it does not itself mean AI claims are already citation-verified.\n- PDF text is processed in memory and is not persisted by this endpoint. The caller receives extracted text and is responsible for any later save action.
BioQuery uses Supabase Auth. The browser Supabase client uses the SDK's session persistence and token-refresh behavior. Users can explicitly sign out from the workspace.
- Keep
GEMINI_API_KEY, Supabase service-role keys, database credentials, and other secrets on the server only. - Do not commit
.env,.env.local, or production secrets. - The frontend should use only the Supabase publishable/anon key.
- Configure production environment variables in Vercel and Render dashboards.