# prolaybhattacharyya29/tellyai architecture

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

- Interactive diagram: https://gitdiagram.com/prolaybhattacharyya29/tellyai
- Repository: https://github.com/prolaybhattacharyya29/tellyai

## Overview

FE Credit AI Voice Assistant supports authenticated campaign-based outbound calls, then processes call events into summaries and searchable call history. The primary workflow runs from the dashboard through the API and Retell; a separate sync service recovers missed calls. Source excerpts show the call and persistence logic, but README content is absent and some webhook handling is omitted, so those links are limited to directly evidenced calls or explicit source behavior.

Main entry points: [`app/main.py`](https://github.com/prolaybhattacharyya29/tellyai/blob/master/app/main.py) (FastAPI routes), [`app/call_service.py`](https://github.com/prolaybhattacharyya29/tellyai/blob/master/app/call_service.py) (Call preparation), [`app/db.py`](https://github.com/prolaybhattacharyya29/tellyai/blob/master/app/db.py) (Supabase access), [`app/sync_service.py`](https://github.com/prolaybhattacharyya29/tellyai/blob/master/app/sync_service.py) (Missed-call sync)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dashboard["Dashboard"]
  node_browser["Web dashboard<br/>[app.js]"]
  node_api["FastAPI routes<br/>[main.py]"]
  node_history["Call history UI<br/>[logs.html]"]
  node_login["Login page<br/>[login.html]"]
end

subgraph group_calling["Campaign Calling"]
  node_campaigns["Campaign catalog<br/>[campaigns.py]"]
  node_callservice["Call preparation<br/>[call_service.py]"]
  node_customers["Customer profiles<br/>[customers.csv]"]
  node_rules["Campaign prompts"]
  node_retell["Retell telephony"]
  node_agentprompt["Agent instructions<br/>[agent_system.md]"]
end

subgraph group_processing["Call Processing"]
  node_webhook["Call event handling<br/>[main.py]"]
  node_summarize["Call summarizer<br/>[summarize.py]"]
  node_sync["Missed-call sync<br/>[sync_service.py]"]
  node_summaryprompt["Summary instructions<br/>[summary.md]"]
end

subgraph group_data["Identity and Data"]
  node_db["Supabase access<br/>[db.py]"]
  node_supabase[("Supabase tables")]
  node_adminauth["Admin authentication<br/>[db.py]"]
end

node_admin(("Admin user"))

node_admin -->|"uses"| node_browser
node_browser -->|"requests call"| node_api
node_api -->|"dispatches"| node_callservice
node_api -->|"serves catalog"| node_campaigns
node_callservice -->|"selects campaign"| node_campaigns
node_callservice -->|"loads profile"| node_customers
node_callservice -->|"loads rules"| node_rules
node_callservice -->|"starts call"| node_retell
node_retell -.->|"posts events"| node_api
node_api -->|"handles events"| node_webhook
node_webhook -.->|"summarizes transcript"| node_summarize
node_summarize -->|"uses prompt"| node_summaryprompt
node_webhook -.->|"saves results"| node_db
node_api -->|"reads call history"| node_db
node_db -->|"queries and writes"| node_supabase
node_sync -->|"fetches calls"| node_retell
node_sync -->|"summarizes calls"| node_summarize
node_sync -->|"stores calls"| node_db
node_browser -->|"checks health"| node_api
node_admin -->|"signs in"| node_login
node_api -->|"authenticates"| node_adminauth
node_adminauth -->|"checks users"| node_supabase
node_api -->|"renders logs"| node_history

click node_browser "https://github.com/prolaybhattacharyya29/tellyai/blob/master/frontend/js/app.js"
click node_api "https://github.com/prolaybhattacharyya29/tellyai/blob/master/app/main.py"
click node_campaigns "https://github.com/prolaybhattacharyya29/tellyai/blob/master/app/campaigns.py"
click node_callservice "https://github.com/prolaybhattacharyya29/tellyai/blob/master/app/call_service.py"
click node_customers "https://github.com/prolaybhattacharyya29/tellyai/blob/master/data/customers.csv"
click node_rules "https://github.com/prolaybhattacharyya29/tellyai/tree/master/prompts/campaigns"
click node_webhook "https://github.com/prolaybhattacharyya29/tellyai/blob/master/app/main.py"
click node_summarize "https://github.com/prolaybhattacharyya29/tellyai/blob/master/app/summarize.py"
click node_sync "https://github.com/prolaybhattacharyya29/tellyai/blob/master/app/sync_service.py"
click node_history "https://github.com/prolaybhattacharyya29/tellyai/blob/master/frontend/logs.html"
click node_db "https://github.com/prolaybhattacharyya29/tellyai/blob/master/app/db.py"
click node_adminauth "https://github.com/prolaybhattacharyya29/tellyai/blob/master/app/db.py"
click node_login "https://github.com/prolaybhattacharyya29/tellyai/blob/master/frontend/login.html"
click node_agentprompt "https://github.com/prolaybhattacharyya29/tellyai/blob/master/prompts/agent_system.md"
click node_summaryprompt "https://github.com/prolaybhattacharyya29/tellyai/blob/master/prompts/summary.md"

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_browser,node_api,node_history,node_login,node_admin toneBlue
class node_campaigns,node_callservice,node_customers,node_rules,node_retell,node_agentprompt toneAmber
class node_webhook,node_summarize,node_sync,node_summaryprompt toneMint
class node_db,node_supabase,node_adminauth toneRose
```

## Components

### Dashboard

- [Web dashboard](https://github.com/prolaybhattacharyya29/tellyai/blob/master/frontend/js/app.js): `frontend/js/app.js`
- [FastAPI routes](https://github.com/prolaybhattacharyya29/tellyai/blob/master/app/main.py): `app/main.py`
- [Call history UI](https://github.com/prolaybhattacharyya29/tellyai/blob/master/frontend/logs.html): `frontend/logs.html`
- [Login page](https://github.com/prolaybhattacharyya29/tellyai/blob/master/frontend/login.html): `frontend/login.html`

### Campaign Calling

- [Campaign catalog](https://github.com/prolaybhattacharyya29/tellyai/blob/master/app/campaigns.py): `app/campaigns.py`
- [Call preparation](https://github.com/prolaybhattacharyya29/tellyai/blob/master/app/call_service.py): `app/call_service.py`
- [Customer profiles](https://github.com/prolaybhattacharyya29/tellyai/blob/master/data/customers.csv): `data/customers.csv`
- [Campaign prompts](https://github.com/prolaybhattacharyya29/tellyai/tree/master/prompts/campaigns): `prompts/campaigns`
- **Retell telephony**
- [Agent instructions](https://github.com/prolaybhattacharyya29/tellyai/blob/master/prompts/agent_system.md): `prompts/agent_system.md`

### Call Processing

- [Call event handling](https://github.com/prolaybhattacharyya29/tellyai/blob/master/app/main.py): `app/main.py`
- [Call summarizer](https://github.com/prolaybhattacharyya29/tellyai/blob/master/app/summarize.py): `app/summarize.py`
- [Missed-call sync](https://github.com/prolaybhattacharyya29/tellyai/blob/master/app/sync_service.py): `app/sync_service.py`
- [Summary instructions](https://github.com/prolaybhattacharyya29/tellyai/blob/master/prompts/summary.md): `prompts/summary.md`

### Identity and Data

- [Supabase access](https://github.com/prolaybhattacharyya29/tellyai/blob/master/app/db.py): `app/db.py`
- **Supabase tables**
- [Admin authentication](https://github.com/prolaybhattacharyya29/tellyai/blob/master/app/db.py): `app/db.py`

### Other components

- **Admin user**

## Connections

- Admin user → Web dashboard: uses (evidence: `frontend/js/app.js`)
- Web dashboard → FastAPI routes: requests call (evidence: `frontend/js/app.js`)
- FastAPI routes → Call preparation: dispatches (evidence: `app/main.py`)
- FastAPI routes → Campaign catalog: serves catalog (evidence: `app/main.py`)
- Call preparation → Campaign catalog: selects campaign (evidence: `app/call_service.py`)
- Call preparation → Customer profiles: loads profile (evidence: `app/call_service.py`)
- Call preparation → Campaign prompts: loads rules (evidence: `app/call_service.py`)
- Call preparation → Retell telephony: starts call (evidence: `app/call_service.py`)
- Retell telephony → FastAPI routes: posts events
- FastAPI routes → Call event handling: handles events (evidence: `app/main.py`)
- Call event handling → Call summarizer: summarizes transcript (evidence: `app/main.py`)
- Call summarizer → Summary instructions: uses prompt (evidence: `app/summarize.py`)
- Call event handling → Supabase access: saves results (evidence: `app/main.py`)
- FastAPI routes → Supabase access: reads call history (evidence: `app/main.py`)
- Supabase access → Supabase tables: queries and writes (evidence: `app/db.py`)
- Missed-call sync → Retell telephony: fetches calls (evidence: `app/sync_service.py`)
- Missed-call sync → Call summarizer: summarizes calls (evidence: `app/sync_service.py`)
- Missed-call sync → Supabase access: stores calls (evidence: `app/sync_service.py`)
- Web dashboard → FastAPI routes: checks health (evidence: `frontend/js/app.js`)
- Admin user → Login page: signs in
- FastAPI routes → Admin authentication: authenticates (evidence: `app/main.py`)
- Admin authentication → Supabase tables: checks users (evidence: `app/db.py`)
- FastAPI routes → Call history UI: renders logs (evidence: `app/main.py`)
