# bniteesh06/sentinelpay architecture

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

- Interactive diagram: https://gitdiagram.com/bniteesh06/sentinelpay
- Repository: https://github.com/bniteesh06/sentinelpay

## Overview

SentinelPay is a fraud-detection and analyst-review application. Users can submit transaction details for risk scoring, then inspect flagged transactions, review or block them, and export an audit report; analysts can also simulate a live transaction feed. The browser app provides authentication, evaluation, and dashboard workflows, while the Express service exposes transaction and authentication APIs and supports MongoDB with an in-memory transaction fallback. The risk engine, schemas, and dataset loader are shown as internal layers. TransactionContext implementation was not sampled, so its backend and socket connections are not asserted.

Main entry points: [`client/src/App.jsx`](https://github.com/bniteesh06/sentinelpay/blob/main/client/src/App.jsx) (App routing), [`server/src/routes.js`](https://github.com/bniteesh06/sentinelpay/blob/main/server/src/routes.js) (API routes), [`server/src/server.js`](https://github.com/bniteesh06/sentinelpay/blob/main/server/src/server.js) (HTTP and socket server), [`client/src/context/AuthContext.jsx`](https://github.com/bniteesh06/sentinelpay/blob/main/client/src/context/AuthContext.jsx) (Auth context)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_app["App routing<br/>[App.jsx]"]
  node_marketing["Landing content"]
  node_navbar["Navigation<br/>[Navbar.jsx]"]
  node_login["Login and register<br/>[Login.jsx]"]
  node_auth["Auth context<br/>[AuthContext.jsx]"]
  node_api["HTTP client<br/>[api.js]"]
end

subgraph group_review["Risk and review"]
  node_evaluator["Transaction evaluator<br/>[Evaluator.jsx]"]
  node_dashboard["Alert dashboard<br/>[Dashboard.jsx]"]
  node_txcontext["Transaction context"]
end

subgraph group_service["API service"]
  node_routes["API routes<br/>[routes.js]"]
  node_risk["Risk scoring<br/>[fraudEngine.js]"]
  node_server["HTTP and socket server<br/>[server.js]"]
end

subgraph group_data["Persistence and data"]
  node_models["Data models<br/>[models.js]"]
  node_mongo[("MongoDB")]
  node_memory[("Memory transaction store<br/>[routes.js]")]
  node_dataset["Dataset loader<br/>[dataset.js]"]
  node_seeddata["Seed and stream data<br/>[dataset.json]"]
end

node_analyst(("Analyst"))

node_analyst -->|"uses"| node_app
node_app -->|"routes to"| node_marketing
node_app -->|"routes to"| node_evaluator
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_login
node_app -->|"renders"| node_navbar
node_app -->|"provides"| node_auth
node_app -->|"provides"| node_txcontext
node_login -->|"uses"| node_auth
node_auth -->|"calls"| node_api
node_navbar -->|"reads"| node_auth
node_navbar -->|"reads"| node_txcontext
node_evaluator -->|"submits via"| node_txcontext
node_dashboard -->|"reviews via"| node_txcontext
node_dashboard -->|"reads"| node_auth
node_api -->|"HTTP requests"| node_routes
node_server -->|"mounts"| node_routes
node_routes -->|"scores with"| node_risk
node_server -->|"scores stream"| node_risk
node_routes -->|"queries"| node_models
node_server -->|"seeds"| node_models
node_routes -->|"loads seed data"| node_dataset
node_server -->|"loads stream data"| node_dataset
node_dataset -->|"reads"| node_seeddata
node_models -->|"defines schemas"| node_mongo
node_routes -->|"reads and writes"| node_mongo
node_server -->|"connects"| node_mongo
node_routes -->|"fallback storage"| node_memory

click node_app "https://github.com/bniteesh06/sentinelpay/blob/main/client/src/App.jsx"
click node_marketing "https://github.com/bniteesh06/sentinelpay/tree/main/client/src/components"
click node_navbar "https://github.com/bniteesh06/sentinelpay/blob/main/client/src/components/Navbar.jsx"
click node_login "https://github.com/bniteesh06/sentinelpay/blob/main/client/src/pages/Login.jsx"
click node_auth "https://github.com/bniteesh06/sentinelpay/blob/main/client/src/context/AuthContext.jsx"
click node_api "https://github.com/bniteesh06/sentinelpay/blob/main/client/src/services/api.js"
click node_evaluator "https://github.com/bniteesh06/sentinelpay/blob/main/client/src/pages/Evaluator.jsx"
click node_dashboard "https://github.com/bniteesh06/sentinelpay/blob/main/client/src/pages/Dashboard.jsx"
click node_txcontext "https://github.com/bniteesh06/sentinelpay/blob/main/client/src/context/TransactionContext.jsx"
click node_routes "https://github.com/bniteesh06/sentinelpay/blob/main/server/src/routes.js"
click node_risk "https://github.com/bniteesh06/sentinelpay/blob/main/server/src/fraudEngine.js"
click node_server "https://github.com/bniteesh06/sentinelpay/blob/main/server/src/server.js"
click node_models "https://github.com/bniteesh06/sentinelpay/blob/main/server/src/models.js"
click node_memory "https://github.com/bniteesh06/sentinelpay/blob/main/server/src/routes.js"
click node_dataset "https://github.com/bniteesh06/sentinelpay/blob/main/server/src/dataset.js"
click node_seeddata "https://github.com/bniteesh06/sentinelpay/blob/main/server/data/dataset.json"

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_marketing,node_navbar,node_login,node_auth,node_api toneBlue
class node_evaluator,node_dashboard,node_txcontext toneAmber
class node_routes,node_risk,node_server toneMint
class node_models,node_mongo,node_memory,node_dataset,node_seeddata toneRose
class node_analyst toneIndigo
```

## Components

### Web application

- [App routing](https://github.com/bniteesh06/sentinelpay/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Landing content](https://github.com/bniteesh06/sentinelpay/tree/main/client/src/components): `client/src/components`
- [Navigation](https://github.com/bniteesh06/sentinelpay/blob/main/client/src/components/Navbar.jsx): `client/src/components/Navbar.jsx`
- [Login and register](https://github.com/bniteesh06/sentinelpay/blob/main/client/src/pages/Login.jsx): `client/src/pages/Login.jsx`
- [Auth context](https://github.com/bniteesh06/sentinelpay/blob/main/client/src/context/AuthContext.jsx): `client/src/context/AuthContext.jsx`
- [HTTP client](https://github.com/bniteesh06/sentinelpay/blob/main/client/src/services/api.js): `client/src/services/api.js`

### Risk and review

- [Transaction evaluator](https://github.com/bniteesh06/sentinelpay/blob/main/client/src/pages/Evaluator.jsx): `client/src/pages/Evaluator.jsx`
- [Alert dashboard](https://github.com/bniteesh06/sentinelpay/blob/main/client/src/pages/Dashboard.jsx): `client/src/pages/Dashboard.jsx`
- [Transaction context](https://github.com/bniteesh06/sentinelpay/blob/main/client/src/context/TransactionContext.jsx): `client/src/context/TransactionContext.jsx`

### API service

- [API routes](https://github.com/bniteesh06/sentinelpay/blob/main/server/src/routes.js): `server/src/routes.js`
- [Risk scoring](https://github.com/bniteesh06/sentinelpay/blob/main/server/src/fraudEngine.js): `server/src/fraudEngine.js`
- [HTTP and socket server](https://github.com/bniteesh06/sentinelpay/blob/main/server/src/server.js): `server/src/server.js`

### Persistence and data

- [Data models](https://github.com/bniteesh06/sentinelpay/blob/main/server/src/models.js): `server/src/models.js`
- **MongoDB**
- [Memory transaction store](https://github.com/bniteesh06/sentinelpay/blob/main/server/src/routes.js): `server/src/routes.js`
- [Dataset loader](https://github.com/bniteesh06/sentinelpay/blob/main/server/src/dataset.js): `server/src/dataset.js`
- [Seed and stream data](https://github.com/bniteesh06/sentinelpay/blob/main/server/data/dataset.json): `server/data/dataset.json`

### Other components

- **Analyst**

## Connections

- Analyst → App routing: uses
- App routing → Landing content: routes to (evidence: `client/src/App.jsx`)
- App routing → Transaction evaluator: routes to (evidence: `client/src/App.jsx`)
- App routing → Alert dashboard: routes to (evidence: `client/src/App.jsx`)
- App routing → Login and register: routes to (evidence: `client/src/App.jsx`)
- App routing → Navigation: renders (evidence: `client/src/App.jsx`)
- App routing → Auth context: provides (evidence: `client/src/App.jsx`)
- App routing → Transaction context: provides (evidence: `client/src/App.jsx`)
- Login and register → Auth context: uses (evidence: `client/src/pages/Login.jsx`)
- Auth context → HTTP client: calls (evidence: `client/src/context/AuthContext.jsx`)
- Navigation → Auth context: reads (evidence: `client/src/components/Navbar.jsx`)
- Navigation → Transaction context: reads (evidence: `client/src/components/Navbar.jsx`)
- Transaction evaluator → Transaction context: submits via (evidence: `client/src/pages/Evaluator.jsx`)
- Alert dashboard → Transaction context: reviews via (evidence: `client/src/pages/Dashboard.jsx`)
- Alert dashboard → Auth context: reads (evidence: `client/src/pages/Dashboard.jsx`)
- HTTP client → API routes: HTTP requests (evidence: `client/src/services/api.js`)
- HTTP and socket server → API routes: mounts (evidence: `server/src/server.js`)
- API routes → Risk scoring: scores with (evidence: `server/src/routes.js`)
- HTTP and socket server → Risk scoring: scores stream (evidence: `server/src/server.js`)
- API routes → Data models: queries (evidence: `server/src/routes.js`)
- HTTP and socket server → Data models: seeds (evidence: `server/src/server.js`)
- API routes → Dataset loader: loads seed data (evidence: `server/src/routes.js`)
- HTTP and socket server → Dataset loader: loads stream data (evidence: `server/src/server.js`)
- Dataset loader → Seed and stream data: reads (evidence: `server/src/dataset.js`)
- Data models → MongoDB: defines schemas (evidence: `server/src/models.js`)
- API routes → MongoDB: reads and writes (evidence: `server/src/routes.js`)
- HTTP and socket server → MongoDB: connects (evidence: `server/src/server.js`)
- API routes → Memory transaction store: fallback storage (evidence: `server/src/routes.js`)
