# mayur-web03/sih architecture

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

- Interactive diagram: https://gitdiagram.com/mayur-web03/sih
- Repository: https://github.com/mayur-web03/sih

## Overview

CryptoTrace’s checked-in source is a React/TypeScript investigation frontend, despite the README describing a FastAPI backend. Investigators enter through the landing/login flow and work in a dashboard that brings together case data, transaction tracing, risk, cross-case analysis, evidence, reports, and freeze requests. The graph shows only relationships supported by the excerpts or SOURCE INDEX; backend implementation details described in the README are not represented as repository nodes.

Main entry points: [`src/routes/dashboard.tsx`](https://github.com/mayur-web03/sih/blob/main/src/routes/dashboard.tsx) (Investigation dashboard), [`src/components/investigation/FundFlowGraphInner.tsx`](https://github.com/mayur-web03/sih/blob/main/src/components/investigation/FundFlowGraphInner.tsx) (Fund-flow graph), [`src/lib/format.ts`](https://github.com/mayur-web03/sih/blob/main/src/lib/format.ts) (Formatting utilities), [`src/routes/index.tsx`](https://github.com/mayur-web03/sih/blob/main/src/routes/index.tsx) (Landing page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry and navigation"]
  node_landing["Landing page<br/>[index.tsx]"]
  node_login["Login page<br/>[login.tsx]"]
end

subgraph group_investigation["Investigation workspace"]
  node_dashboard["Investigation dashboard<br/>[dashboard.tsx]"]
  node_terminal["Trace activity log<br/>[TerminalLog.tsx]"]
end

subgraph group_analysis["Analysis and evidence"]
  node_fundgraph["Fund-flow graph"]
  node_graphdata["Graph data builder<br/>[buildGraphData.ts]"]
  node_evidence["Evidence panel<br/>[EvidencePanel.tsx]"]
  node_blockview["Transaction block view<br/>[BlockView.tsx]"]
  node_risk["Risk engine<br/>[RiskEngine.ts]"]
  node_riskbadge["Risk badge<br/>[RiskBadge.tsx]"]
  node_crosscase["Cross-case network"]
end

subgraph group_services["Data and services"]
  node_cases["Case management<br/>[casesApi.ts]"]
  node_traceapi["Trace API client<br/>[api.ts]"]
  node_freeze["Freeze requests"]
  node_reports["Investigation reports<br/>[reportsApi.ts]"]
  node_mock["Sample investigation data<br/>[mock.ts]"]
  node_format["Formatting utilities<br/>[format.ts]"]
end

node_investigator(("Investigator"))
node_backend{{"Investigation API"}}

node_investigator -->|"opens"| node_landing
node_landing -->|"navigates to"| node_login
node_investigator -.->|"uses"| node_dashboard
node_dashboard -->|"loads cases"| node_cases
node_dashboard -->|"requests traces"| node_traceapi
node_traceapi -->|"calls API"| node_backend
node_dashboard -->|"renders"| node_fundgraph
node_fundgraph -->|"builds graph"| node_graphdata
node_fundgraph -->|"renders"| node_evidence
node_fundgraph -->|"renders"| node_blockview
node_dashboard -->|"uses"| node_risk
node_dashboard -->|"renders"| node_riskbadge
node_dashboard -->|"renders"| node_crosscase
node_dashboard -->|"manages requests"| node_freeze
node_dashboard -->|"requests reports"| node_reports
node_dashboard -->|"reads sample data"| node_mock
node_dashboard -->|"renders"| node_terminal
node_fundgraph -->|"formats labels"| node_format
node_graphdata -->|"converts values"| node_format
node_evidence -->|"formats values"| node_format
node_blockview -->|"calculates risk"| node_risk

click node_landing "https://github.com/mayur-web03/sih/blob/main/src/routes/index.tsx"
click node_login "https://github.com/mayur-web03/sih/blob/main/src/routes/login.tsx"
click node_dashboard "https://github.com/mayur-web03/sih/blob/main/src/routes/dashboard.tsx"
click node_cases "https://github.com/mayur-web03/sih/blob/main/src/services/casesApi.ts"
click node_traceapi "https://github.com/mayur-web03/sih/blob/main/src/services/api.ts"
click node_fundgraph "https://github.com/mayur-web03/sih/blob/main/src/components/investigation/FundFlowGraphInner.tsx"
click node_graphdata "https://github.com/mayur-web03/sih/blob/main/src/lib/buildGraphData.ts"
click node_evidence "https://github.com/mayur-web03/sih/blob/main/src/components/investigation/EvidencePanel.tsx"
click node_blockview "https://github.com/mayur-web03/sih/blob/main/src/components/investigation/BlockView.tsx"
click node_risk "https://github.com/mayur-web03/sih/blob/main/src/services/risk/RiskEngine.ts"
click node_riskbadge "https://github.com/mayur-web03/sih/blob/main/src/components/shared/RiskBadge.tsx"
click node_crosscase "https://github.com/mayur-web03/sih/blob/main/src/components/network/CrossCaseNetworkGraph.tsx"
click node_freeze "https://github.com/mayur-web03/sih/blob/main/src/services/freezeRequestsApi.ts"
click node_reports "https://github.com/mayur-web03/sih/blob/main/src/services/reportsApi.ts"
click node_mock "https://github.com/mayur-web03/sih/blob/main/src/data/mock.ts"
click node_terminal "https://github.com/mayur-web03/sih/blob/main/src/components/investigation/TerminalLog.tsx"
click node_format "https://github.com/mayur-web03/sih/blob/main/src/lib/format.ts"

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_landing,node_login toneBlue
class node_dashboard,node_terminal toneAmber
class node_fundgraph,node_graphdata,node_evidence,node_blockview,node_risk,node_riskbadge,node_crosscase,node_backend toneMint
class node_cases,node_traceapi,node_freeze,node_reports,node_mock,node_format toneRose
class node_investigator toneIndigo
```

## Components

### Entry and navigation

- [Landing page](https://github.com/mayur-web03/sih/blob/main/src/routes/index.tsx): `src/routes/index.tsx`
- [Login page](https://github.com/mayur-web03/sih/blob/main/src/routes/login.tsx): `src/routes/login.tsx`

### Investigation workspace

- [Investigation dashboard](https://github.com/mayur-web03/sih/blob/main/src/routes/dashboard.tsx): `src/routes/dashboard.tsx`
- [Trace activity log](https://github.com/mayur-web03/sih/blob/main/src/components/investigation/TerminalLog.tsx): `src/components/investigation/TerminalLog.tsx`

### Analysis and evidence

- [Fund-flow graph](https://github.com/mayur-web03/sih/blob/main/src/components/investigation/FundFlowGraphInner.tsx): `src/components/investigation/FundFlowGraphInner.tsx`
- [Graph data builder](https://github.com/mayur-web03/sih/blob/main/src/lib/buildGraphData.ts): `src/lib/buildGraphData.ts`
- [Evidence panel](https://github.com/mayur-web03/sih/blob/main/src/components/investigation/EvidencePanel.tsx): `src/components/investigation/EvidencePanel.tsx`
- [Transaction block view](https://github.com/mayur-web03/sih/blob/main/src/components/investigation/BlockView.tsx): `src/components/investigation/BlockView.tsx`
- [Risk engine](https://github.com/mayur-web03/sih/blob/main/src/services/risk/RiskEngine.ts): `src/services/risk/RiskEngine.ts`
- [Risk badge](https://github.com/mayur-web03/sih/blob/main/src/components/shared/RiskBadge.tsx): `src/components/shared/RiskBadge.tsx`
- [Cross-case network](https://github.com/mayur-web03/sih/blob/main/src/components/network/CrossCaseNetworkGraph.tsx): `src/components/network/CrossCaseNetworkGraph.tsx`

### Data and services

- [Case management](https://github.com/mayur-web03/sih/blob/main/src/services/casesApi.ts): `src/services/casesApi.ts`
- [Trace API client](https://github.com/mayur-web03/sih/blob/main/src/services/api.ts): `src/services/api.ts`
- [Freeze requests](https://github.com/mayur-web03/sih/blob/main/src/services/freezeRequestsApi.ts): `src/services/freezeRequestsApi.ts`
- [Investigation reports](https://github.com/mayur-web03/sih/blob/main/src/services/reportsApi.ts): `src/services/reportsApi.ts`
- [Sample investigation data](https://github.com/mayur-web03/sih/blob/main/src/data/mock.ts): `src/data/mock.ts`
- [Formatting utilities](https://github.com/mayur-web03/sih/blob/main/src/lib/format.ts): `src/lib/format.ts`

### Other components

- **Investigator**
- **Investigation API**

## Connections

- Investigator → Landing page: opens (evidence: `src/routes/index.tsx`)
- Landing page → Login page: navigates to (evidence: `src/routes/index.tsx`)
- Investigator → Investigation dashboard: uses
- Investigation dashboard → Case management: loads cases (evidence: `src/routes/dashboard.tsx`)
- Investigation dashboard → Trace API client: requests traces (evidence: `src/routes/dashboard.tsx`)
- Trace API client → Investigation API: calls API (evidence: `src/services/api.ts`)
- Investigation dashboard → Fund-flow graph: renders (evidence: `src/routes/dashboard.tsx`)
- Fund-flow graph → Graph data builder: builds graph (evidence: `src/components/investigation/FundFlowGraphInner.tsx`)
- Fund-flow graph → Evidence panel: renders (evidence: `src/components/investigation/FundFlowGraphInner.tsx`)
- Fund-flow graph → Transaction block view: renders (evidence: `src/components/investigation/FundFlowGraphInner.tsx`)
- Investigation dashboard → Risk engine: uses (evidence: `src/routes/dashboard.tsx`)
- Investigation dashboard → Risk badge: renders (evidence: `src/routes/dashboard.tsx`)
- Investigation dashboard → Cross-case network: renders (evidence: `src/routes/dashboard.tsx`)
- Investigation dashboard → Freeze requests: manages requests (evidence: `src/routes/dashboard.tsx`)
- Investigation dashboard → Investigation reports: requests reports (evidence: `src/routes/dashboard.tsx`)
- Investigation dashboard → Sample investigation data: reads sample data (evidence: `src/routes/dashboard.tsx`)
- Investigation dashboard → Trace activity log: renders (evidence: `src/routes/dashboard.tsx`)
- Fund-flow graph → Formatting utilities: formats labels (evidence: `src/components/investigation/FundFlowGraphInner.tsx`)
- Graph data builder → Formatting utilities: converts values (evidence: `src/lib/buildGraphData.ts`)
- Evidence panel → Formatting utilities: formats values (evidence: `src/components/investigation/EvidencePanel.tsx`)
- Transaction block view → Risk engine: calculates risk (evidence: `src/components/investigation/BlockView.tsx`)
