# xeinashawkat/scientific-literature-review-assistant architecture

> Architecture diagram of the GitHub repository xeinashawkat/scientific-literature-review-assistant, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/xeinashawkat/scientific-literature-review-assistant
- Repository: https://github.com/xeinashawkat/scientific-literature-review-assistant

## Overview

AURORA turns a literature-review query into retrieved papers, a research brief, and a generated review, then exposes the run and its trace in a dashboard. The principal path is frontend → Express run API → FastAPI/LangGraph orchestrator → research and writer agents → persisted result and frontend views. The README documents RAG/MCP retrieval, metrics, logging, A2A, and MongoDB capabilities; unsampled implementations are represented at their existing directory paths. Edges are limited to README claims and shown or indexed references; the full data wiring for several dashboard and persistence features was not sampled.

Main entry points: [`apps/backend/src/server.js`](https://github.com/xeinashawkat/scientific-literature-review-assistant/blob/main/apps/backend/src/server.js) (Express API), [`apps/frontend/src/pages/Search.jsx`](https://github.com/xeinashawkat/scientific-literature-review-assistant/blob/main/apps/frontend/src/pages/Search.jsx) (Query and results), [`apps/AI/graph/orchestrator.py`](https://github.com/xeinashawkat/scientific-literature-review-assistant/blob/main/apps/AI/graph/orchestrator.py) (LangGraph controller), [`apps/AI/utils/logger_registry.py`](https://github.com/xeinashawkat/scientific-literature-review-assistant/blob/main/apps/AI/utils/logger_registry.py) (Logger registry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Dashboard"]
  node_frontend["React app<br/>[App.jsx]"]
  node_search["Query and results<br/>[Search.jsx]"]
  node_progress["Pipeline progress"]
  node_report["Review report<br/>[Report.jsx]"]
  node_analytics["Run analytics<br/>[AnalyticsPage.jsx]"]
  node_tracehook["Trace fetch<br/>[useTrace.js]"]
  node_authui["Auth state<br/>[AuthContext.jsx]"]
  node_authservice["Auth client<br/>[authService.js]"]
end

subgraph group_gateway["API and persistence"]
  node_backend["Express API<br/>[server.js]"]
  node_authroutes["Auth routes<br/>[authRoutes.js]"]
  node_authcontroller["Auth handlers<br/>[authController.js]"]
  node_database[("MongoDB<br/>[db.js]")]
  node_runrecords[("Run records")]
  node_paperresult[("Paper results<br/>[paper.js]")]
  node_outputresult[("Review outputs<br/>[AIOutput.js]")]
  node_metricsresult[("Metrics records<br/>[metrics.js]")]
end

subgraph group_ai["AI workflow"]
  node_orchestrator["LangGraph controller<br/>[orchestrator.py]"]
  node_researchagent["Research agent<br/>[research_agent.py]"]
  node_writeragent["Writer agent<br/>[writer_agent.py]"]
  node_mcp["MCP retrieval tools<br/>[server.py]"]
  node_a2a["A2A message schema<br/>[schemas.py]"]
  node_registry["Agent registry<br/>[registry.py]"]
end

subgraph group_observability["Run trace"]
  node_logger["Run logging<br/>[logger.py]"]
  node_logregistry["Logger registry<br/>[logger_registry.py]"]
  node_tracker["API metrics tracker<br/>[api_tracker.py]"]
end

node_researcher(("Literature reviewer"))

node_researcher -->|"submits query"| node_frontend
node_frontend -->|"routes to"| node_search
node_search -->|"starts run"| node_backend
node_backend -->|"requests pipeline"| node_orchestrator
node_orchestrator -->|"requests research"| node_researchagent
node_orchestrator -->|"requests writing"| node_writeragent
node_researchagent -->|"calls tools"| node_mcp
node_researchagent -->|"creates message"| node_a2a
node_orchestrator -.->|"validates message"| node_a2a
node_writeragent -->|"consumes message"| node_a2a
node_orchestrator -->|"reads agent cards"| node_registry
node_orchestrator -->|"gets logger"| node_logregistry
node_researchagent -->|"gets logger"| node_logregistry
node_writeragent -->|"gets logger"| node_logregistry
node_logregistry -->|"creates logger"| node_logger
node_writeragent -->|"tracks API use"| node_tracker
node_tracker -->|"gets logger"| node_logregistry
node_backend -->|"writes run state"| node_runrecords
node_backend -->|"connects"| node_database
node_backend -.->|"returns run data"| node_search
node_search -->|"loads trace"| node_tracehook
node_search -->|"renders status"| node_progress
node_search -->|"renders report"| node_report
node_search -->|"renders analytics"| node_analytics
node_frontend -->|"offers auth pages"| node_authroutes
node_authroutes -->|"routes requests"| node_authcontroller
node_authservice -->|"posts credentials"| node_authroutes
node_authui -.->|"stores auth result"| node_authservice
node_backend -.->|"persists papers"| node_paperresult
node_backend -.->|"persists outputs"| node_outputresult
node_backend -.->|"persists metrics"| node_metricsresult
node_database -.->|"stores"| node_paperresult
node_database -.->|"stores"| node_outputresult
node_database -.->|"stores"| node_metricsresult

click node_frontend "https://github.com/xeinashawkat/scientific-literature-review-assistant/blob/main/apps/frontend/src/App.jsx"
click node_search "https://github.com/xeinashawkat/scientific-literature-review-assistant/blob/main/apps/frontend/src/pages/Search.jsx"
click node_progress "https://github.com/xeinashawkat/scientific-literature-review-assistant/blob/main/apps/frontend/src/components/PipelineProgress.jsx"
click node_report "https://github.com/xeinashawkat/scientific-literature-review-assistant/blob/main/apps/frontend/src/components/Report.jsx"
click node_analytics "https://github.com/xeinashawkat/scientific-literature-review-assistant/blob/main/apps/frontend/src/components/AnalyticsPage.jsx"
click node_tracehook "https://github.com/xeinashawkat/scientific-literature-review-assistant/blob/main/apps/frontend/src/hooks/useTrace.js"
click node_authui "https://github.com/xeinashawkat/scientific-literature-review-assistant/blob/main/apps/frontend/src/context/AuthContext.jsx"
click node_authservice "https://github.com/xeinashawkat/scientific-literature-review-assistant/blob/main/apps/frontend/src/services/authService.js"
click node_backend "https://github.com/xeinashawkat/scientific-literature-review-assistant/blob/main/apps/backend/src/server.js"
click node_authroutes "https://github.com/xeinashawkat/scientific-literature-review-assistant/blob/main/apps/backend/src/routes/authRoutes.js"
click node_authcontroller "https://github.com/xeinashawkat/scientific-literature-review-assistant/blob/main/apps/backend/src/controllers/authController.js"
click node_database "https://github.com/xeinashawkat/scientific-literature-review-assistant/blob/main/apps/backend/src/config/db.js"
click node_runrecords "https://github.com/xeinashawkat/scientific-literature-review-assistant/tree/main/apps/backend/src/models"
click node_orchestrator "https://github.com/xeinashawkat/scientific-literature-review-assistant/blob/main/apps/AI/graph/orchestrator.py"
click node_researchagent "https://github.com/xeinashawkat/scientific-literature-review-assistant/blob/main/apps/AI/agents/research_agent.py"
click node_writeragent "https://github.com/xeinashawkat/scientific-literature-review-assistant/blob/main/apps/AI/agents/writer_agent.py"
click node_mcp "https://github.com/xeinashawkat/scientific-literature-review-assistant/blob/main/apps/AI/mcp/server.py"
click node_a2a "https://github.com/xeinashawkat/scientific-literature-review-assistant/blob/main/apps/AI/a2a/schemas.py"
click node_registry "https://github.com/xeinashawkat/scientific-literature-review-assistant/blob/main/apps/AI/a2a/registry.py"
click node_logger "https://github.com/xeinashawkat/scientific-literature-review-assistant/blob/main/apps/AI/utils/logger.py"
click node_logregistry "https://github.com/xeinashawkat/scientific-literature-review-assistant/blob/main/apps/AI/utils/logger_registry.py"
click node_tracker "https://github.com/xeinashawkat/scientific-literature-review-assistant/blob/main/apps/AI/utils/api_tracker.py"
click node_paperresult "https://github.com/xeinashawkat/scientific-literature-review-assistant/blob/main/apps/backend/src/models/paper.js"
click node_outputresult "https://github.com/xeinashawkat/scientific-literature-review-assistant/blob/main/apps/backend/src/models/AIOutput.js"
click node_metricsresult "https://github.com/xeinashawkat/scientific-literature-review-assistant/blob/main/apps/backend/src/models/metrics.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_frontend,node_search,node_progress,node_report,node_analytics,node_tracehook,node_authui,node_authservice,node_researcher toneBlue
class node_backend,node_authroutes,node_authcontroller,node_database,node_runrecords,node_paperresult,node_outputresult,node_metricsresult toneAmber
class node_orchestrator,node_researchagent,node_writeragent,node_mcp,node_a2a,node_registry toneMint
class node_logger,node_logregistry,node_tracker toneRose
```

## Components

### Dashboard

- [React app](https://github.com/xeinashawkat/scientific-literature-review-assistant/blob/main/apps/frontend/src/App.jsx): `apps/frontend/src/App.jsx`
- [Query and results](https://github.com/xeinashawkat/scientific-literature-review-assistant/blob/main/apps/frontend/src/pages/Search.jsx): `apps/frontend/src/pages/Search.jsx`
- [Pipeline progress](https://github.com/xeinashawkat/scientific-literature-review-assistant/blob/main/apps/frontend/src/components/PipelineProgress.jsx): `apps/frontend/src/components/PipelineProgress.jsx`
- [Review report](https://github.com/xeinashawkat/scientific-literature-review-assistant/blob/main/apps/frontend/src/components/Report.jsx): `apps/frontend/src/components/Report.jsx`
- [Run analytics](https://github.com/xeinashawkat/scientific-literature-review-assistant/blob/main/apps/frontend/src/components/AnalyticsPage.jsx): `apps/frontend/src/components/AnalyticsPage.jsx`
- [Trace fetch](https://github.com/xeinashawkat/scientific-literature-review-assistant/blob/main/apps/frontend/src/hooks/useTrace.js): `apps/frontend/src/hooks/useTrace.js`
- [Auth state](https://github.com/xeinashawkat/scientific-literature-review-assistant/blob/main/apps/frontend/src/context/AuthContext.jsx): `apps/frontend/src/context/AuthContext.jsx`
- [Auth client](https://github.com/xeinashawkat/scientific-literature-review-assistant/blob/main/apps/frontend/src/services/authService.js): `apps/frontend/src/services/authService.js`

### API and persistence

- [Express API](https://github.com/xeinashawkat/scientific-literature-review-assistant/blob/main/apps/backend/src/server.js): `apps/backend/src/server.js`
- [Auth routes](https://github.com/xeinashawkat/scientific-literature-review-assistant/blob/main/apps/backend/src/routes/authRoutes.js): `apps/backend/src/routes/authRoutes.js`
- [Auth handlers](https://github.com/xeinashawkat/scientific-literature-review-assistant/blob/main/apps/backend/src/controllers/authController.js): `apps/backend/src/controllers/authController.js`
- [MongoDB](https://github.com/xeinashawkat/scientific-literature-review-assistant/blob/main/apps/backend/src/config/db.js): `apps/backend/src/config/db.js`
- [Run records](https://github.com/xeinashawkat/scientific-literature-review-assistant/tree/main/apps/backend/src/models): `apps/backend/src/models`
- [Paper results](https://github.com/xeinashawkat/scientific-literature-review-assistant/blob/main/apps/backend/src/models/paper.js): `apps/backend/src/models/paper.js`
- [Review outputs](https://github.com/xeinashawkat/scientific-literature-review-assistant/blob/main/apps/backend/src/models/AIOutput.js): `apps/backend/src/models/AIOutput.js`
- [Metrics records](https://github.com/xeinashawkat/scientific-literature-review-assistant/blob/main/apps/backend/src/models/metrics.js): `apps/backend/src/models/metrics.js`

### AI workflow

- [LangGraph controller](https://github.com/xeinashawkat/scientific-literature-review-assistant/blob/main/apps/AI/graph/orchestrator.py): `apps/AI/graph/orchestrator.py`
- [Research agent](https://github.com/xeinashawkat/scientific-literature-review-assistant/blob/main/apps/AI/agents/research_agent.py): `apps/AI/agents/research_agent.py`
- [Writer agent](https://github.com/xeinashawkat/scientific-literature-review-assistant/blob/main/apps/AI/agents/writer_agent.py): `apps/AI/agents/writer_agent.py`
- [MCP retrieval tools](https://github.com/xeinashawkat/scientific-literature-review-assistant/blob/main/apps/AI/mcp/server.py): `apps/AI/mcp/server.py`
- [A2A message schema](https://github.com/xeinashawkat/scientific-literature-review-assistant/blob/main/apps/AI/a2a/schemas.py): `apps/AI/a2a/schemas.py`
- [Agent registry](https://github.com/xeinashawkat/scientific-literature-review-assistant/blob/main/apps/AI/a2a/registry.py): `apps/AI/a2a/registry.py`

### Run trace

- [Run logging](https://github.com/xeinashawkat/scientific-literature-review-assistant/blob/main/apps/AI/utils/logger.py): `apps/AI/utils/logger.py`
- [Logger registry](https://github.com/xeinashawkat/scientific-literature-review-assistant/blob/main/apps/AI/utils/logger_registry.py): `apps/AI/utils/logger_registry.py`
- [API metrics tracker](https://github.com/xeinashawkat/scientific-literature-review-assistant/blob/main/apps/AI/utils/api_tracker.py): `apps/AI/utils/api_tracker.py`

### Other components

- **Literature reviewer**

## Connections

- Literature reviewer → React app: submits query (evidence: `README.md`)
- React app → Query and results: routes to (evidence: `apps/frontend/src/App.jsx`)
- Query and results → Express API: starts run (evidence: `apps/frontend/src/pages/Search.jsx`)
- Express API → LangGraph controller: requests pipeline (evidence: `apps/backend/src/server.js`)
- LangGraph controller → Research agent: requests research (evidence: `apps/AI/graph/orchestrator.py`)
- LangGraph controller → Writer agent: requests writing (evidence: `apps/AI/graph/orchestrator.py`)
- Research agent → MCP retrieval tools: calls tools (evidence: `apps/AI/agents/research_agent.py`)
- Research agent → A2A message schema: creates message (evidence: `apps/AI/agents/research_agent.py`)
- LangGraph controller → A2A message schema: validates message
- Writer agent → A2A message schema: consumes message (evidence: `apps/AI/agents/writer_agent.py`)
- LangGraph controller → Agent registry: reads agent cards (evidence: `apps/AI/graph/orchestrator.py`)
- LangGraph controller → Logger registry: gets logger (evidence: `apps/AI/graph/orchestrator.py`)
- Research agent → Logger registry: gets logger (evidence: `apps/AI/agents/research_agent.py`)
- Writer agent → Logger registry: gets logger (evidence: `apps/AI/agents/writer_agent.py`)
- Logger registry → Run logging: creates logger (evidence: `apps/AI/utils/logger_registry.py`)
- Writer agent → API metrics tracker: tracks API use (evidence: `apps/AI/agents/writer_agent.py`)
- API metrics tracker → Logger registry: gets logger (evidence: `apps/AI/utils/api_tracker.py`)
- Express API → Run records: writes run state (evidence: `apps/backend/src/server.js`)
- Express API → MongoDB: connects (evidence: `apps/backend/src/server.js`)
- Express API → Query and results: returns run data
- Query and results → Trace fetch: loads trace (evidence: `apps/frontend/src/pages/Search.jsx`)
- Query and results → Pipeline progress: renders status (evidence: `apps/frontend/src/pages/Search.jsx`)
- Query and results → Review report: renders report (evidence: `apps/frontend/src/pages/Search.jsx`)
- Query and results → Run analytics: renders analytics (evidence: `apps/frontend/src/pages/Search.jsx`)
- React app → Auth routes: offers auth pages (evidence: `apps/frontend/src/App.jsx`)
- Auth routes → Auth handlers: routes requests (evidence: `apps/backend/src/routes/authRoutes.js`)
- Auth client → Auth routes: posts credentials (evidence: `apps/frontend/src/services/authService.js`)
- Auth state → Auth client: stores auth result
- Express API → Paper results: persists papers (evidence: `README.md`)
- Express API → Review outputs: persists outputs (evidence: `README.md`)
- Express API → Metrics records: persists metrics (evidence: `README.md`)
- MongoDB → Paper results: stores (evidence: `README.md`)
- MongoDB → Review outputs: stores (evidence: `README.md`)
- MongoDB → Metrics records: stores (evidence: `README.md`)
