# akbar3776/capstone-asah2026-cs302 architecture

> Architecture diagram of the GitHub repository akbar3776/capstone-asah2026-cs302, 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/akbar3776/capstone-asah2026-cs302
- Repository: https://github.com/akbar3776/capstone-asah2026-cs302

## Overview

Gymnasyum Smart Reminder & Follow-up is a prototype admin web app for managing customers, sessions, participants, reminders and follow-up. Admins use the web panel; the documented deployment routes API requests through the backend, which persists data and calls the AI service for priority prediction and Indonesian draft generation. WhatsApp delivery remains manual. The README documents capabilities beyond the sampled scaffold, so those are shown at subsystem level; unsampled internal call paths are not inferred.

Main entry points: [`backend/src/app.ts`](https://github.com/akbar3776/capstone-asah2026-cs302/blob/main/backend/src/app.ts) (Backend API), [`ai-service/app/main.py`](https://github.com/akbar3776/capstone-asah2026-cs302/blob/main/ai-service/app/main.py) (AI service API), [`ai-service`](https://github.com/akbar3776/capstone-asah2026-cs302/tree/main/ai-service) (Message drafts), [`web/src/App.tsx`](https://github.com/akbar3776/capstone-asah2026-cs302/blob/main/web/src/App.tsx) (Admin panel)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Admin interface"]
  node_webapp["Admin panel<br/>[App.tsx]"]
end

subgraph group_backend["Backend and data"]
  node_backendapi["Backend API<br/>[app.ts]"]
  node_customers["Customer management"]
  node_sessions["Sessions and classes"]
  node_participants["Participants"]
  node_followup["Follow-up status"]
  node_database[("PostgreSQL<br/>[schema.prisma]")]
end

subgraph group_ai["AI capabilities"]
  node_ai_service["AI service API<br/>[main.py]"]
  node_priority["Priority prediction"]
  node_draft["Message drafts"]
  node_gemini["Gemini API"]
  node_fallback["Template fallback"]
end

subgraph group_ml["Offline ML"]
  node_mlwork["Offline ML workflow"]
end

node_admin(("Admin"))
node_whatsapp["WhatsApp delivery"]

node_admin -->|"uses"| node_webapp
node_webapp -->|"requests API"| node_backendapi
node_backendapi -->|"persists data"| node_database
node_backendapi -->|"calls securely"| node_ai_service
node_ai_service -->|"serves prediction"| node_priority
node_ai_service -->|"serves drafts"| node_draft
node_draft -->|"generates with"| node_gemini
node_draft -->|"falls back to"| node_fallback
node_admin -->|"sends manually"| node_whatsapp

click node_webapp "https://github.com/akbar3776/capstone-asah2026-cs302/blob/main/web/src/App.tsx"
click node_backendapi "https://github.com/akbar3776/capstone-asah2026-cs302/blob/main/backend/src/app.ts"
click node_customers "https://github.com/akbar3776/capstone-asah2026-cs302/tree/main/backend/src"
click node_sessions "https://github.com/akbar3776/capstone-asah2026-cs302/tree/main/backend/src"
click node_participants "https://github.com/akbar3776/capstone-asah2026-cs302/tree/main/backend/src"
click node_followup "https://github.com/akbar3776/capstone-asah2026-cs302/tree/main/backend/src"
click node_database "https://github.com/akbar3776/capstone-asah2026-cs302/blob/main/backend/prisma/schema.prisma"
click node_ai_service "https://github.com/akbar3776/capstone-asah2026-cs302/blob/main/ai-service/app/main.py"
click node_priority "https://github.com/akbar3776/capstone-asah2026-cs302/tree/main/ai-service"
click node_draft "https://github.com/akbar3776/capstone-asah2026-cs302/tree/main/ai-service"
click node_fallback "https://github.com/akbar3776/capstone-asah2026-cs302/tree/main/ai-service"
click node_mlwork "https://github.com/akbar3776/capstone-asah2026-cs302/tree/main/ml"

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_webapp toneBlue
class node_backendapi,node_customers,node_sessions,node_participants,node_followup,node_database toneAmber
class node_ai_service,node_priority,node_draft,node_gemini,node_fallback toneMint
class node_mlwork toneRose
class node_admin,node_whatsapp toneIndigo
```

## Components

### Admin interface

- [Admin panel](https://github.com/akbar3776/capstone-asah2026-cs302/blob/main/web/src/App.tsx): `web/src/App.tsx`

### Backend and data

- [Backend API](https://github.com/akbar3776/capstone-asah2026-cs302/blob/main/backend/src/app.ts): `backend/src/app.ts`
- [Customer management](https://github.com/akbar3776/capstone-asah2026-cs302/tree/main/backend/src): `backend/src`
- [Sessions and classes](https://github.com/akbar3776/capstone-asah2026-cs302/tree/main/backend/src): `backend/src`
- [Participants](https://github.com/akbar3776/capstone-asah2026-cs302/tree/main/backend/src): `backend/src`
- [Follow-up status](https://github.com/akbar3776/capstone-asah2026-cs302/tree/main/backend/src): `backend/src`
- [PostgreSQL](https://github.com/akbar3776/capstone-asah2026-cs302/blob/main/backend/prisma/schema.prisma): `backend/prisma/schema.prisma`

### AI capabilities

- [AI service API](https://github.com/akbar3776/capstone-asah2026-cs302/blob/main/ai-service/app/main.py): `ai-service/app/main.py`
- [Priority prediction](https://github.com/akbar3776/capstone-asah2026-cs302/tree/main/ai-service): `ai-service`
- [Message drafts](https://github.com/akbar3776/capstone-asah2026-cs302/tree/main/ai-service): `ai-service`
- **Gemini API**
- [Template fallback](https://github.com/akbar3776/capstone-asah2026-cs302/tree/main/ai-service): `ai-service`

### Offline ML

- [Offline ML workflow](https://github.com/akbar3776/capstone-asah2026-cs302/tree/main/ml): `ml`

### Other components

- **Admin**
- **WhatsApp delivery**

## Connections

- Admin → Admin panel: uses (evidence: `README.md`)
- Admin panel → Backend API: requests API (evidence: `README.md`)
- Backend API → PostgreSQL: persists data (evidence: `README.md`)
- Backend API → AI service API: calls securely (evidence: `README.md`)
- AI service API → Priority prediction: serves prediction (evidence: `README.md`)
- AI service API → Message drafts: serves drafts (evidence: `README.md`)
- Message drafts → Gemini API: generates with (evidence: `README.md`)
- Message drafts → Template fallback: falls back to (evidence: `README.md`)
- Admin → WhatsApp delivery: sends manually (evidence: `README.md`)
