# jeevilucky143143-create/lawrag architecture

> Architecture diagram of the GitHub repository jeevilucky143143-create/lawrag, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jeevilucky143143-create/lawrag
- Repository: https://github.com/jeevilucky143143-create/lawrag

## Overview

LawPilot AI is a React frontend combining a legal-research landing page with an interactive research console. Users can open the console from prominent calls to action or choose a pre-filtered query from a legal category; the console checks backend status, submits research, and presents progress and results. The API service can use a FastAPI backend or a local fallback, as described in the README. The graph covers the documented agent stages as interface capabilities; backend agent implementations are not present in this repository.

Main entry points: [`src/App.jsx`](https://github.com/jeevilucky143143-create/lawrag/blob/main/src/App.jsx) (App Orchestrator), [`src/components/LegalResearchModal.jsx`](https://github.com/jeevilucky143143-create/lawrag/blob/main/src/components/LegalResearchModal.jsx) (Research Console), [`src/services/api.js`](https://github.com/jeevilucky143143-create/lawrag/blob/main/src/services/api.js) (API And Fallback), [`src/components/Footer.jsx`](https://github.com/jeevilucky143143-create/lawrag/blob/main/src/components/Footer.jsx) (Footer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application Shell"]
  node_app["App Orchestrator<br/>[App.jsx]"]
  node_disclaimer["Disclaimer Modal"]
end

subgraph group_content["Landing Page"]
  node_navbar["Navigation<br/>[Navbar.jsx]"]
  node_hero["Hero Section<br/>[Hero.jsx]"]
  node_about["About Section<br/>[About.jsx]"]
  node_categories["Legal Categories<br/>[Categories.jsx]"]
  node_how["How It Works<br/>[HowItWorks.jsx]"]
  node_stats["Corpus Statistics<br/>[StatsStrip.jsx]"]
  node_trust["Research Integrity<br/>[TrustSection.jsx]"]
  node_agents["Agent Overview<br/>[AgentsGrid.jsx]"]
  node_cta["Final Call To Action<br/>[CallToAction.jsx]"]
  node_footer["Footer<br/>[Footer.jsx]"]
end

subgraph group_research["Research Console"]
  node_console["Research Console"]
  node_planner["Query Planner Stage"]
  node_retriever["Retrieval Stage"]
  node_verifier["Evidence Verification Stage"]
  node_synthesis["Answer Synthesis Stage"]
end

subgraph group_service["Research Service"]
  node_api["API And Fallback<br/>[api.js]"]
end

node_visitor(("Research Visitor"))
node_fastapi{{"FastAPI Backend"}}
node_localcorpus[("Local Corpus Mode")]

node_visitor -->|"uses interface"| node_app
node_app -->|"renders"| node_navbar
node_app -->|"renders"| node_hero
node_app -->|"renders"| node_about
node_app -->|"renders"| node_categories
node_app -->|"renders"| node_how
node_app -->|"renders"| node_stats
node_app -->|"renders"| node_trust
node_app -->|"renders"| node_agents
node_app -->|"renders"| node_cta
node_app -->|"renders"| node_footer
node_app -->|"renders"| node_console
node_app -->|"renders"| node_disclaimer
node_categories -->|"selects query"| node_app
node_footer -->|"opens console"| node_app
node_footer -->|"opens disclaimer"| node_app
node_console -->|"runs research"| node_api
node_console -->|"checks health"| node_api
node_api -->|"sends requests"| node_fastapi
node_api -->|"falls back"| node_localcorpus
node_console -->|"shows progress"| node_planner
node_console -->|"shows progress"| node_retriever
node_console -->|"shows progress"| node_verifier
node_console -->|"shows progress"| node_synthesis

click node_app "https://github.com/jeevilucky143143-create/lawrag/blob/main/src/App.jsx"
click node_navbar "https://github.com/jeevilucky143143-create/lawrag/blob/main/src/components/Navbar.jsx"
click node_hero "https://github.com/jeevilucky143143-create/lawrag/blob/main/src/components/Hero.jsx"
click node_about "https://github.com/jeevilucky143143-create/lawrag/blob/main/src/components/About.jsx"
click node_categories "https://github.com/jeevilucky143143-create/lawrag/blob/main/src/components/Categories.jsx"
click node_how "https://github.com/jeevilucky143143-create/lawrag/blob/main/src/components/HowItWorks.jsx"
click node_stats "https://github.com/jeevilucky143143-create/lawrag/blob/main/src/components/StatsStrip.jsx"
click node_trust "https://github.com/jeevilucky143143-create/lawrag/blob/main/src/components/TrustSection.jsx"
click node_agents "https://github.com/jeevilucky143143-create/lawrag/blob/main/src/components/AgentsGrid.jsx"
click node_cta "https://github.com/jeevilucky143143-create/lawrag/blob/main/src/components/CallToAction.jsx"
click node_footer "https://github.com/jeevilucky143143-create/lawrag/blob/main/src/components/Footer.jsx"
click node_disclaimer "https://github.com/jeevilucky143143-create/lawrag/blob/main/src/components/DisclaimerModal.jsx"
click node_console "https://github.com/jeevilucky143143-create/lawrag/blob/main/src/components/LegalResearchModal.jsx"
click node_planner "https://github.com/jeevilucky143143-create/lawrag/blob/main/src/components/LegalResearchModal.jsx"
click node_retriever "https://github.com/jeevilucky143143-create/lawrag/blob/main/src/components/LegalResearchModal.jsx"
click node_verifier "https://github.com/jeevilucky143143-create/lawrag/blob/main/src/components/LegalResearchModal.jsx"
click node_synthesis "https://github.com/jeevilucky143143-create/lawrag/blob/main/src/components/LegalResearchModal.jsx"
click node_api "https://github.com/jeevilucky143143-create/lawrag/blob/main/src/services/api.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_app,node_disclaimer toneBlue
class node_navbar,node_hero,node_about,node_categories,node_how,node_stats,node_trust,node_agents,node_cta,node_footer,node_localcorpus toneAmber
class node_console,node_planner,node_retriever,node_verifier,node_synthesis,node_fastapi toneMint
class node_api toneRose
class node_visitor toneIndigo
```

## Components

### Application Shell

- [App Orchestrator](https://github.com/jeevilucky143143-create/lawrag/blob/main/src/App.jsx): `src/App.jsx`
- [Disclaimer Modal](https://github.com/jeevilucky143143-create/lawrag/blob/main/src/components/DisclaimerModal.jsx): `src/components/DisclaimerModal.jsx`

### Landing Page

- [Navigation](https://github.com/jeevilucky143143-create/lawrag/blob/main/src/components/Navbar.jsx): `src/components/Navbar.jsx`
- [Hero Section](https://github.com/jeevilucky143143-create/lawrag/blob/main/src/components/Hero.jsx): `src/components/Hero.jsx`
- [About Section](https://github.com/jeevilucky143143-create/lawrag/blob/main/src/components/About.jsx): `src/components/About.jsx`
- [Legal Categories](https://github.com/jeevilucky143143-create/lawrag/blob/main/src/components/Categories.jsx): `src/components/Categories.jsx`
- [How It Works](https://github.com/jeevilucky143143-create/lawrag/blob/main/src/components/HowItWorks.jsx): `src/components/HowItWorks.jsx`
- [Corpus Statistics](https://github.com/jeevilucky143143-create/lawrag/blob/main/src/components/StatsStrip.jsx): `src/components/StatsStrip.jsx`
- [Research Integrity](https://github.com/jeevilucky143143-create/lawrag/blob/main/src/components/TrustSection.jsx): `src/components/TrustSection.jsx`
- [Agent Overview](https://github.com/jeevilucky143143-create/lawrag/blob/main/src/components/AgentsGrid.jsx): `src/components/AgentsGrid.jsx`
- [Final Call To Action](https://github.com/jeevilucky143143-create/lawrag/blob/main/src/components/CallToAction.jsx): `src/components/CallToAction.jsx`
- [Footer](https://github.com/jeevilucky143143-create/lawrag/blob/main/src/components/Footer.jsx): `src/components/Footer.jsx`

### Research Console

- [Research Console](https://github.com/jeevilucky143143-create/lawrag/blob/main/src/components/LegalResearchModal.jsx): `src/components/LegalResearchModal.jsx`
- [Query Planner Stage](https://github.com/jeevilucky143143-create/lawrag/blob/main/src/components/LegalResearchModal.jsx): `src/components/LegalResearchModal.jsx`
- [Retrieval Stage](https://github.com/jeevilucky143143-create/lawrag/blob/main/src/components/LegalResearchModal.jsx): `src/components/LegalResearchModal.jsx`
- [Evidence Verification Stage](https://github.com/jeevilucky143143-create/lawrag/blob/main/src/components/LegalResearchModal.jsx): `src/components/LegalResearchModal.jsx`
- [Answer Synthesis Stage](https://github.com/jeevilucky143143-create/lawrag/blob/main/src/components/LegalResearchModal.jsx): `src/components/LegalResearchModal.jsx`

### Research Service

- [API And Fallback](https://github.com/jeevilucky143143-create/lawrag/blob/main/src/services/api.js): `src/services/api.js`

### Other components

- **Research Visitor**
- **FastAPI Backend**
- **Local Corpus Mode**

## Connections

- Research Visitor → App Orchestrator: uses interface
- App Orchestrator → Navigation: renders (evidence: `src/App.jsx`)
- App Orchestrator → Hero Section: renders (evidence: `src/App.jsx`)
- App Orchestrator → About Section: renders (evidence: `src/App.jsx`)
- App Orchestrator → Legal Categories: renders (evidence: `src/App.jsx`)
- App Orchestrator → How It Works: renders (evidence: `src/App.jsx`)
- App Orchestrator → Corpus Statistics: renders (evidence: `src/App.jsx`)
- App Orchestrator → Research Integrity: renders (evidence: `src/App.jsx`)
- App Orchestrator → Agent Overview: renders (evidence: `src/App.jsx`)
- App Orchestrator → Final Call To Action: renders (evidence: `src/App.jsx`)
- App Orchestrator → Footer: renders (evidence: `src/App.jsx`)
- App Orchestrator → Research Console: renders (evidence: `src/App.jsx`)
- App Orchestrator → Disclaimer Modal: renders (evidence: `src/App.jsx`)
- Legal Categories → App Orchestrator: selects query (evidence: `src/App.jsx`)
- Footer → App Orchestrator: opens console (evidence: `src/App.jsx`)
- Footer → App Orchestrator: opens disclaimer (evidence: `src/App.jsx`)
- Research Console → API And Fallback: runs research (evidence: `src/components/LegalResearchModal.jsx`)
- Research Console → API And Fallback: checks health (evidence: `src/components/LegalResearchModal.jsx`)
- API And Fallback → FastAPI Backend: sends requests (evidence: `src/services/api.js`)
- API And Fallback → Local Corpus Mode: falls back (evidence: `README.md`)
- Research Console → Query Planner Stage: shows progress (evidence: `src/components/LegalResearchModal.jsx`)
- Research Console → Retrieval Stage: shows progress (evidence: `src/components/LegalResearchModal.jsx`)
- Research Console → Evidence Verification Stage: shows progress (evidence: `README.md`)
- Research Console → Answer Synthesis Stage: shows progress (evidence: `README.md`)
