# gantechproject/saie architecture

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

- Interactive diagram: https://gitdiagram.com/gantechproject/saie
- Repository: https://github.com/gantechproject/saie

## Overview

SAIE monitors SAP sources, turns changes into evidence-backed findings and ranked automation opportunities, and presents them in a dashboard and scheduled executive reports. The documented workflow spans discovery, crawling, analysis, scoring, reporting, delivery, governance, and retention. The tree and excerpts support the dashboard, API, persistence, LLM, scheduling, and delivery components; the detailed implementations of several agent stages were not sampled, so their internal wiring is shown only where documented.

Main entry points: [`prisma/schema.prisma`](https://github.com/gantechproject/saie/blob/master/prisma/schema.prisma) (Application database), [`agent-scheduler.ts`](https://github.com/gantechproject/saie/blob/master/agent-scheduler.ts) (Content analysis), [`src/App.tsx`](https://github.com/gantechproject/saie/blob/master/src/App.tsx) (Dashboard), [`custom-routes.ts`](https://github.com/gantechproject/saie/blob/master/custom-routes.ts) (API routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_product["Dashboard"]
  node_dashboard["Dashboard<br/>[App.tsx]"]
  node_login["Login<br/>[LoginPage.tsx]"]
  node_architecture_view["Architecture viewer<br/>[App.tsx]"]
end

subgraph group_backend["API and agents"]
  node_backend_server["HTTP server<br/>[server-node.ts]"]
  node_api_routes["API routes<br/>[custom-routes.ts]"]
  node_scheduler["Agent scheduler<br/>[agent-scheduler.ts]"]
end

subgraph group_intelligence["Analysis and reporting"]
  node_crawl["Source crawling<br/>[agent-scheduler.ts]"]
  node_analysis["Content analysis<br/>[agent-scheduler.ts]"]
  node_llm["LLM client<br/>[llm-client.ts]"]
  node_scoring["Opportunity scoring<br/>[custom-routes.ts]"]
  node_reporting["Report generation<br/>[agent-scheduler.ts]"]
  node_delivery["Report delivery<br/>[report-delivery.ts]"]
end

subgraph group_operations["Data and operations"]
  node_database[("Application database<br/>[schema.prisma]")]
  node_db_client["Database client<br/>[db.ts]"]
  node_retention["Data retention<br/>[data-retention.ts]"]
  node_governance["Governance and audit<br/>[custom-routes.ts]"]
end

node_decision_maker(("Decision maker"))
node_sap_sources["SAP sources"]
node_delivery_channels["Delivery channels"]

node_decision_maker -->|"signs in"| node_login
node_login -->|"submits credentials"| node_backend_server
node_decision_maker -->|"uses"| node_dashboard
node_dashboard -->|"requests data"| node_backend_server
node_backend_server -->|"dispatches requests"| node_api_routes
node_api_routes -->|"queries and updates"| node_db_client
node_db_client -->|"reads and writes"| node_database
node_scheduler -->|"schedules"| node_crawl
node_crawl -->|"fetches pages"| node_sap_sources
node_crawl -->|"stores crawl data"| node_database
node_analysis -->|"reads crawl data"| node_database
node_analysis -.->|"enriches findings"| node_llm
node_analysis -->|"stores findings"| node_database
node_scoring -->|"reads and records scores"| node_database
node_scheduler -->|"schedules reports"| node_reporting
node_reporting -->|"reads report data"| node_database
node_reporting -->|"provides report"| node_delivery
node_delivery -->|"sends or exports"| node_delivery_channels
node_retention -->|"archives and purges"| node_database
node_api_routes -->|"serves governance"| node_governance
node_dashboard -->|"displays diagrams"| node_architecture_view

click node_dashboard "https://github.com/gantechproject/saie/blob/master/src/App.tsx"
click node_login "https://github.com/gantechproject/saie/blob/master/src/components/LoginPage.tsx"
click node_backend_server "https://github.com/gantechproject/saie/blob/master/server-node.ts"
click node_api_routes "https://github.com/gantechproject/saie/blob/master/custom-routes.ts"
click node_scheduler "https://github.com/gantechproject/saie/blob/master/agent-scheduler.ts"
click node_crawl "https://github.com/gantechproject/saie/blob/master/agent-scheduler.ts"
click node_analysis "https://github.com/gantechproject/saie/blob/master/agent-scheduler.ts"
click node_llm "https://github.com/gantechproject/saie/blob/master/llm-client.ts"
click node_scoring "https://github.com/gantechproject/saie/blob/master/custom-routes.ts"
click node_reporting "https://github.com/gantechproject/saie/blob/master/agent-scheduler.ts"
click node_delivery "https://github.com/gantechproject/saie/blob/master/report-delivery.ts"
click node_database "https://github.com/gantechproject/saie/blob/master/prisma/schema.prisma"
click node_db_client "https://github.com/gantechproject/saie/blob/master/src/lib/db.ts"
click node_retention "https://github.com/gantechproject/saie/blob/master/data-retention.ts"
click node_governance "https://github.com/gantechproject/saie/blob/master/custom-routes.ts"
click node_architecture_view "https://github.com/gantechproject/saie/blob/master/src/App.tsx"

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_dashboard,node_login,node_architecture_view toneBlue
class node_backend_server,node_api_routes,node_scheduler toneAmber
class node_crawl,node_analysis,node_llm,node_scoring,node_reporting,node_delivery toneMint
class node_database,node_db_client,node_retention,node_governance toneRose
class node_decision_maker,node_sap_sources,node_delivery_channels toneIndigo
```

## Components

### Dashboard

- [Dashboard](https://github.com/gantechproject/saie/blob/master/src/App.tsx): `src/App.tsx`
- [Login](https://github.com/gantechproject/saie/blob/master/src/components/LoginPage.tsx): `src/components/LoginPage.tsx`
- [Architecture viewer](https://github.com/gantechproject/saie/blob/master/src/App.tsx): `src/App.tsx`

### API and agents

- [HTTP server](https://github.com/gantechproject/saie/blob/master/server-node.ts): `server-node.ts`
- [API routes](https://github.com/gantechproject/saie/blob/master/custom-routes.ts): `custom-routes.ts`
- [Agent scheduler](https://github.com/gantechproject/saie/blob/master/agent-scheduler.ts): `agent-scheduler.ts`

### Analysis and reporting

- [Source crawling](https://github.com/gantechproject/saie/blob/master/agent-scheduler.ts): `agent-scheduler.ts`
- [Content analysis](https://github.com/gantechproject/saie/blob/master/agent-scheduler.ts): `agent-scheduler.ts`
- [LLM client](https://github.com/gantechproject/saie/blob/master/llm-client.ts): `llm-client.ts`
- [Opportunity scoring](https://github.com/gantechproject/saie/blob/master/custom-routes.ts): `custom-routes.ts`
- [Report generation](https://github.com/gantechproject/saie/blob/master/agent-scheduler.ts): `agent-scheduler.ts`
- [Report delivery](https://github.com/gantechproject/saie/blob/master/report-delivery.ts): `report-delivery.ts`

### Data and operations

- [Application database](https://github.com/gantechproject/saie/blob/master/prisma/schema.prisma): `prisma/schema.prisma`
- [Database client](https://github.com/gantechproject/saie/blob/master/src/lib/db.ts): `src/lib/db.ts`
- [Data retention](https://github.com/gantechproject/saie/blob/master/data-retention.ts): `data-retention.ts`
- [Governance and audit](https://github.com/gantechproject/saie/blob/master/custom-routes.ts): `custom-routes.ts`

### Other components

- **Decision maker**
- **SAP sources**
- **Delivery channels**

## Connections

- Decision maker → Login: signs in
- Login → HTTP server: submits credentials
- Decision maker → Dashboard: uses
- Dashboard → HTTP server: requests data
- HTTP server → API routes: dispatches requests
- API routes → Database client: queries and updates
- Database client → Application database: reads and writes
- Agent scheduler → Source crawling: schedules
- Source crawling → SAP sources: fetches pages
- Source crawling → Application database: stores crawl data
- Content analysis → Application database: reads crawl data
- Content analysis → LLM client: enriches findings
- Content analysis → Application database: stores findings
- Opportunity scoring → Application database: reads and records scores
- Agent scheduler → Report generation: schedules reports
- Report generation → Application database: reads report data
- Report generation → Report delivery: provides report
- Report delivery → Delivery channels: sends or exports
- Data retention → Application database: archives and purges
- API routes → Governance and audit: serves governance
- Dashboard → Architecture viewer: displays diagrams
