TREE is an AI-backed decision-support dashboard for pharmaceutical development. It helps discovery, clinical, and operations teams explore literature, clinical trials, pipeline data, regulatory alerts, and document analysis through a single interface—with live external APIs and optional LLM summarization.
- Statistics — Search and explore clinical-trial and literature data with filters and visualisations.
- Insights (Decision Support Hub) — Pipeline monitoring (ClinicalTrials.gov–style), clinical document upload and AI summarisation (DeepSeek), side-by-side comparison of PDFs, and regulatory alerts / compliance-style reports.
- Trends — Predictions and trend views over merged medical/legal data.
- Research AI — Natural-language chat over TREE (query, role-aware summaries, citations). Optional streaming; chat history persisted per session.
External data is live API–only (no bulk download or storage of PubMed/ClinicalTrials.gov etc.); optional persistence is minimal (e.g. chat history, merged DB for analytics). See docs/DATA-HANDLING.md and docs/TREE-ARCHITECTURE.md for constraints and design.
- User — Logs in, picks a section (Statistics, Insights, Trends, Research AI) from the nav.
- Frontend — Next.js app (React). All API calls go to
/api/*, which Next rewrites to the backend. - Proxy — Next.js rewrites
/api/:path*→http://127.0.0.1:8000/api/:path*(long requests use an increased proxy timeout). - Backend — FastAPI on port 8000: auth/CORS, routing, validation. Uses adapters for PubMed, ClinicalTrials.gov, merged DB, regulatory sources; DeepSeek for document summarisation, comparison, chat, and compliance summaries.
- Data — Live API calls per request; optional SQLite DBs under
data/(e.g. merged medical data, legal/regulatory) for analytics and insights. No storage of full external API payloads. - Response — JSON (or stream) back to the frontend; UI renders tables, charts, markdown, and chat.
DIC03-TriPhar/
├── app/ # Next.js app router
│ └── page.tsx # Root: nav state, login, and view switcher (home, statistics, insights, trends, research-ai)
├── components/
│ ├── global-navigation.tsx
│ └── views/ # Main screens
│ ├── login-view.tsx
│ ├── brand-gateway.tsx # Home / landing
│ ├── statistics-view.tsx
│ ├── insights-view.tsx # Pipeline, PDF analyse/compare, regulatory
│ ├── trends-view.tsx
│ └── research-ai.tsx # Chat UI
├── backend/ # FastAPI application
│ ├── app/
│ │ ├── main.py # App entry, CORS, exception handler, router includes
│ │ └── config.py # Settings (env, API keys, paths)
│ ├── api/
│ │ ├── routes/ # tree, insights, analytics, trends_ai, chat
│ │ └── schemas/ # Pydantic request/response models
│ ├── adapters/ # External data & LLM
│ │ ├── pubmed.py, clinical_trials_gov.py
│ │ ├── merged_db.py, regulatory_alerts*.py
│ │ ├── document_compare_llm.py, pdf_utils.py
│ │ └── chat_history.py
│ ├── agents/ # Literature, clinical, signals
│ ├── orchestrator/
│ └── models/
├── data/ # Optional SQLite DBs (merged medical, legal); not committed
├── docs/ # Architecture, data-handling, status
├── next.config.mjs # Rewrites to backend; proxyTimeout for long /api calls
├── package.json # Next.js, React, UI deps
└── README.md # This file
-
Backend (from repo root):
cd backend python -m venv .venv .venv\Scripts\activate # Windows pip install -r requirements.txt cd .. uvicorn backend.app.main:app --reload --host 0.0.0.0 --port 8000
- API: http://localhost:8000
- Docs: http://localhost:8000/docs
-
Frontend:
npm install npm run dev
- App: http://localhost:3000 (or the port Next prints).
- Set
DEEPSEEK_API_KEYinbackend/.envfor PDF summarisation, chat, and compliance LLM features.
-
Optional — Ensure
data/merged_medical_data.db(and any other DBs your flows need) exist if you use pipeline/trends features that depend on them.
For more detail (endpoints, env, data rules), see backend/README.md and git**docs/**.