# achala357/fyp_repo architecture

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

- Interactive diagram: https://gitdiagram.com/achala357/fyp_repo
- Repository: https://github.com/achala357/fyp_repo

## Overview

LegalView is a React contract-intelligence frontend. Users can upload agreements, review upload history, and open documents in a viewer; the viewer retrieves file data from a separately hosted API. The app also exposes dashboard, clause extraction, risk reporting, Q&A, labeling, and settings routes, though several of these pages are placeholders or were not sampled in detail. The graph reflects visible routing, layout composition, and HTTP calls; no backend implementation or persistent store is present in the supplied tree.

Main entry points: [`src/App.jsx`](https://github.com/achala357/fyp_repo/blob/main/src/App.jsx) (Route dispatcher), [`src/components/Layout.jsx`](https://github.com/achala357/fyp_repo/blob/main/src/components/Layout.jsx) (Page layout), [`src/pages/UploadPage.jsx`](https://github.com/achala357/fyp_repo/blob/main/src/pages/UploadPage.jsx) (Contract upload), [`src/pages/UploadHistory.jsx`](https://github.com/achala357/fyp_repo/blob/main/src/pages/UploadHistory.jsx) (Upload history)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_shell["Application shell"]
  node_app["Route dispatcher<br/>[App.jsx]"]
  node_layout["Page layout<br/>[Layout.jsx]"]
  node_sidebar["Sidebar navigation<br/>[Sidebar.jsx]"]
  node_navbar["Top navigation<br/>[Navbar.jsx]"]
end

subgraph group_intake["Document intake"]
  node_upload["Contract upload<br/>[UploadPage.jsx]"]
  node_history["Upload history<br/>[UploadHistory.jsx]"]
end

subgraph group_review["Document review"]
  node_viewer["Contract viewer<br/>[ContractViewer.jsx]"]
end

subgraph group_analysis["Contract analysis"]
  node_clauses["Clause extractor"]
  node_risk["Risk reports<br/>[RiskReport.jsx]"]
  node_chatbot["Contract Q&amp;A<br/>[Chatbot.jsx]"]
  node_labeling["Labeling tool<br/>[LabelingTool.jsx]"]
end

subgraph group_workspace["Workspace tools"]
  node_dashboard["Dashboard<br/>[Dashboard.jsx]"]
  node_settings["Settings<br/>[SettingsPage.jsx]"]
end

node_user(("Legal user"))
node_api["Contract API"]

node_user -->|"opens"| node_app
node_app -->|"wraps routes"| node_layout
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_upload
node_app -->|"routes to"| node_history
node_app -->|"routes to"| node_viewer
node_app -->|"routes to"| node_clauses
node_app -->|"routes to"| node_risk
node_app -->|"routes to"| node_chatbot
node_app -->|"routes to"| node_labeling
node_app -->|"routes to"| node_settings
node_layout -->|"renders"| node_sidebar
node_layout -->|"renders"| node_navbar
node_upload -->|"uploads, lists"| node_api
node_viewer -->|"fetches files"| node_api
node_history -->|"lists, deletes"| node_api

click node_app "https://github.com/achala357/fyp_repo/blob/main/src/App.jsx"
click node_layout "https://github.com/achala357/fyp_repo/blob/main/src/components/Layout.jsx"
click node_sidebar "https://github.com/achala357/fyp_repo/blob/main/src/components/Sidebar.jsx"
click node_navbar "https://github.com/achala357/fyp_repo/blob/main/src/components/Navbar.jsx"
click node_dashboard "https://github.com/achala357/fyp_repo/blob/main/src/pages/Dashboard.jsx"
click node_upload "https://github.com/achala357/fyp_repo/blob/main/src/pages/UploadPage.jsx"
click node_history "https://github.com/achala357/fyp_repo/blob/main/src/pages/UploadHistory.jsx"
click node_viewer "https://github.com/achala357/fyp_repo/blob/main/src/pages/ContractViewer.jsx"
click node_clauses "https://github.com/achala357/fyp_repo/blob/main/src/pages/ClauseExtractor.jsx"
click node_risk "https://github.com/achala357/fyp_repo/blob/main/src/pages/RiskReport.jsx"
click node_chatbot "https://github.com/achala357/fyp_repo/blob/main/src/pages/Chatbot.jsx"
click node_labeling "https://github.com/achala357/fyp_repo/blob/main/src/pages/LabelingTool.jsx"
click node_settings "https://github.com/achala357/fyp_repo/blob/main/src/pages/SettingsPage.jsx"

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_layout,node_sidebar,node_navbar,node_user toneBlue
class node_upload,node_history toneAmber
class node_viewer,node_api toneMint
class node_clauses,node_risk,node_chatbot,node_labeling toneRose
class node_dashboard,node_settings toneIndigo
```

## Components

### Application shell

- [Route dispatcher](https://github.com/achala357/fyp_repo/blob/main/src/App.jsx): `src/App.jsx`
- [Page layout](https://github.com/achala357/fyp_repo/blob/main/src/components/Layout.jsx): `src/components/Layout.jsx`
- [Sidebar navigation](https://github.com/achala357/fyp_repo/blob/main/src/components/Sidebar.jsx): `src/components/Sidebar.jsx`
- [Top navigation](https://github.com/achala357/fyp_repo/blob/main/src/components/Navbar.jsx): `src/components/Navbar.jsx`

### Document intake

- [Contract upload](https://github.com/achala357/fyp_repo/blob/main/src/pages/UploadPage.jsx): `src/pages/UploadPage.jsx`
- [Upload history](https://github.com/achala357/fyp_repo/blob/main/src/pages/UploadHistory.jsx): `src/pages/UploadHistory.jsx`

### Document review

- [Contract viewer](https://github.com/achala357/fyp_repo/blob/main/src/pages/ContractViewer.jsx): `src/pages/ContractViewer.jsx`

### Contract analysis

- [Clause extractor](https://github.com/achala357/fyp_repo/blob/main/src/pages/ClauseExtractor.jsx): `src/pages/ClauseExtractor.jsx`
- [Risk reports](https://github.com/achala357/fyp_repo/blob/main/src/pages/RiskReport.jsx): `src/pages/RiskReport.jsx`
- [Contract Q&A](https://github.com/achala357/fyp_repo/blob/main/src/pages/Chatbot.jsx): `src/pages/Chatbot.jsx`
- [Labeling tool](https://github.com/achala357/fyp_repo/blob/main/src/pages/LabelingTool.jsx): `src/pages/LabelingTool.jsx`

### Workspace tools

- [Dashboard](https://github.com/achala357/fyp_repo/blob/main/src/pages/Dashboard.jsx): `src/pages/Dashboard.jsx`
- [Settings](https://github.com/achala357/fyp_repo/blob/main/src/pages/SettingsPage.jsx): `src/pages/SettingsPage.jsx`

### Other components

- **Legal user**
- **Contract API**

## Connections

- Legal user → Route dispatcher: opens
- Route dispatcher → Page layout: wraps routes (evidence: `src/App.jsx`)
- Route dispatcher → Dashboard: routes to (evidence: `src/App.jsx`)
- Route dispatcher → Contract upload: routes to (evidence: `src/App.jsx`)
- Route dispatcher → Upload history: routes to (evidence: `src/App.jsx`)
- Route dispatcher → Contract viewer: routes to (evidence: `src/App.jsx`)
- Route dispatcher → Clause extractor: routes to (evidence: `src/App.jsx`)
- Route dispatcher → Risk reports: routes to (evidence: `src/App.jsx`)
- Route dispatcher → Contract Q&A: routes to (evidence: `src/App.jsx`)
- Route dispatcher → Labeling tool: routes to (evidence: `src/App.jsx`)
- Route dispatcher → Settings: routes to (evidence: `src/App.jsx`)
- Page layout → Sidebar navigation: renders (evidence: `src/components/Layout.jsx`)
- Page layout → Top navigation: renders (evidence: `src/components/Layout.jsx`)
- Contract upload → Contract API: uploads, lists (evidence: `src/pages/UploadPage.jsx`)
- Contract viewer → Contract API: fetches files (evidence: `src/pages/ContractViewer.jsx`)
- Upload history → Contract API: lists, deletes (evidence: `src/pages/UploadHistory.jsx`)
