# balaji-1206/judgeai architecture

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

- Interactive diagram: https://gitdiagram.com/balaji-1206/judgeai
- Repository: https://github.com/balaji-1206/judgeai

## Overview

Judgement Insight is a legal-document workflow application: users upload court PDFs, the backend extracts and analyzes document text, and the resulting actions can be reviewed, edited, tracked, and surfaced with deadline reminders. The graph separates the React interface, API and review layer, document-processing stages, and persistence/notifications. The README is empty; frontend-to-backend API wiring and several unsampled UI relationships are therefore shown only as unverified or omitted. Backend processing links follow the pipeline and imports documented in the excerpts and SOURCE INDEX.

Main entry points: [`jas-backend/app/services/pipeline.py`](https://github.com/balaji-1206/judgeai/blob/main/jas-backend/app/services/pipeline.py) (Processing orchestrator), [`jas-backend/app/main.py`](https://github.com/balaji-1206/judgeai/blob/main/jas-backend/app/main.py) (FastAPI routes), [`jas-backend/app/db.py`](https://github.com/balaji-1206/judgeai/blob/main/jas-backend/app/db.py) (Application database), [`frontend/judgement-insight-main/src/pages/Index.tsx`](https://github.com/balaji-1206/judgeai/blob/main/frontend/judgement-insight-main/src/pages/Index.tsx) (Court dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Frontend"]
  node_app["React app<br/>[App.tsx]"]
  node_dashboard["Court dashboard<br/>[Index.tsx]"]
  node_upload_ui["Document upload<br/>[UploadSection.tsx]"]
  node_actions_ui["Action review UI<br/>[ActionsTable.tsx]"]
  node_action_edit["Action editor"]
  node_audit_ui["Audit timeline<br/>[AuditTimeline.tsx]"]
  node_status_ui["Status display<br/>[StatusBadge.tsx]"]
  node_alerts_ui["Alerts and metrics<br/>[AlertsPanel.tsx]"]
  node_frontend_api["API client<br/>[api.ts]"]
  node_services_api["Service wrappers<br/>[services.js]"]
end

subgraph group_api["API and Review"]
  node_backend_api["FastAPI routes<br/>[main.py]"]
  node_review["Review editor<br/>[review_editor.py]"]
end

subgraph group_processing["Document Processing"]
  node_pipeline["Processing orchestrator<br/>[pipeline.py]"]
  node_ingestion["PDF ingestion<br/>[ingestion.py]"]
  node_ocr["PDF text extraction<br/>[ocr_service.py]"]
  node_preprocessing["Text preprocessing<br/>[preprocessing.py]"]
  node_nlp["Legal NLP analysis<br/>[nlp_service.py]"]
  node_action_engine["Action extraction<br/>[action_engine.py]"]
  node_deadlines["Deadline engine<br/>[deadline_engine.py]"]
end

subgraph group_operations["Persistence and Alerts"]
  node_database[("Application database<br/>[db.py]")]
  node_notification["Notifications"]
  node_alert_service["Alert service<br/>[alert_service.py]"]
  node_config["Runtime settings<br/>[config.py]"]
end

node_user(("Court staff"))

node_user -.->|"uses"| node_app
node_app -->|"routes to"| node_dashboard
node_dashboard -.->|"renders"| node_upload_ui
node_dashboard -.->|"renders"| node_actions_ui
node_actions_ui -->|"opens"| node_action_edit
node_actions_ui -->|"shows history"| node_audit_ui
node_actions_ui -->|"renders"| node_status_ui
node_dashboard -.->|"renders"| node_alerts_ui
node_dashboard -.->|"uses"| node_frontend_api
node_services_api -->|"calls"| node_frontend_api
node_frontend_api -.->|"HTTP requests"| node_backend_api
node_backend_api -->|"stores uploads"| node_ingestion
node_backend_api -->|"starts processing"| node_pipeline
node_backend_api -->|"queries records"| node_database
node_backend_api -->|"delegates edits"| node_review
node_backend_api -->|"uses service"| node_notification
node_pipeline -->|"gets document"| node_ingestion
node_pipeline -->|"extracts text"| node_ocr
node_pipeline -->|"preprocesses text"| node_preprocessing
node_pipeline -->|"analyzes text"| node_nlp
node_pipeline -->|"extracts actions"| node_action_engine
node_pipeline -->|"saves actions"| node_database
node_ingestion -->|"records metadata"| node_database
node_review -->|"updates review"| node_database
node_notification -->|"reads and writes"| node_database
node_notification -->|"checks deadlines"| node_deadlines
node_alert_service -->|"uses records"| node_database
node_ingestion -->|"uses settings"| node_config
node_ocr -->|"uses settings"| node_config

click node_app "https://github.com/balaji-1206/judgeai/blob/main/frontend/judgement-insight-main/src/App.tsx"
click node_dashboard "https://github.com/balaji-1206/judgeai/blob/main/frontend/judgement-insight-main/src/pages/Index.tsx"
click node_upload_ui "https://github.com/balaji-1206/judgeai/blob/main/frontend/judgement-insight-main/src/components/court/UploadSection.tsx"
click node_actions_ui "https://github.com/balaji-1206/judgeai/blob/main/frontend/judgement-insight-main/src/components/court/ActionsTable.tsx"
click node_action_edit "https://github.com/balaji-1206/judgeai/blob/main/frontend/judgement-insight-main/src/components/court/ActionEditDialog.tsx"
click node_audit_ui "https://github.com/balaji-1206/judgeai/blob/main/frontend/judgement-insight-main/src/components/court/AuditTimeline.tsx"
click node_status_ui "https://github.com/balaji-1206/judgeai/blob/main/frontend/judgement-insight-main/src/components/court/StatusBadge.tsx"
click node_alerts_ui "https://github.com/balaji-1206/judgeai/blob/main/frontend/judgement-insight-main/src/components/court/AlertsPanel.tsx"
click node_frontend_api "https://github.com/balaji-1206/judgeai/blob/main/frontend/judgement-insight-main/src/lib/api.ts"
click node_services_api "https://github.com/balaji-1206/judgeai/blob/main/frontend/judgement-insight-main/src/services/services.js"
click node_backend_api "https://github.com/balaji-1206/judgeai/blob/main/jas-backend/app/main.py"
click node_review "https://github.com/balaji-1206/judgeai/blob/main/jas-backend/app/services/review_editor.py"
click node_pipeline "https://github.com/balaji-1206/judgeai/blob/main/jas-backend/app/services/pipeline.py"
click node_ingestion "https://github.com/balaji-1206/judgeai/blob/main/jas-backend/app/services/ingestion.py"
click node_ocr "https://github.com/balaji-1206/judgeai/blob/main/jas-backend/app/services/ocr_service.py"
click node_preprocessing "https://github.com/balaji-1206/judgeai/blob/main/jas-backend/app/services/preprocessing.py"
click node_nlp "https://github.com/balaji-1206/judgeai/blob/main/jas-backend/app/services/nlp_service.py"
click node_action_engine "https://github.com/balaji-1206/judgeai/blob/main/jas-backend/app/services/action_engine.py"
click node_deadlines "https://github.com/balaji-1206/judgeai/blob/main/jas-backend/app/services/deadline_engine.py"
click node_database "https://github.com/balaji-1206/judgeai/blob/main/jas-backend/app/db.py"
click node_notification "https://github.com/balaji-1206/judgeai/blob/main/jas-backend/app/services/notification_service.py"
click node_alert_service "https://github.com/balaji-1206/judgeai/blob/main/jas-backend/app/services/alert_service.py"
click node_config "https://github.com/balaji-1206/judgeai/blob/main/jas-backend/app/config.py"

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_dashboard,node_upload_ui,node_actions_ui,node_action_edit,node_audit_ui,node_status_ui,node_alerts_ui,node_frontend_api,node_services_api toneBlue
class node_backend_api,node_review toneAmber
class node_pipeline,node_ingestion,node_ocr,node_preprocessing,node_nlp,node_action_engine,node_deadlines toneMint
class node_database,node_notification,node_alert_service,node_config toneRose
class node_user toneIndigo
```

## Components

### Frontend

- [React app](https://github.com/balaji-1206/judgeai/blob/main/frontend/judgement-insight-main/src/App.tsx): `frontend/judgement-insight-main/src/App.tsx`
- [Court dashboard](https://github.com/balaji-1206/judgeai/blob/main/frontend/judgement-insight-main/src/pages/Index.tsx): `frontend/judgement-insight-main/src/pages/Index.tsx`
- [Document upload](https://github.com/balaji-1206/judgeai/blob/main/frontend/judgement-insight-main/src/components/court/UploadSection.tsx): `frontend/judgement-insight-main/src/components/court/UploadSection.tsx`
- [Action review UI](https://github.com/balaji-1206/judgeai/blob/main/frontend/judgement-insight-main/src/components/court/ActionsTable.tsx): `frontend/judgement-insight-main/src/components/court/ActionsTable.tsx`
- [Action editor](https://github.com/balaji-1206/judgeai/blob/main/frontend/judgement-insight-main/src/components/court/ActionEditDialog.tsx): `frontend/judgement-insight-main/src/components/court/ActionEditDialog.tsx`
- [Audit timeline](https://github.com/balaji-1206/judgeai/blob/main/frontend/judgement-insight-main/src/components/court/AuditTimeline.tsx): `frontend/judgement-insight-main/src/components/court/AuditTimeline.tsx`
- [Status display](https://github.com/balaji-1206/judgeai/blob/main/frontend/judgement-insight-main/src/components/court/StatusBadge.tsx): `frontend/judgement-insight-main/src/components/court/StatusBadge.tsx`
- [Alerts and metrics](https://github.com/balaji-1206/judgeai/blob/main/frontend/judgement-insight-main/src/components/court/AlertsPanel.tsx): `frontend/judgement-insight-main/src/components/court/AlertsPanel.tsx`
- [API client](https://github.com/balaji-1206/judgeai/blob/main/frontend/judgement-insight-main/src/lib/api.ts): `frontend/judgement-insight-main/src/lib/api.ts`
- [Service wrappers](https://github.com/balaji-1206/judgeai/blob/main/frontend/judgement-insight-main/src/services/services.js): `frontend/judgement-insight-main/src/services/services.js`

### API and Review

- [FastAPI routes](https://github.com/balaji-1206/judgeai/blob/main/jas-backend/app/main.py): `jas-backend/app/main.py`
- [Review editor](https://github.com/balaji-1206/judgeai/blob/main/jas-backend/app/services/review_editor.py): `jas-backend/app/services/review_editor.py`

### Document Processing

- [Processing orchestrator](https://github.com/balaji-1206/judgeai/blob/main/jas-backend/app/services/pipeline.py): `jas-backend/app/services/pipeline.py`
- [PDF ingestion](https://github.com/balaji-1206/judgeai/blob/main/jas-backend/app/services/ingestion.py): `jas-backend/app/services/ingestion.py`
- [PDF text extraction](https://github.com/balaji-1206/judgeai/blob/main/jas-backend/app/services/ocr_service.py): `jas-backend/app/services/ocr_service.py`
- [Text preprocessing](https://github.com/balaji-1206/judgeai/blob/main/jas-backend/app/services/preprocessing.py): `jas-backend/app/services/preprocessing.py`
- [Legal NLP analysis](https://github.com/balaji-1206/judgeai/blob/main/jas-backend/app/services/nlp_service.py): `jas-backend/app/services/nlp_service.py`
- [Action extraction](https://github.com/balaji-1206/judgeai/blob/main/jas-backend/app/services/action_engine.py): `jas-backend/app/services/action_engine.py`
- [Deadline engine](https://github.com/balaji-1206/judgeai/blob/main/jas-backend/app/services/deadline_engine.py): `jas-backend/app/services/deadline_engine.py`

### Persistence and Alerts

- [Application database](https://github.com/balaji-1206/judgeai/blob/main/jas-backend/app/db.py): `jas-backend/app/db.py`
- [Notifications](https://github.com/balaji-1206/judgeai/blob/main/jas-backend/app/services/notification_service.py): `jas-backend/app/services/notification_service.py`
- [Alert service](https://github.com/balaji-1206/judgeai/blob/main/jas-backend/app/services/alert_service.py): `jas-backend/app/services/alert_service.py`
- [Runtime settings](https://github.com/balaji-1206/judgeai/blob/main/jas-backend/app/config.py): `jas-backend/app/config.py`

### Other components

- **Court staff**

## Connections

- Court staff → React app: uses
- React app → Court dashboard: routes to (evidence: `frontend/judgement-insight-main/src/App.tsx`)
- Court dashboard → Document upload: renders
- Court dashboard → Action review UI: renders
- Action review UI → Action editor: opens (evidence: `frontend/judgement-insight-main/src/components/court/ActionsTable.tsx`)
- Action review UI → Audit timeline: shows history (evidence: `frontend/judgement-insight-main/src/components/court/ActionsTable.tsx`)
- Action review UI → Status display: renders (evidence: `frontend/judgement-insight-main/src/components/court/ActionsTable.tsx`)
- Court dashboard → Alerts and metrics: renders
- Court dashboard → API client: uses
- Service wrappers → API client: calls (evidence: `frontend/judgement-insight-main/src/services/services.js`)
- API client → FastAPI routes: HTTP requests
- FastAPI routes → PDF ingestion: stores uploads (evidence: `jas-backend/app/main.py`)
- FastAPI routes → Processing orchestrator: starts processing (evidence: `jas-backend/app/main.py`)
- FastAPI routes → Application database: queries records (evidence: `jas-backend/app/main.py`)
- FastAPI routes → Review editor: delegates edits (evidence: `jas-backend/app/main.py`)
- FastAPI routes → Notifications: uses service (evidence: `jas-backend/app/main.py`)
- Processing orchestrator → PDF ingestion: gets document (evidence: `jas-backend/app/services/pipeline.py`)
- Processing orchestrator → PDF text extraction: extracts text (evidence: `jas-backend/app/services/pipeline.py`)
- Processing orchestrator → Text preprocessing: preprocesses text (evidence: `jas-backend/app/services/pipeline.py`)
- Processing orchestrator → Legal NLP analysis: analyzes text (evidence: `jas-backend/app/services/pipeline.py`)
- Processing orchestrator → Action extraction: extracts actions (evidence: `jas-backend/app/services/pipeline.py`)
- Processing orchestrator → Application database: saves actions (evidence: `jas-backend/app/services/pipeline.py`)
- PDF ingestion → Application database: records metadata (evidence: `jas-backend/app/services/ingestion.py`)
- Review editor → Application database: updates review (evidence: `jas-backend/app/services/review_editor.py`)
- Notifications → Application database: reads and writes (evidence: `jas-backend/app/services/notification_service.py`)
- Notifications → Deadline engine: checks deadlines (evidence: `jas-backend/app/services/notification_service.py`)
- Alert service → Application database: uses records (evidence: `jas-backend/app/services/alert_service.py`)
- PDF ingestion → Runtime settings: uses settings (evidence: `jas-backend/app/services/ingestion.py`)
- PDF text extraction → Runtime settings: uses settings (evidence: `jas-backend/app/services/ocr_service.py`)
