# arayikgevorgyan/aml_system architecture

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

- Interactive diagram: https://gitdiagram.com/arayikgevorgyan/aml_system
- Repository: https://github.com/arayikgevorgyan/aml_system

## Overview

This is an AML transaction-monitoring platform: analysts and supervisors use a React interface to manage customers and transactions, review detection alerts, investigate cases, and support SAR reporting. The FastAPI backend exposes the product’s operational modules, with SQLite-backed records and separate rule, sanctions, analysis, and ML capabilities. The README documents the major domain stages; sampled code confirms application routing, authentication, audit logging, database setup, and frontend API behavior. Some feature-level connections rely on README documentation because their implementation files were not sampled.

Main entry points: [`backend/routers`](https://github.com/arayikgevorgyan/aml_system/tree/main/backend/routers) (Domain API routes), [`frontend/src/App.js`](https://github.com/arayikgevorgyan/aml_system/blob/main/frontend/src/App.js) (React application), [`backend/main.py`](https://github.com/arayikgevorgyan/aml_system/blob/main/backend/main.py) (FastAPI application), [`frontend/src/api/client.js`](https://github.com/arayikgevorgyan/aml_system/blob/main/frontend/src/api/client.js) (API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Analyst interface"]
  node_react["React application<br/>[App.js]"]
  node_customerui["Customer workspace<br/>[Customers.js]"]
  node_sanctionsui["Sanctions workspace<br/>[Sanctions.js]"]
  node_otherui["Operations workspaces"]
  node_apiclient["API client<br/>[client.js]"]
end

subgraph group_api["Application API"]
  node_app["FastAPI application<br/>[main.py]"]
  node_authroute["Authentication routes<br/>[auth.py]"]
  node_domainroutes["Domain API routes"]
end

subgraph group_monitoring["Monitoring and screening"]
  node_transaction["Transaction monitoring"]
  node_rules["AML rules engine<br/>[rules_engine.py]"]
  node_sanctions["Sanctions screening"]
  node_riskml["Risk and ML analysis"]
end

subgraph group_investigation["Investigation and reporting"]
  node_alerts["Alerts<br/>[alert_service.py]"]
  node_cases["Cases and SAR<br/>[case_service.py]"]
  node_reports["Compliance reporting"]
  node_audit["Audit trail<br/>[audit_service.py]"]
end

subgraph group_platform["Platform foundations"]
  node_database[("SQLite database<br/>[database.py]")]
  node_authservice["Authentication service<br/>[auth_service.py]"]
  node_user["User records<br/>[user.py]"]
end

node_analyst(("AML analyst"))

node_analyst -->|"uses"| node_react
node_react -->|"routes to"| node_customerui
node_react -->|"routes to"| node_sanctionsui
node_react -->|"routes to"| node_otherui
node_customerui -->|"calls"| node_apiclient
node_sanctionsui -.->|"calls"| node_apiclient
node_otherui -.->|"calls"| node_apiclient
node_apiclient -->|"HTTP requests"| node_app
node_app -->|"registers"| node_authroute
node_app -->|"registers"| node_domainroutes
node_authroute -->|"calls"| node_authservice
node_authservice -->|"reads and writes"| node_user
node_authservice -->|"logs actions"| node_audit
node_app -->|"creates tables"| node_database
node_domainroutes -.->|"submits transactions"| node_transaction
node_transaction -->|"evaluates rules"| node_rules
node_transaction -->|"scores risk"| node_riskml
node_rules -->|"generates alerts"| node_alerts
node_domainroutes -->|"screens names"| node_sanctions
node_domainroutes -->|"manages investigations"| node_cases
node_cases -->|"supports SAR filing"| node_reports
node_domainroutes -->|"provides reports"| node_reports
node_reports -->|"queries records"| node_database
node_alerts -.->|"stores alerts"| node_database
node_cases -.->|"stores cases"| node_database

click node_react "https://github.com/arayikgevorgyan/aml_system/blob/main/frontend/src/App.js"
click node_customerui "https://github.com/arayikgevorgyan/aml_system/blob/main/frontend/src/pages/Customers.js"
click node_sanctionsui "https://github.com/arayikgevorgyan/aml_system/blob/main/frontend/src/pages/Sanctions.js"
click node_otherui "https://github.com/arayikgevorgyan/aml_system/tree/main/frontend/src/pages"
click node_apiclient "https://github.com/arayikgevorgyan/aml_system/blob/main/frontend/src/api/client.js"
click node_app "https://github.com/arayikgevorgyan/aml_system/blob/main/backend/main.py"
click node_authroute "https://github.com/arayikgevorgyan/aml_system/blob/main/backend/routers/auth.py"
click node_domainroutes "https://github.com/arayikgevorgyan/aml_system/tree/main/backend/routers"
click node_transaction "https://github.com/arayikgevorgyan/aml_system/blob/main/backend/services/transaction_service.py"
click node_rules "https://github.com/arayikgevorgyan/aml_system/blob/main/backend/services/rules_engine.py"
click node_sanctions "https://github.com/arayikgevorgyan/aml_system/blob/main/backend/services/sanctions_screener.py"
click node_riskml "https://github.com/arayikgevorgyan/aml_system/tree/main/backend/ml"
click node_alerts "https://github.com/arayikgevorgyan/aml_system/blob/main/backend/services/alert_service.py"
click node_cases "https://github.com/arayikgevorgyan/aml_system/blob/main/backend/services/case_service.py"
click node_reports "https://github.com/arayikgevorgyan/aml_system/tree/main/backend/reports"
click node_audit "https://github.com/arayikgevorgyan/aml_system/blob/main/backend/services/audit_service.py"
click node_database "https://github.com/arayikgevorgyan/aml_system/blob/main/backend/database.py"
click node_authservice "https://github.com/arayikgevorgyan/aml_system/blob/main/backend/services/auth_service.py"
click node_user "https://github.com/arayikgevorgyan/aml_system/blob/main/backend/models/user.py"

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_react,node_customerui,node_sanctionsui,node_otherui,node_apiclient toneBlue
class node_app,node_authroute,node_domainroutes toneAmber
class node_transaction,node_rules,node_sanctions,node_riskml toneMint
class node_alerts,node_cases,node_reports,node_audit toneRose
class node_database,node_authservice,node_user,node_analyst toneIndigo
```

## Components

### Analyst interface

- [React application](https://github.com/arayikgevorgyan/aml_system/blob/main/frontend/src/App.js): `frontend/src/App.js`
- [Customer workspace](https://github.com/arayikgevorgyan/aml_system/blob/main/frontend/src/pages/Customers.js): `frontend/src/pages/Customers.js`
- [Sanctions workspace](https://github.com/arayikgevorgyan/aml_system/blob/main/frontend/src/pages/Sanctions.js): `frontend/src/pages/Sanctions.js`
- [Operations workspaces](https://github.com/arayikgevorgyan/aml_system/tree/main/frontend/src/pages): `frontend/src/pages`
- [API client](https://github.com/arayikgevorgyan/aml_system/blob/main/frontend/src/api/client.js): `frontend/src/api/client.js`

### Application API

- [FastAPI application](https://github.com/arayikgevorgyan/aml_system/blob/main/backend/main.py): `backend/main.py`
- [Authentication routes](https://github.com/arayikgevorgyan/aml_system/blob/main/backend/routers/auth.py): `backend/routers/auth.py`
- [Domain API routes](https://github.com/arayikgevorgyan/aml_system/tree/main/backend/routers): `backend/routers`

### Monitoring and screening

- [Transaction monitoring](https://github.com/arayikgevorgyan/aml_system/blob/main/backend/services/transaction_service.py): `backend/services/transaction_service.py`
- [AML rules engine](https://github.com/arayikgevorgyan/aml_system/blob/main/backend/services/rules_engine.py): `backend/services/rules_engine.py`
- [Sanctions screening](https://github.com/arayikgevorgyan/aml_system/blob/main/backend/services/sanctions_screener.py): `backend/services/sanctions_screener.py`
- [Risk and ML analysis](https://github.com/arayikgevorgyan/aml_system/tree/main/backend/ml): `backend/ml`

### Investigation and reporting

- [Alerts](https://github.com/arayikgevorgyan/aml_system/blob/main/backend/services/alert_service.py): `backend/services/alert_service.py`
- [Cases and SAR](https://github.com/arayikgevorgyan/aml_system/blob/main/backend/services/case_service.py): `backend/services/case_service.py`
- [Compliance reporting](https://github.com/arayikgevorgyan/aml_system/tree/main/backend/reports): `backend/reports`
- [Audit trail](https://github.com/arayikgevorgyan/aml_system/blob/main/backend/services/audit_service.py): `backend/services/audit_service.py`

### Platform foundations

- [SQLite database](https://github.com/arayikgevorgyan/aml_system/blob/main/backend/database.py): `backend/database.py`
- [Authentication service](https://github.com/arayikgevorgyan/aml_system/blob/main/backend/services/auth_service.py): `backend/services/auth_service.py`
- [User records](https://github.com/arayikgevorgyan/aml_system/blob/main/backend/models/user.py): `backend/models/user.py`

### Other components

- **AML analyst**

## Connections

- AML analyst → React application: uses (evidence: `README.md`)
- React application → Customer workspace: routes to (evidence: `frontend/src/App.js`)
- React application → Sanctions workspace: routes to (evidence: `frontend/src/App.js`)
- React application → Operations workspaces: routes to (evidence: `frontend/src/App.js`)
- Customer workspace → API client: calls (evidence: `frontend/src/pages/Customers.js`)
- Sanctions workspace → API client: calls
- Operations workspaces → API client: calls (evidence: `frontend/src/pages/Sessions.js`)
- API client → FastAPI application: HTTP requests (evidence: `README.md`)
- FastAPI application → Authentication routes: registers (evidence: `backend/main.py`)
- FastAPI application → Domain API routes: registers (evidence: `backend/main.py`)
- Authentication routes → Authentication service: calls (evidence: `backend/routers/auth.py`)
- Authentication service → User records: reads and writes (evidence: `backend/services/auth_service.py`)
- Authentication service → Audit trail: logs actions (evidence: `backend/services/auth_service.py`)
- FastAPI application → SQLite database: creates tables (evidence: `backend/main.py`)
- Domain API routes → Transaction monitoring: submits transactions
- Transaction monitoring → AML rules engine: evaluates rules (evidence: `README.md`)
- Transaction monitoring → Risk and ML analysis: scores risk (evidence: `README.md`)
- AML rules engine → Alerts: generates alerts (evidence: `README.md`)
- Domain API routes → Sanctions screening: screens names (evidence: `README.md`)
- Domain API routes → Cases and SAR: manages investigations (evidence: `README.md`)
- Cases and SAR → Compliance reporting: supports SAR filing (evidence: `README.md`)
- Domain API routes → Compliance reporting: provides reports (evidence: `README.md`)
- Compliance reporting → SQLite database: queries records (evidence: `backend/reports/compliance_report.py`)
- Alerts → SQLite database: stores alerts
- Cases and SAR → SQLite database: stores cases
