# thillainirmal-tech/sentinelpay architecture

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

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

## Overview

SentinelPay is a simulated UPI payment platform that evaluates fraud before moving money, then processes payment outcomes and notifications asynchronously. The principal workflow starts with a customer submitting a payment, continues through transaction event publication and layered fraud analysis, and reaches bank debit only after approval. Separate branches cover registration and authentication, customer dashboards and fraud views, refunds/payment integrations, and notification delivery. Some service links and capabilities are documented in the README; unsampled implementation details are not asserted as verified calls.

Main entry points: [`fraud-detection-service/src/main/java/com/fraud/detection/service/FraudDetectionService.java`](https://github.com/thillainirmal-tech/sentinelpay/blob/main/fraud-detection-service/src/main/java/com/fraud/detection/service/FraudDetectionService.java) (Fraud verdict engine), [`fraud-detection-service/src/main/java/com/fraud/detection/payment/PaymentProcessorService.java`](https://github.com/thillainirmal-tech/sentinelpay/blob/main/fraud-detection-service/src/main/java/com/fraud/detection/payment/PaymentProcessorService.java) (Payment processor), [`sentinelpay-frontend/src/App.jsx`](https://github.com/thillainirmal-tech/sentinelpay/blob/main/sentinelpay-frontend/src/App.jsx) (React dashboard), [`auth-service/src/main/java/com/fraud/auth/service/AuthService.java`](https://github.com/thillainirmal-tech/sentinelpay/blob/main/auth-service/src/main/java/com/fraud/auth/service/AuthService.java) (Auth and tokens)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Customer application"]
  node_frontend["React dashboard<br/>[App.jsx]"]
  node_dashboard["Dashboard views<br/>[Dashboard.jsx]"]
  node_alerts["Fraud alerts<br/>[FraudAlerts.jsx]"]
end

subgraph group_identity["Identity and access"]
  node_gateway["API gateway"]
  node_authcontroller["Auth endpoints"]
  node_auth["Auth and tokens<br/>[AuthService.java]"]
  node_users[("User records<br/>[User.java]")]
end

subgraph group_payments["Payment intake"]
  node_transaction["Transaction intake"]
  node_event["Transaction event"]
  node_kafka["Kafka event backbone"]
end

subgraph group_risk["Fraud and payment processing"]
  node_consumer["Transaction consumer"]
  node_fraud["Fraud verdict engine"]
  node_rules["Rule configuration"]
  node_history["Behavior history"]
  node_redis[("Redis risk state<br/>[RedisService.java]")]
  node_ai["AI analysis"]
  node_payment["Payment processor"]
  node_razorpay["Razorpay integration"]
  node_bankclient["Bank service client"]
end

subgraph group_operations["Banking and notifications"]
  node_bank["Bank account service<br/>[BankService.java]"]
  node_bankdata[("Account and ledger<br/>[BankAccount.java]")]
  node_notifyproducer["Alert publisher"]
  node_notifyconsumer["Notification consumer"]
  node_email["Email delivery<br/>[EmailService.java]"]
end

node_customer(("Customer"))
node_mailservice(("Email provider"))

node_customer -->|"uses"| node_frontend
node_frontend -.->|"sends requests"| node_gateway
node_frontend -->|"routes to"| node_dashboard
node_frontend -->|"routes to"| node_alerts
node_gateway -.->|"routes requests"| node_authcontroller
node_authcontroller -->|"delegates to"| node_auth
node_auth -->|"persists users"| node_users
node_auth -->|"creates account"| node_bank
node_customer -->|"submits payment"| node_transaction
node_transaction -->|"builds event"| node_event
node_transaction -->|"publishes event"| node_kafka
node_kafka -->|"delivers events"| node_consumer
node_consumer -.->|"analyzes transaction"| node_fraud
node_fraud -->|"uses thresholds"| node_rules
node_fraud -->|"evaluates history"| node_history
node_fraud -->|"reads and writes"| node_redis
node_fraud -->|"requests analysis"| node_ai
node_fraud -.->|"gates payment"| node_payment
node_payment -->|"checks and stores"| node_redis
node_payment -->|"requests money movement"| node_bankclient
node_bankclient -.->|"calls bank API"| node_bank
node_payment -->|"creates order"| node_razorpay
node_bank -->|"persists balances"| node_bankdata
node_payment -->|"publishes alerts"| node_notifyproducer
node_notifyproducer -.->|"sends events"| node_notifyconsumer
node_notifyconsumer -.->|"dispatches email"| node_email
node_email -.->|"sends mail"| node_mailservice

click node_frontend "https://github.com/thillainirmal-tech/sentinelpay/blob/main/sentinelpay-frontend/src/App.jsx"
click node_dashboard "https://github.com/thillainirmal-tech/sentinelpay/blob/main/sentinelpay-frontend/src/pages/Dashboard.jsx"
click node_alerts "https://github.com/thillainirmal-tech/sentinelpay/blob/main/sentinelpay-frontend/src/pages/FraudAlerts.jsx"
click node_gateway "https://github.com/thillainirmal-tech/sentinelpay/blob/main/api-gateway/src/main/java/com/fraud/gateway/ApiGatewayApplication.java"
click node_authcontroller "https://github.com/thillainirmal-tech/sentinelpay/blob/main/auth-service/src/main/java/com/fraud/auth/controller/AuthController.java"
click node_auth "https://github.com/thillainirmal-tech/sentinelpay/blob/main/auth-service/src/main/java/com/fraud/auth/service/AuthService.java"
click node_users "https://github.com/thillainirmal-tech/sentinelpay/blob/main/auth-service/src/main/java/com/fraud/auth/entity/User.java"
click node_transaction "https://github.com/thillainirmal-tech/sentinelpay/blob/main/transaction-service/src/main/java/com/fraud/transaction/service/UpiPaymentService.java"
click node_event "https://github.com/thillainirmal-tech/sentinelpay/blob/main/common-dto/src/main/java/com/fraud/common/dto/TransactionEvent.java"
click node_kafka "https://github.com/thillainirmal-tech/sentinelpay/blob/main/transaction-service/src/main/java/com/fraud/transaction/service/KafkaProducerService.java"
click node_consumer "https://github.com/thillainirmal-tech/sentinelpay/blob/main/fraud-detection-service/src/main/java/com/fraud/detection/consumer/TransactionConsumer.java"
click node_fraud "https://github.com/thillainirmal-tech/sentinelpay/blob/main/fraud-detection-service/src/main/java/com/fraud/detection/service/FraudDetectionService.java"
click node_rules "https://github.com/thillainirmal-tech/sentinelpay/blob/main/fraud-detection-service/src/main/java/com/fraud/detection/config/FraudRulesProperties.java"
click node_history "https://github.com/thillainirmal-tech/sentinelpay/blob/main/fraud-detection-service/src/main/java/com/fraud/detection/model/UserTransactionHistory.java"
click node_redis "https://github.com/thillainirmal-tech/sentinelpay/blob/main/fraud-detection-service/src/main/java/com/fraud/detection/service/RedisService.java"
click node_ai "https://github.com/thillainirmal-tech/sentinelpay/blob/main/fraud-detection-service/src/main/java/com/fraud/detection/service/AiFraudAnalysisService.java"
click node_payment "https://github.com/thillainirmal-tech/sentinelpay/blob/main/fraud-detection-service/src/main/java/com/fraud/detection/payment/PaymentProcessorService.java"
click node_razorpay "https://github.com/thillainirmal-tech/sentinelpay/blob/main/fraud-detection-service/src/main/java/com/fraud/detection/payment/RazorpayService.java"
click node_bankclient "https://github.com/thillainirmal-tech/sentinelpay/blob/main/fraud-detection-service/src/main/java/com/fraud/detection/client/BankServiceClient.java"
click node_bank "https://github.com/thillainirmal-tech/sentinelpay/blob/main/bank-service/src/main/java/com/fraud/bank/service/BankService.java"
click node_bankdata "https://github.com/thillainirmal-tech/sentinelpay/blob/main/bank-service/src/main/java/com/fraud/bank/entity/BankAccount.java"
click node_notifyproducer "https://github.com/thillainirmal-tech/sentinelpay/blob/main/fraud-detection-service/src/main/java/com/fraud/detection/producer/NotificationProducer.java"
click node_notifyconsumer "https://github.com/thillainirmal-tech/sentinelpay/blob/main/notification-service/src/main/java/com/fraud/notification/consumer/NotificationConsumer.java"
click node_email "https://github.com/thillainirmal-tech/sentinelpay/blob/main/notification-service/src/main/java/com/fraud/notification/service/EmailService.java"

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_frontend,node_dashboard,node_alerts toneBlue
class node_gateway,node_authcontroller,node_auth,node_users toneAmber
class node_transaction,node_event,node_kafka toneMint
class node_consumer,node_fraud,node_rules,node_history,node_redis,node_ai,node_payment,node_razorpay,node_bankclient toneRose
class node_bank,node_bankdata,node_notifyproducer,node_notifyconsumer,node_email,node_customer,node_mailservice toneIndigo
```

## Components

### Customer application

- [React dashboard](https://github.com/thillainirmal-tech/sentinelpay/blob/main/sentinelpay-frontend/src/App.jsx): `sentinelpay-frontend/src/App.jsx`
- [Dashboard views](https://github.com/thillainirmal-tech/sentinelpay/blob/main/sentinelpay-frontend/src/pages/Dashboard.jsx): `sentinelpay-frontend/src/pages/Dashboard.jsx`
- [Fraud alerts](https://github.com/thillainirmal-tech/sentinelpay/blob/main/sentinelpay-frontend/src/pages/FraudAlerts.jsx): `sentinelpay-frontend/src/pages/FraudAlerts.jsx`

### Identity and access

- [API gateway](https://github.com/thillainirmal-tech/sentinelpay/blob/main/api-gateway/src/main/java/com/fraud/gateway/ApiGatewayApplication.java): `api-gateway/src/main/java/com/fraud/gateway/ApiGatewayApplication.java`
- [Auth endpoints](https://github.com/thillainirmal-tech/sentinelpay/blob/main/auth-service/src/main/java/com/fraud/auth/controller/AuthController.java): `auth-service/src/main/java/com/fraud/auth/controller/AuthController.java`
- [Auth and tokens](https://github.com/thillainirmal-tech/sentinelpay/blob/main/auth-service/src/main/java/com/fraud/auth/service/AuthService.java): `auth-service/src/main/java/com/fraud/auth/service/AuthService.java`
- [User records](https://github.com/thillainirmal-tech/sentinelpay/blob/main/auth-service/src/main/java/com/fraud/auth/entity/User.java): `auth-service/src/main/java/com/fraud/auth/entity/User.java`

### Payment intake

- [Transaction intake](https://github.com/thillainirmal-tech/sentinelpay/blob/main/transaction-service/src/main/java/com/fraud/transaction/service/UpiPaymentService.java): `transaction-service/src/main/java/com/fraud/transaction/service/UpiPaymentService.java`
- [Transaction event](https://github.com/thillainirmal-tech/sentinelpay/blob/main/common-dto/src/main/java/com/fraud/common/dto/TransactionEvent.java): `common-dto/src/main/java/com/fraud/common/dto/TransactionEvent.java`
- [Kafka event backbone](https://github.com/thillainirmal-tech/sentinelpay/blob/main/transaction-service/src/main/java/com/fraud/transaction/service/KafkaProducerService.java): `transaction-service/src/main/java/com/fraud/transaction/service/KafkaProducerService.java`

### Fraud and payment processing

- [Transaction consumer](https://github.com/thillainirmal-tech/sentinelpay/blob/main/fraud-detection-service/src/main/java/com/fraud/detection/consumer/TransactionConsumer.java): `fraud-detection-service/src/main/java/com/fraud/detection/consumer/TransactionConsumer.java`
- [Fraud verdict engine](https://github.com/thillainirmal-tech/sentinelpay/blob/main/fraud-detection-service/src/main/java/com/fraud/detection/service/FraudDetectionService.java): `fraud-detection-service/src/main/java/com/fraud/detection/service/FraudDetectionService.java`
- [Rule configuration](https://github.com/thillainirmal-tech/sentinelpay/blob/main/fraud-detection-service/src/main/java/com/fraud/detection/config/FraudRulesProperties.java): `fraud-detection-service/src/main/java/com/fraud/detection/config/FraudRulesProperties.java`
- [Behavior history](https://github.com/thillainirmal-tech/sentinelpay/blob/main/fraud-detection-service/src/main/java/com/fraud/detection/model/UserTransactionHistory.java): `fraud-detection-service/src/main/java/com/fraud/detection/model/UserTransactionHistory.java`
- [Redis risk state](https://github.com/thillainirmal-tech/sentinelpay/blob/main/fraud-detection-service/src/main/java/com/fraud/detection/service/RedisService.java): `fraud-detection-service/src/main/java/com/fraud/detection/service/RedisService.java`
- [AI analysis](https://github.com/thillainirmal-tech/sentinelpay/blob/main/fraud-detection-service/src/main/java/com/fraud/detection/service/AiFraudAnalysisService.java): `fraud-detection-service/src/main/java/com/fraud/detection/service/AiFraudAnalysisService.java`
- [Payment processor](https://github.com/thillainirmal-tech/sentinelpay/blob/main/fraud-detection-service/src/main/java/com/fraud/detection/payment/PaymentProcessorService.java): `fraud-detection-service/src/main/java/com/fraud/detection/payment/PaymentProcessorService.java`
- [Razorpay integration](https://github.com/thillainirmal-tech/sentinelpay/blob/main/fraud-detection-service/src/main/java/com/fraud/detection/payment/RazorpayService.java): `fraud-detection-service/src/main/java/com/fraud/detection/payment/RazorpayService.java`
- [Bank service client](https://github.com/thillainirmal-tech/sentinelpay/blob/main/fraud-detection-service/src/main/java/com/fraud/detection/client/BankServiceClient.java): `fraud-detection-service/src/main/java/com/fraud/detection/client/BankServiceClient.java`

### Banking and notifications

- [Bank account service](https://github.com/thillainirmal-tech/sentinelpay/blob/main/bank-service/src/main/java/com/fraud/bank/service/BankService.java): `bank-service/src/main/java/com/fraud/bank/service/BankService.java`
- [Account and ledger](https://github.com/thillainirmal-tech/sentinelpay/blob/main/bank-service/src/main/java/com/fraud/bank/entity/BankAccount.java): `bank-service/src/main/java/com/fraud/bank/entity/BankAccount.java`
- [Alert publisher](https://github.com/thillainirmal-tech/sentinelpay/blob/main/fraud-detection-service/src/main/java/com/fraud/detection/producer/NotificationProducer.java): `fraud-detection-service/src/main/java/com/fraud/detection/producer/NotificationProducer.java`
- [Notification consumer](https://github.com/thillainirmal-tech/sentinelpay/blob/main/notification-service/src/main/java/com/fraud/notification/consumer/NotificationConsumer.java): `notification-service/src/main/java/com/fraud/notification/consumer/NotificationConsumer.java`
- [Email delivery](https://github.com/thillainirmal-tech/sentinelpay/blob/main/notification-service/src/main/java/com/fraud/notification/service/EmailService.java): `notification-service/src/main/java/com/fraud/notification/service/EmailService.java`

### Other components

- **Customer**
- **Email provider**

## Connections

- Customer → React dashboard: uses (evidence: `README.md`)
- React dashboard → API gateway: sends requests
- React dashboard → Dashboard views: routes to (evidence: `sentinelpay-frontend/src/App.jsx`)
- React dashboard → Fraud alerts: routes to (evidence: `sentinelpay-frontend/src/App.jsx`)
- API gateway → Auth endpoints: routes requests (evidence: `README.md`)
- Auth endpoints → Auth and tokens: delegates to (evidence: `auth-service/src/main/java/com/fraud/auth/controller/AuthController.java`)
- Auth and tokens → User records: persists users (evidence: `auth-service/src/main/java/com/fraud/auth/service/AuthService.java`)
- Auth and tokens → Bank account service: creates account (evidence: `auth-service/src/main/java/com/fraud/auth/service/AuthService.java`)
- Customer → Transaction intake: submits payment (evidence: `README.md`)
- Transaction intake → Transaction event: builds event (evidence: `transaction-service/src/main/java/com/fraud/transaction/service/UpiPaymentService.java`)
- Transaction intake → Kafka event backbone: publishes event (evidence: `transaction-service/src/main/java/com/fraud/transaction/service/UpiPaymentService.java`)
- Kafka event backbone → Transaction consumer: delivers events (evidence: `README.md`)
- Transaction consumer → Fraud verdict engine: analyzes transaction
- Fraud verdict engine → Rule configuration: uses thresholds (evidence: `fraud-detection-service/src/main/java/com/fraud/detection/service/FraudDetectionService.java`)
- Fraud verdict engine → Behavior history: evaluates history (evidence: `fraud-detection-service/src/main/java/com/fraud/detection/service/FraudDetectionService.java`)
- Fraud verdict engine → Redis risk state: reads and writes (evidence: `fraud-detection-service/src/main/java/com/fraud/detection/service/FraudDetectionService.java`)
- Fraud verdict engine → AI analysis: requests analysis (evidence: `fraud-detection-service/src/main/java/com/fraud/detection/service/FraudDetectionService.java`)
- Fraud verdict engine → Payment processor: gates payment
- Payment processor → Redis risk state: checks and stores (evidence: `fraud-detection-service/src/main/java/com/fraud/detection/payment/PaymentProcessorService.java`)
- Payment processor → Bank service client: requests money movement (evidence: `fraud-detection-service/src/main/java/com/fraud/detection/payment/PaymentProcessorService.java`)
- Bank service client → Bank account service: calls bank API
- Payment processor → Razorpay integration: creates order (evidence: `fraud-detection-service/src/main/java/com/fraud/detection/payment/PaymentProcessorService.java`)
- Bank account service → Account and ledger: persists balances (evidence: `bank-service/src/main/java/com/fraud/bank/service/BankService.java`)
- Payment processor → Alert publisher: publishes alerts (evidence: `fraud-detection-service/src/main/java/com/fraud/detection/payment/PaymentProcessorService.java`)
- Alert publisher → Notification consumer: sends events
- Notification consumer → Email delivery: dispatches email
- Email delivery → Email provider: sends mail
