# dhruva-31/fraud-detection-engine-frontend architecture

> Architecture diagram of the GitHub repository dhruva-31/fraud-detection-engine-frontend, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/dhruva-31/fraud-detection-engine-frontend
- Repository: https://github.com/dhruva-31/fraud-detection-engine-frontend

## Overview

This repository is the React frontend for a fraud-detection platform; fraud scoring, persistence, and server-side rule evaluation belong to the separately referenced backend and are not implemented here. The user flow is register/login, enter authenticated monitoring, submit transactions, inspect scores and alerts, review alert outcomes, and consult analytics. The graph covers documented capabilities, but transaction/API, analytics, and alert behavior is only partially sampled; connections to the backend are shown at the frontend request boundary rather than as inspected backend internals.

Main entry points: [`src/App.jsx`](https://github.com/dhruva-31/fraud-detection-engine-frontend/blob/main/src/App.jsx) (Route & Guard), [`src/pages/Home.jsx`](https://github.com/dhruva-31/fraud-detection-engine-frontend/blob/main/src/pages/Home.jsx) (Monitoring Dashboard), [`src/api/axios.js`](https://github.com/dhruva-31/fraud-detection-engine-frontend/blob/main/src/api/axios.js) (API Client), [`src/context/authContext.js`](https://github.com/dhruva-31/fraud-detection-engine-frontend/blob/main/src/context/authContext.js) (Auth State)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access &amp; Routing"]
  node_app["Route &amp; Guard<br/>[App.jsx]"]
  node_login["Sign In<br/>[Login.jsx]"]
  node_register["Registration<br/>[Register.jsx]"]
  node_navbar["Navigation<br/>[navbar.jsx]"]
end

subgraph group_monitor["Transaction Monitoring"]
  node_home["Monitoring Dashboard<br/>[Home.jsx]"]
  node_txview["Transaction History"]
  node_status["Risk Status<br/>[status.jsx]"]
  node_alertview["Alert Review<br/>[alertCard.jsx]"]
end

subgraph group_insights["Analytics"]
  node_analytics["Analytics Dashboard<br/>[Analytics.jsx]"]
  node_summary["Metric Cards<br/>[summaryCard.jsx]"]
end

subgraph group_shared["Shared Frontend Services"]
  node_auth["Auth State<br/>[authContext.js]"]
  node_api["API Client<br/>[axios.js]"]
  node_input["Form Inputs<br/>[inputfield.jsx]"]
  node_socket["Live Alert Context<br/>[socketContext.js]"]
  node_theme["Visual Theme<br/>[colors.js]"]
end

node_user(("User"))
node_backend["Fraud API"]
node_socketservice["Socket.IO Service"]

node_user -->|"opens"| node_app
node_app -->|"checks session"| node_auth
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_analytics
node_app -->|"routes to"| node_login
node_app -->|"routes to"| node_register
node_app -->|"renders"| node_navbar
node_login -->|"posts credentials"| node_api
node_register -->|"posts account"| node_api
node_login -->|"stores session"| node_auth
node_register -->|"stores session"| node_auth
node_home -->|"requests data"| node_api
node_home -->|"renders"| node_input
node_home -->|"renders"| node_txview
node_home -->|"renders"| node_alertview
node_txview -->|"renders"| node_status
node_home -->|"reads live alert"| node_socket
node_socket -->|"checks identity"| node_auth
node_socket -->|"joins room; listens"| node_socketservice
node_analytics -->|"requests metrics"| node_api
node_analytics -->|"renders"| node_summary
node_api -->|"sends HTTP requests"| node_backend
node_socketservice -.->|"connects for events"| node_backend

click node_app "https://github.com/dhruva-31/fraud-detection-engine-frontend/blob/main/src/App.jsx"
click node_login "https://github.com/dhruva-31/fraud-detection-engine-frontend/blob/main/src/pages/Login.jsx"
click node_register "https://github.com/dhruva-31/fraud-detection-engine-frontend/blob/main/src/pages/Register.jsx"
click node_auth "https://github.com/dhruva-31/fraud-detection-engine-frontend/blob/main/src/context/authContext.js"
click node_api "https://github.com/dhruva-31/fraud-detection-engine-frontend/blob/main/src/api/axios.js"
click node_home "https://github.com/dhruva-31/fraud-detection-engine-frontend/blob/main/src/pages/Home.jsx"
click node_txview "https://github.com/dhruva-31/fraud-detection-engine-frontend/blob/main/src/components/transactionCard.jsx"
click node_status "https://github.com/dhruva-31/fraud-detection-engine-frontend/blob/main/src/components/status.jsx"
click node_alertview "https://github.com/dhruva-31/fraud-detection-engine-frontend/blob/main/src/components/alertCard.jsx"
click node_input "https://github.com/dhruva-31/fraud-detection-engine-frontend/blob/main/src/components/inputfield.jsx"
click node_socket "https://github.com/dhruva-31/fraud-detection-engine-frontend/blob/main/src/context/socketContext.js"
click node_analytics "https://github.com/dhruva-31/fraud-detection-engine-frontend/blob/main/src/pages/Analytics.jsx"
click node_summary "https://github.com/dhruva-31/fraud-detection-engine-frontend/blob/main/src/components/summaryCard.jsx"
click node_navbar "https://github.com/dhruva-31/fraud-detection-engine-frontend/blob/main/src/components/navbar.jsx"
click node_theme "https://github.com/dhruva-31/fraud-detection-engine-frontend/blob/main/src/styles/colors.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_login,node_register,node_navbar,node_user toneBlue
class node_home,node_txview,node_status,node_alertview toneAmber
class node_analytics,node_summary,node_backend toneMint
class node_auth,node_api,node_input,node_socket,node_theme toneRose
class node_socketservice toneIndigo
```

## Components

### Access & Routing

- [Route & Guard](https://github.com/dhruva-31/fraud-detection-engine-frontend/blob/main/src/App.jsx): `src/App.jsx`
- [Sign In](https://github.com/dhruva-31/fraud-detection-engine-frontend/blob/main/src/pages/Login.jsx): `src/pages/Login.jsx`
- [Registration](https://github.com/dhruva-31/fraud-detection-engine-frontend/blob/main/src/pages/Register.jsx): `src/pages/Register.jsx`
- [Navigation](https://github.com/dhruva-31/fraud-detection-engine-frontend/blob/main/src/components/navbar.jsx): `src/components/navbar.jsx`

### Transaction Monitoring

- [Monitoring Dashboard](https://github.com/dhruva-31/fraud-detection-engine-frontend/blob/main/src/pages/Home.jsx): `src/pages/Home.jsx`
- [Transaction History](https://github.com/dhruva-31/fraud-detection-engine-frontend/blob/main/src/components/transactionCard.jsx): `src/components/transactionCard.jsx`
- [Risk Status](https://github.com/dhruva-31/fraud-detection-engine-frontend/blob/main/src/components/status.jsx): `src/components/status.jsx`
- [Alert Review](https://github.com/dhruva-31/fraud-detection-engine-frontend/blob/main/src/components/alertCard.jsx): `src/components/alertCard.jsx`

### Analytics

- [Analytics Dashboard](https://github.com/dhruva-31/fraud-detection-engine-frontend/blob/main/src/pages/Analytics.jsx): `src/pages/Analytics.jsx`
- [Metric Cards](https://github.com/dhruva-31/fraud-detection-engine-frontend/blob/main/src/components/summaryCard.jsx): `src/components/summaryCard.jsx`

### Shared Frontend Services

- [Auth State](https://github.com/dhruva-31/fraud-detection-engine-frontend/blob/main/src/context/authContext.js): `src/context/authContext.js`
- [API Client](https://github.com/dhruva-31/fraud-detection-engine-frontend/blob/main/src/api/axios.js): `src/api/axios.js`
- [Form Inputs](https://github.com/dhruva-31/fraud-detection-engine-frontend/blob/main/src/components/inputfield.jsx): `src/components/inputfield.jsx`
- [Live Alert Context](https://github.com/dhruva-31/fraud-detection-engine-frontend/blob/main/src/context/socketContext.js): `src/context/socketContext.js`
- [Visual Theme](https://github.com/dhruva-31/fraud-detection-engine-frontend/blob/main/src/styles/colors.js): `src/styles/colors.js`

### Other components

- **User**
- **Fraud API**
- **Socket.IO Service**

## Connections

- User → Route & Guard: opens (evidence: `README.md`)
- Route & Guard → Auth State: checks session (evidence: `src/App.jsx`)
- Route & Guard → Monitoring Dashboard: routes to (evidence: `src/App.jsx`)
- Route & Guard → Analytics Dashboard: routes to (evidence: `src/App.jsx`)
- Route & Guard → Sign In: routes to (evidence: `src/App.jsx`)
- Route & Guard → Registration: routes to (evidence: `src/App.jsx`)
- Route & Guard → Navigation: renders (evidence: `src/App.jsx`)
- Sign In → API Client: posts credentials (evidence: `src/pages/Login.jsx`)
- Registration → API Client: posts account (evidence: `src/pages/Register.jsx`)
- Sign In → Auth State: stores session (evidence: `src/pages/Login.jsx`)
- Registration → Auth State: stores session (evidence: `src/pages/Register.jsx`)
- Monitoring Dashboard → API Client: requests data (evidence: `src/pages/Home.jsx`)
- Monitoring Dashboard → Form Inputs: renders (evidence: `src/pages/Home.jsx`)
- Monitoring Dashboard → Transaction History: renders (evidence: `src/pages/Home.jsx`)
- Monitoring Dashboard → Alert Review: renders (evidence: `src/pages/Home.jsx`)
- Transaction History → Risk Status: renders (evidence: `src/components/transactionCard.jsx`)
- Monitoring Dashboard → Live Alert Context: reads live alert (evidence: `src/pages/Home.jsx`)
- Live Alert Context → Auth State: checks identity (evidence: `src/context/socketContext.js`)
- Live Alert Context → Socket.IO Service: joins room; listens (evidence: `src/context/socketContext.js`)
- Analytics Dashboard → API Client: requests metrics (evidence: `src/pages/Analytics.jsx`)
- Analytics Dashboard → Metric Cards: renders (evidence: `src/pages/Analytics.jsx`)
- API Client → Fraud API: sends HTTP requests (evidence: `README.md`)
- Socket.IO Service → Fraud API: connects for events
