# ireneusrdx/consistency-guard-fix architecture

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

- Interactive diagram: https://gitdiagram.com/ireneusrdx/consistency-guard-fix
- Repository: https://github.com/ireneusrdx/consistency-guard-fix

## Overview

Consistency Guard is a multi-model AI reliability evaluation platform. Users authenticate, select providers/models, submit questions in an evaluation mode, then inspect repeat-run scores, conflicts, evidence and uncertainty. The client also supports benchmarks, adversarial tests, prompt intelligence, analytics, reports and account settings. The graph reflects documented workflow and sampled/indexed module relationships; several route and page implementations were not excerpted, so their internal calls are not inferred.

Main entry points: [`client/src/App.tsx`](https://github.com/ireneusrdx/consistency-guard-fix/blob/main/client/src/App.tsx) (React application), [`server/src/routes`](https://github.com/ireneusrdx/consistency-guard-fix/tree/main/server/src/routes) (REST API routes), [`server/src/engine/evaluation.ts`](https://github.com/ireneusrdx/consistency-guard-fix/blob/main/server/src/engine/evaluation.ts) (Evaluation orchestration), [`server/src/db.ts`](https://github.com/ireneusrdx/consistency-guard-fix/blob/main/server/src/db.ts) (Prisma data store)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client experience"]
  node_app["React application<br/>[App.tsx]"]
  node_ui["UI primitives<br/>[ui.tsx]"]
  node_apiclient["API client<br/>[api.ts]"]
end

subgraph group_identity["Accounts and security"]
  node_authui["Sign-in and registration<br/>[Auth.tsx]"]
  node_authstate["Session state<br/>[AuthContext.tsx]"]
  node_authroutes["Authentication routes<br/>[auth.ts]"]
  node_authmiddleware["JWT session check<br/>[auth.ts]"]
  node_settings["Account settings<br/>[settings.ts]"]
end

subgraph group_evaluation["Evaluation workflow"]
  node_evalpages["Evaluation pages"]
  node_benchmarkpages["Benchmark pages"]
  node_adversarialpage["Adversarial testing<br/>[Adversarial.tsx]"]
  node_promptpage["Prompt intelligence"]
  node_evaluationroute["Evaluation routes<br/>[evaluations.ts]"]
  node_benchmarkroute["Benchmark routes<br/>[benchmarks.ts]"]
  node_engine["Evaluation orchestration<br/>[evaluation.ts]"]
  node_analysis["Scoring and evidence"]
end

subgraph group_insights["Analysis and reporting"]
  node_analytics["Analytics and history"]
  node_reporting["Reports<br/>[reports.ts]"]
end

subgraph group_platform["Providers and persistence"]
  node_routes["REST API routes"]
  node_registry["Provider registry<br/>[registry.ts]"]
  node_pollinations["Pollinations adapter<br/>[pollinations.ts]"]
  node_database[("Prisma data store<br/>[db.ts]")]
end

node_user(("User"))
node_externalmodels{{"AI model providers"}}

node_user -->|"uses"| node_app
node_app -->|"routes to"| node_authui
node_app -->|"routes to"| node_evalpages
node_app -->|"routes to"| node_benchmarkpages
node_app -->|"routes to"| node_adversarialpage
node_app -->|"routes to"| node_promptpage
node_authui -->|"signs in through"| node_authstate
node_authstate -->|"calls auth API"| node_apiclient
node_app -->|"uses"| node_ui
node_apiclient -->|"sends REST requests"| node_routes
node_routes -->|"mounts"| node_authroutes
node_routes -->|"mounts"| node_evaluationroute
node_routes -->|"mounts"| node_benchmarkroute
node_routes -->|"mounts analytics routes"| node_analytics
node_routes -->|"mounts"| node_reporting
node_evaluationroute -->|"runs evaluation"| node_engine
node_benchmarkroute -->|"runs suite evaluations"| node_engine
node_engine -->|"calculates scores and evidence"| node_analysis
node_engine -->|"selects provider adapter"| node_registry
node_registry -->|"creates adapter"| node_pollinations
node_engine -->|"requests model runs"| node_externalmodels
node_pollinations -->|"calls provider"| node_externalmodels
node_engine -->|"persists evaluation data"| node_database
node_authroutes -->|"reads and writes accounts"| node_database
node_authroutes -->|"protects session routes"| node_authmiddleware
node_authmiddleware -->|"checks session"| node_database
node_analytics -.->|"reads evaluation history"| node_database
node_reporting -.->|"stores generated reports"| node_database
node_settings -.->|"stores preferences"| node_database

click node_app "https://github.com/ireneusrdx/consistency-guard-fix/blob/main/client/src/App.tsx"
click node_ui "https://github.com/ireneusrdx/consistency-guard-fix/blob/main/client/src/components/ui.tsx"
click node_authui "https://github.com/ireneusrdx/consistency-guard-fix/blob/main/client/src/pages/Auth.tsx"
click node_authstate "https://github.com/ireneusrdx/consistency-guard-fix/blob/main/client/src/context/AuthContext.tsx"
click node_apiclient "https://github.com/ireneusrdx/consistency-guard-fix/blob/main/client/src/lib/api.ts"
click node_evalpages "https://github.com/ireneusrdx/consistency-guard-fix/tree/main/client/src/pages"
click node_benchmarkpages "https://github.com/ireneusrdx/consistency-guard-fix/tree/main/client/src/pages"
click node_adversarialpage "https://github.com/ireneusrdx/consistency-guard-fix/blob/main/client/src/pages/Adversarial.tsx"
click node_promptpage "https://github.com/ireneusrdx/consistency-guard-fix/blob/main/client/src/pages/PromptIntelligence.tsx"
click node_authroutes "https://github.com/ireneusrdx/consistency-guard-fix/blob/main/server/src/routes/auth.ts"
click node_authmiddleware "https://github.com/ireneusrdx/consistency-guard-fix/blob/main/server/src/middleware/auth.ts"
click node_routes "https://github.com/ireneusrdx/consistency-guard-fix/tree/main/server/src/routes"
click node_evaluationroute "https://github.com/ireneusrdx/consistency-guard-fix/blob/main/server/src/routes/evaluations.ts"
click node_benchmarkroute "https://github.com/ireneusrdx/consistency-guard-fix/blob/main/server/src/routes/benchmarks.ts"
click node_engine "https://github.com/ireneusrdx/consistency-guard-fix/blob/main/server/src/engine/evaluation.ts"
click node_analysis "https://github.com/ireneusrdx/consistency-guard-fix/tree/main/server/src/engine"
click node_registry "https://github.com/ireneusrdx/consistency-guard-fix/blob/main/server/src/providers/registry.ts"
click node_pollinations "https://github.com/ireneusrdx/consistency-guard-fix/blob/main/server/src/providers/pollinations.ts"
click node_database "https://github.com/ireneusrdx/consistency-guard-fix/blob/main/server/src/db.ts"
click node_analytics "https://github.com/ireneusrdx/consistency-guard-fix/tree/main/server/src/routes"
click node_reporting "https://github.com/ireneusrdx/consistency-guard-fix/blob/main/server/src/routes/reports.ts"
click node_settings "https://github.com/ireneusrdx/consistency-guard-fix/blob/main/server/src/routes/settings.ts"

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_ui,node_apiclient,node_user toneBlue
class node_authui,node_authstate,node_authroutes,node_authmiddleware,node_settings toneAmber
class node_evalpages,node_benchmarkpages,node_adversarialpage,node_promptpage,node_evaluationroute,node_benchmarkroute,node_engine,node_analysis toneMint
class node_analytics,node_reporting toneRose
class node_routes,node_registry,node_pollinations,node_database,node_externalmodels toneIndigo
```

## Components

### Client experience

- [React application](https://github.com/ireneusrdx/consistency-guard-fix/blob/main/client/src/App.tsx): `client/src/App.tsx`
- [UI primitives](https://github.com/ireneusrdx/consistency-guard-fix/blob/main/client/src/components/ui.tsx): `client/src/components/ui.tsx`
- [API client](https://github.com/ireneusrdx/consistency-guard-fix/blob/main/client/src/lib/api.ts): `client/src/lib/api.ts`

### Accounts and security

- [Sign-in and registration](https://github.com/ireneusrdx/consistency-guard-fix/blob/main/client/src/pages/Auth.tsx): `client/src/pages/Auth.tsx`
- [Session state](https://github.com/ireneusrdx/consistency-guard-fix/blob/main/client/src/context/AuthContext.tsx): `client/src/context/AuthContext.tsx`
- [Authentication routes](https://github.com/ireneusrdx/consistency-guard-fix/blob/main/server/src/routes/auth.ts): `server/src/routes/auth.ts`
- [JWT session check](https://github.com/ireneusrdx/consistency-guard-fix/blob/main/server/src/middleware/auth.ts): `server/src/middleware/auth.ts`
- [Account settings](https://github.com/ireneusrdx/consistency-guard-fix/blob/main/server/src/routes/settings.ts): `server/src/routes/settings.ts`

### Evaluation workflow

- [Evaluation pages](https://github.com/ireneusrdx/consistency-guard-fix/tree/main/client/src/pages): `client/src/pages`
- [Benchmark pages](https://github.com/ireneusrdx/consistency-guard-fix/tree/main/client/src/pages): `client/src/pages`
- [Adversarial testing](https://github.com/ireneusrdx/consistency-guard-fix/blob/main/client/src/pages/Adversarial.tsx): `client/src/pages/Adversarial.tsx`
- [Prompt intelligence](https://github.com/ireneusrdx/consistency-guard-fix/blob/main/client/src/pages/PromptIntelligence.tsx): `client/src/pages/PromptIntelligence.tsx`
- [Evaluation routes](https://github.com/ireneusrdx/consistency-guard-fix/blob/main/server/src/routes/evaluations.ts): `server/src/routes/evaluations.ts`
- [Benchmark routes](https://github.com/ireneusrdx/consistency-guard-fix/blob/main/server/src/routes/benchmarks.ts): `server/src/routes/benchmarks.ts`
- [Evaluation orchestration](https://github.com/ireneusrdx/consistency-guard-fix/blob/main/server/src/engine/evaluation.ts): `server/src/engine/evaluation.ts`
- [Scoring and evidence](https://github.com/ireneusrdx/consistency-guard-fix/tree/main/server/src/engine): `server/src/engine`

### Analysis and reporting

- [Analytics and history](https://github.com/ireneusrdx/consistency-guard-fix/tree/main/server/src/routes): `server/src/routes`
- [Reports](https://github.com/ireneusrdx/consistency-guard-fix/blob/main/server/src/routes/reports.ts): `server/src/routes/reports.ts`

### Providers and persistence

- [REST API routes](https://github.com/ireneusrdx/consistency-guard-fix/tree/main/server/src/routes): `server/src/routes`
- [Provider registry](https://github.com/ireneusrdx/consistency-guard-fix/blob/main/server/src/providers/registry.ts): `server/src/providers/registry.ts`
- [Pollinations adapter](https://github.com/ireneusrdx/consistency-guard-fix/blob/main/server/src/providers/pollinations.ts): `server/src/providers/pollinations.ts`
- [Prisma data store](https://github.com/ireneusrdx/consistency-guard-fix/blob/main/server/src/db.ts): `server/src/db.ts`

### Other components

- **User**
- **AI model providers**

## Connections

- User → React application: uses (evidence: `README.md`)
- React application → Sign-in and registration: routes to (evidence: `client/src/App.tsx`)
- React application → Evaluation pages: routes to (evidence: `client/src/App.tsx`)
- React application → Benchmark pages: routes to (evidence: `client/src/App.tsx`)
- React application → Adversarial testing: routes to (evidence: `client/src/App.tsx`)
- React application → Prompt intelligence: routes to (evidence: `client/src/App.tsx`)
- Sign-in and registration → Session state: signs in through (evidence: `client/src/pages/Auth.tsx`)
- Session state → API client: calls auth API (evidence: `client/src/context/AuthContext.tsx`)
- React application → UI primitives: uses (evidence: `client/src/App.tsx`)
- API client → REST API routes: sends REST requests (evidence: `README.md`)
- REST API routes → Authentication routes: mounts (evidence: `server/src/index.ts`)
- REST API routes → Evaluation routes: mounts (evidence: `server/src/index.ts`)
- REST API routes → Benchmark routes: mounts (evidence: `server/src/index.ts`)
- REST API routes → Analytics and history: mounts analytics routes (evidence: `server/src/index.ts`)
- REST API routes → Reports: mounts (evidence: `server/src/index.ts`)
- Evaluation routes → Evaluation orchestration: runs evaluation (evidence: `README.md`)
- Benchmark routes → Evaluation orchestration: runs suite evaluations (evidence: `server/src/routes/benchmarks.ts`)
- Evaluation orchestration → Scoring and evidence: calculates scores and evidence (evidence: `server/src/engine/evaluation.ts`)
- Evaluation orchestration → Provider registry: selects provider adapter (evidence: `server/src/engine/evaluation.ts`)
- Provider registry → Pollinations adapter: creates adapter (evidence: `server/src/providers/registry.ts`)
- Evaluation orchestration → AI model providers: requests model runs (evidence: `README.md`)
- Pollinations adapter → AI model providers: calls provider (evidence: `README.md`)
- Evaluation orchestration → Prisma data store: persists evaluation data (evidence: `README.md`)
- Authentication routes → Prisma data store: reads and writes accounts (evidence: `server/src/routes/auth.ts`)
- Authentication routes → JWT session check: protects session routes (evidence: `server/src/routes/auth.ts`)
- JWT session check → Prisma data store: checks session (evidence: `server/src/middleware/auth.ts`)
- Analytics and history → Prisma data store: reads evaluation history (evidence: `server/src/routes/auth.ts`)
- Reports → Prisma data store: stores generated reports
- Account settings → Prisma data store: stores preferences
