# didenamine/trust_ai architecture

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

- Interactive diagram: https://gitdiagram.com/didenamine/trust_ai
- Repository: https://github.com/didenamine/trust_ai

## Overview

TrustAI is presented as a web app for analyzing CVs and job offers, scoring compatibility, and explaining the score. The implemented workflow visible here is narrower: a visitor opens the React app, its home page checks the backend health endpoint, and the API returns health status. The sampled code shows app setup, routing, configuration, and database-session infrastructure, but no CV-analysis or matching implementation. Those advertised capabilities should not be read as implemented runtime stages. The graph reflects only relationships supported by excerpts or the README; database use by routes and AI integrations are not shown.

Main entry points: [`frontend/src/App.tsx`](https://github.com/didenamine/trust_ai/blob/main/frontend/src/App.tsx) (App routes), [`frontend/src/main.tsx`](https://github.com/didenamine/trust_ai/blob/main/frontend/src/main.tsx) (Web entry), [`frontend/src/pages/HomePage.tsx`](https://github.com/didenamine/trust_ai/blob/main/frontend/src/pages/HomePage.tsx) (Home page), [`backend/app/main.py`](https://github.com/didenamine/trust_ai/blob/main/backend/app/main.py) (API app)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web client"]
  node_web_entry["Web entry<br/>[main.tsx]"]
  node_app_routes["App routes<br/>[App.tsx]"]
  node_layout["Page layout<br/>[Layout.tsx]"]
  node_home["Home page<br/>[HomePage.tsx]"]
  node_not_found["Not found<br/>[NotFoundPage.tsx]"]
  node_query_cache["Query client<br/>[queryClient.ts]"]
  node_api_client["API client<br/>[api.ts]"]
end

subgraph group_api["API service"]
  node_backend_app["API app<br/>[main.py]"]
  node_api_router["API router<br/>[router.py]"]
  node_health_route["Health route<br/>[health.py]"]
end

subgraph group_infra["Configuration and data"]
  node_settings["Settings<br/>[config.py]"]
  node_db_session["DB session<br/>[session.py]"]
end

node_visitor(("Visitor"))
node_postgres[("PostgreSQL")]

node_visitor -.->|"opens"| node_web_entry
node_web_entry -->|"renders"| node_app_routes
node_web_entry -->|"provides"| node_query_cache
node_app_routes -->|"wraps pages"| node_layout
node_app_routes -->|"routes to"| node_home
node_app_routes -->|"routes to"| node_not_found
node_home -->|"calls"| node_api_client
node_home -->|"requests health"| node_health_route
node_backend_app -->|"loads"| node_settings
node_backend_app -->|"mounts"| node_api_router
node_api_router -->|"registers"| node_health_route
node_db_session -->|"loads"| node_settings
node_db_session -->|"connects to"| node_postgres

click node_web_entry "https://github.com/didenamine/trust_ai/blob/main/frontend/src/main.tsx"
click node_app_routes "https://github.com/didenamine/trust_ai/blob/main/frontend/src/App.tsx"
click node_layout "https://github.com/didenamine/trust_ai/blob/main/frontend/src/components/Layout.tsx"
click node_home "https://github.com/didenamine/trust_ai/blob/main/frontend/src/pages/HomePage.tsx"
click node_not_found "https://github.com/didenamine/trust_ai/blob/main/frontend/src/pages/NotFoundPage.tsx"
click node_query_cache "https://github.com/didenamine/trust_ai/blob/main/frontend/src/lib/queryClient.ts"
click node_api_client "https://github.com/didenamine/trust_ai/blob/main/frontend/src/lib/api.ts"
click node_backend_app "https://github.com/didenamine/trust_ai/blob/main/backend/app/main.py"
click node_api_router "https://github.com/didenamine/trust_ai/blob/main/backend/app/api/router.py"
click node_health_route "https://github.com/didenamine/trust_ai/blob/main/backend/app/api/routes/health.py"
click node_settings "https://github.com/didenamine/trust_ai/blob/main/backend/app/core/config.py"
click node_db_session "https://github.com/didenamine/trust_ai/blob/main/backend/app/db/session.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_web_entry,node_app_routes,node_layout,node_home,node_not_found,node_query_cache,node_api_client toneBlue
class node_backend_app,node_api_router,node_health_route,node_postgres toneAmber
class node_settings,node_db_session toneMint
class node_visitor toneIndigo
```

## Components

### Web client

- [Web entry](https://github.com/didenamine/trust_ai/blob/main/frontend/src/main.tsx): `frontend/src/main.tsx`
- [App routes](https://github.com/didenamine/trust_ai/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Page layout](https://github.com/didenamine/trust_ai/blob/main/frontend/src/components/Layout.tsx): `frontend/src/components/Layout.tsx`
- [Home page](https://github.com/didenamine/trust_ai/blob/main/frontend/src/pages/HomePage.tsx): `frontend/src/pages/HomePage.tsx`
- [Not found](https://github.com/didenamine/trust_ai/blob/main/frontend/src/pages/NotFoundPage.tsx): `frontend/src/pages/NotFoundPage.tsx`
- [Query client](https://github.com/didenamine/trust_ai/blob/main/frontend/src/lib/queryClient.ts): `frontend/src/lib/queryClient.ts`
- [API client](https://github.com/didenamine/trust_ai/blob/main/frontend/src/lib/api.ts): `frontend/src/lib/api.ts`

### API service

- [API app](https://github.com/didenamine/trust_ai/blob/main/backend/app/main.py): `backend/app/main.py`
- [API router](https://github.com/didenamine/trust_ai/blob/main/backend/app/api/router.py): `backend/app/api/router.py`
- [Health route](https://github.com/didenamine/trust_ai/blob/main/backend/app/api/routes/health.py): `backend/app/api/routes/health.py`

### Configuration and data

- [Settings](https://github.com/didenamine/trust_ai/blob/main/backend/app/core/config.py): `backend/app/core/config.py`
- [DB session](https://github.com/didenamine/trust_ai/blob/main/backend/app/db/session.py): `backend/app/db/session.py`

### Other components

- **Visitor**
- **PostgreSQL**

## Connections

- Visitor → Web entry: opens
- Web entry → App routes: renders (evidence: `frontend/src/main.tsx`)
- Web entry → Query client: provides (evidence: `frontend/src/main.tsx`)
- App routes → Page layout: wraps pages (evidence: `frontend/src/App.tsx`)
- App routes → Home page: routes to (evidence: `frontend/src/App.tsx`)
- App routes → Not found: routes to (evidence: `frontend/src/App.tsx`)
- Home page → API client: calls (evidence: `frontend/src/pages/HomePage.tsx`)
- Home page → Health route: requests health (evidence: `frontend/src/pages/HomePage.tsx`)
- API app → Settings: loads (evidence: `backend/app/main.py`)
- API app → API router: mounts (evidence: `backend/app/main.py`)
- API router → Health route: registers (evidence: `backend/app/api/router.py`)
- DB session → Settings: loads (evidence: `backend/app/db/session.py`)
- DB session → PostgreSQL: connects to (evidence: `backend/app/db/session.py`)
