# manojsanthosh/trident-ai-genai-designathon architecture

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

- Interactive diagram: https://gitdiagram.com/manojsanthosh/trident-ai-genai-designathon
- Repository: https://github.com/manojsanthosh/trident-ai-genai-designathon

## Overview

ReAdmit Guard is a hospital readmission-risk and care-coordination API. Staff and patients use its HTTP endpoints to access role-appropriate patient information; the API supports risk assessment, AI-generated report drafts, clinician review, medications, interventions, appointments, and follow-up, alongside hospital and staff administration. The main sampled runtime entry point is the Express API, with Prisma-backed persistence and separate risk, AI, authorization, and patient-data sanitization modules. The excerpts show API-to-database operations and role checks, but omit most route bodies; links from the API to risk, AI, and sanitization are therefore marked unverified.

Main entry points: [`server/src/index.ts`](https://github.com/manojsanthosh/trident-ai-genai-designathon/blob/main/server/src/index.ts) (Express API routes), [`server/src/lib/prisma.ts`](https://github.com/manojsanthosh/trident-ai-genai-designathon/blob/main/server/src/lib/prisma.ts) (Prisma client), [`server/src/lib/auth.ts`](https://github.com/manojsanthosh/trident-ai-genai-designathon/blob/main/server/src/lib/auth.ts) (Authentication and roles), [`server/src/services/sanitize.ts`](https://github.com/manojsanthosh/trident-ai-genai-designathon/blob/main/server/src/services/sanitize.ts) (Patient data filtering)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API and Access"]
  node_api["Express API routes<br/>[index.ts]"]
  node_auth["Authentication and roles<br/>[auth.ts]"]
  node_sanitize["Patient data filtering<br/>[sanitize.ts]"]
end

subgraph group_care["Patient Care"]
end

subgraph group_analytics["Risk and Reports"]
  node_risk["Risk and LACE scoring<br/>[risk.ts]"]
  node_modelcard["Model metadata<br/>[modelCard.ts]"]
  node_reports["AI report drafts<br/>[gemini.ts]"]
end

subgraph group_platform["Persistence"]
  node_prisma["Prisma client<br/>[prisma.ts]"]
  node_db[("Application database<br/>[schema.prisma]")]
end

node_users(("API users"))

node_users -->|"send requests"| node_api
node_api -->|"checks roles"| node_auth
node_api -->|"queries and writes"| node_prisma
node_prisma -.->|"persists records"| node_db
node_api -.->|"uses scoring"| node_risk
node_api -.->|"requests drafts"| node_reports
node_api -.->|"filters patient data"| node_sanitize

click node_api "https://github.com/manojsanthosh/trident-ai-genai-designathon/blob/main/server/src/index.ts"
click node_auth "https://github.com/manojsanthosh/trident-ai-genai-designathon/blob/main/server/src/lib/auth.ts"
click node_sanitize "https://github.com/manojsanthosh/trident-ai-genai-designathon/blob/main/server/src/services/sanitize.ts"
click node_risk "https://github.com/manojsanthosh/trident-ai-genai-designathon/blob/main/server/src/services/risk.ts"
click node_modelcard "https://github.com/manojsanthosh/trident-ai-genai-designathon/blob/main/server/src/lib/modelCard.ts"
click node_reports "https://github.com/manojsanthosh/trident-ai-genai-designathon/blob/main/server/src/services/gemini.ts"
click node_prisma "https://github.com/manojsanthosh/trident-ai-genai-designathon/blob/main/server/src/lib/prisma.ts"
click node_db "https://github.com/manojsanthosh/trident-ai-genai-designathon/blob/main/server/prisma/schema.prisma"

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_api,node_auth,node_sanitize,node_users toneBlue
class node_risk,node_modelcard,node_reports toneMint
class node_prisma,node_db toneRose
```

## Components

### API and Access

- [Express API routes](https://github.com/manojsanthosh/trident-ai-genai-designathon/blob/main/server/src/index.ts): `server/src/index.ts`
- [Authentication and roles](https://github.com/manojsanthosh/trident-ai-genai-designathon/blob/main/server/src/lib/auth.ts): `server/src/lib/auth.ts`
- [Patient data filtering](https://github.com/manojsanthosh/trident-ai-genai-designathon/blob/main/server/src/services/sanitize.ts): `server/src/services/sanitize.ts`

### Risk and Reports

- [Risk and LACE scoring](https://github.com/manojsanthosh/trident-ai-genai-designathon/blob/main/server/src/services/risk.ts): `server/src/services/risk.ts`
- [Model metadata](https://github.com/manojsanthosh/trident-ai-genai-designathon/blob/main/server/src/lib/modelCard.ts): `server/src/lib/modelCard.ts`
- [AI report drafts](https://github.com/manojsanthosh/trident-ai-genai-designathon/blob/main/server/src/services/gemini.ts): `server/src/services/gemini.ts`

### Persistence

- [Prisma client](https://github.com/manojsanthosh/trident-ai-genai-designathon/blob/main/server/src/lib/prisma.ts): `server/src/lib/prisma.ts`
- [Application database](https://github.com/manojsanthosh/trident-ai-genai-designathon/blob/main/server/prisma/schema.prisma): `server/prisma/schema.prisma`

### Other components

- **API users**

## Connections

- API users → Express API routes: send requests (evidence: `server/src/index.ts`)
- Express API routes → Authentication and roles: checks roles (evidence: `server/src/index.ts`)
- Express API routes → Prisma client: queries and writes (evidence: `server/src/index.ts`)
- Prisma client → Application database: persists records
- Express API routes → Risk and LACE scoring: uses scoring (evidence: `server/src/index.ts`)
- Express API routes → AI report drafts: requests drafts (evidence: `server/src/index.ts`)
- Express API routes → Patient data filtering: filters patient data (evidence: `server/src/index.ts`)
