# aymanelsayed-dev/trust architecture

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

- Interactive diagram: https://gitdiagram.com/aymanelsayed-dev/trust
- Repository: https://github.com/aymanelsayed-dev/trust

## Overview

TRUST-AI is documented as a security risk-management platform: users submit URL scans through a single backend, which obtains an AI prediction, applies risk scoring and role-based masking, records results and audit events, then returns role-appropriate results. The supplied tree contains only the API contract and no implementation excerpts, so this graph reflects README-documented architecture; implementation paths are left null where the tree provides none.

Main entry points: [`docs/api-contract.yaml`](https://github.com/aymanelsayed-dev/trust/blob/main/docs/api-contract.yaml) (API contract)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["API entry"]
  node_backend["ASP.NET Core API"]
  node_contract["API contract<br/>[api-contract.yaml]"]
end

subgraph group_assessment["Detection and assessment"]
  node_ai_service["URL detection"]
  node_risk_rules["Risk scoring"]
end

subgraph group_governance["Access and audit"]
  node_role_enforcement["Role enforcement"]
  node_masking["Privacy masking"]
  node_audit["Audit logging"]
end

subgraph group_state["Persistence"]
  node_database[("SQL Server")]
end

node_frontend(("Flutter app"))
node_security_team(("Security team"))

node_frontend -->|"calls API"| node_backend
node_security_team -->|"calls API"| node_backend
node_contract -->|"defines endpoints"| node_backend
node_backend -->|"requests prediction"| node_ai_service
node_backend -->|"applies scoring"| node_risk_rules
node_backend -->|"enforces roles"| node_role_enforcement
node_backend -->|"applies masking"| node_masking
node_backend -->|"records events"| node_audit
node_backend -->|"stores results"| node_database
node_backend -->|"returns results"| node_frontend
node_backend -->|"returns results"| node_security_team

click node_contract "https://github.com/aymanelsayed-dev/trust/blob/main/docs/api-contract.yaml"

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_backend,node_contract toneBlue
class node_ai_service,node_risk_rules toneAmber
class node_role_enforcement,node_masking,node_audit toneMint
class node_database toneRose
class node_frontend,node_security_team toneIndigo
```

## Components

### API entry

- **ASP.NET Core API**
- [API contract](https://github.com/aymanelsayed-dev/trust/blob/main/docs/api-contract.yaml): `docs/api-contract.yaml`

### Detection and assessment

- **URL detection**
- **Risk scoring**

### Access and audit

- **Role enforcement**
- **Privacy masking**
- **Audit logging**

### Persistence

- **SQL Server**

### Other components

- **Flutter app**
- **Security team**

## Connections

- Flutter app → ASP.NET Core API: calls API (evidence: `README.md`)
- Security team → ASP.NET Core API: calls API (evidence: `README.md`)
- API contract → ASP.NET Core API: defines endpoints (evidence: `README.md`)
- ASP.NET Core API → URL detection: requests prediction (evidence: `README.md`)
- ASP.NET Core API → Risk scoring: applies scoring (evidence: `README.md`)
- ASP.NET Core API → Role enforcement: enforces roles (evidence: `README.md`)
- ASP.NET Core API → Privacy masking: applies masking (evidence: `README.md`)
- ASP.NET Core API → Audit logging: records events (evidence: `README.md`)
- ASP.NET Core API → SQL Server: stores results (evidence: `README.md`)
- ASP.NET Core API → Flutter app: returns results (evidence: `README.md`)
- ASP.NET Core API → Security team: returns results (evidence: `README.md`)
