# nejim2001/bud-dial architecture

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

- Interactive diagram: https://gitdiagram.com/nejim2001/bud-dial
- Repository: https://github.com/nejim2001/bud-dial

## Overview

BudDial is a mobile appointment-booking assistant. Users enter a request and business details, submit them to start an AI phone call, then receive a structured success or failure result after the conversation is analyzed. The documented workflow uses ElevenLabs for voice calls and Gemini for transcript extraction; the sampled source confirms the call and analysis endpoints. Map selection, call-status handling, and calendar tools are represented as capabilities from the README and file tree, but their implementation and wiring were not sampled.

Main entry points: [`backend/api/analyze.ts`](https://github.com/nejim2001/bud-dial/blob/main/backend/api/analyze.ts) (Analyze conversation), [`frontend/app/ongoing-call.jsx`](https://github.com/nejim2001/bud-dial/blob/main/frontend/app/ongoing-call.jsx) (Call progress), [`backend/api/call.ts`](https://github.com/nejim2001/bud-dial/blob/main/backend/api/call.ts) (Start call API), [`frontend/app/appointment-details.jsx`](https://github.com/nejim2001/bud-dial/blob/main/frontend/app/appointment-details.jsx) (Appointment form)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_mobile["Mobile app"]
  node_welcome["Welcome and auth<br/>[index.jsx]"]
  node_business["Business selection<br/>[home.jsx]"]
  node_details["Appointment form"]
  node_callprogress["Call progress<br/>[ongoing-call.jsx]"]
  node_success["Success result<br/>[success-call.jsx]"]
  node_failure["Failure result<br/>[failed-call.jsx]"]
end

subgraph group_booking["Call orchestration"]
  node_callapi["Start call API<br/>[call.ts]"]
  node_statusapi["Conversation status"]
  node_endapi["End call API<br/>[end-call.ts]"]
  node_conversations["Conversation listing"]
  node_calendarcheck["Check calendar<br/>[check-calendar.ts]"]
  node_calendarupdate["Update calendar<br/>[update-calendar.ts]"]
end

subgraph group_analysis["Result analysis"]
  node_analyze["Analyze conversation<br/>[analyze.ts]"]
  node_schemas["Extraction schemas<br/>[schemas.ts]"]
  node_gemini["Transcript extraction<br/>[gemini.ts]"]
end

subgraph group_integrations["External services"]
  node_eleven["ElevenLabs voice"]
  node_geminiservice["Gemini service"]
  node_businessphone["Business phone"]
  node_calendarservice["Calendar service"]
end

node_user(("User"))

node_user -->|"opens app"| node_welcome
node_welcome -->|"continues"| node_business
node_business -->|"selects business"| node_details
node_user -->|"enters request"| node_details
node_details -->|"posts call request"| node_callapi
node_callapi -->|"requests outbound call"| node_eleven
node_eleven -->|"places call"| node_businessphone
node_callapi -->|"returns call details"| node_callprogress
node_callprogress -.->|"checks status"| node_statusapi
node_statusapi -.->|"fetches status"| node_eleven
node_callprogress -.->|"requests analysis"| node_analyze
node_analyze -->|"fetches conversation"| node_eleven
node_analyze -->|"selects schema"| node_schemas
node_analyze -->|"submits transcript"| node_gemini
node_gemini -->|"extracts fields"| node_geminiservice
node_analyze -.->|"returns result"| node_success
node_analyze -.->|"returns result"| node_failure
node_calendarcheck -.->|"checks availability"| node_calendarservice
node_calendarupdate -.->|"updates booking"| node_calendarservice

click node_welcome "https://github.com/nejim2001/bud-dial/blob/main/frontend/app/index.jsx"
click node_business "https://github.com/nejim2001/bud-dial/blob/main/frontend/app/home.jsx"
click node_details "https://github.com/nejim2001/bud-dial/blob/main/frontend/app/appointment-details.jsx"
click node_callprogress "https://github.com/nejim2001/bud-dial/blob/main/frontend/app/ongoing-call.jsx"
click node_success "https://github.com/nejim2001/bud-dial/blob/main/frontend/app/success-call.jsx"
click node_failure "https://github.com/nejim2001/bud-dial/blob/main/frontend/app/failed-call.jsx"
click node_callapi "https://github.com/nejim2001/bud-dial/blob/main/backend/api/call.ts"
click node_statusapi "https://github.com/nejim2001/bud-dial/blob/main/backend/api/conversation-status.ts"
click node_endapi "https://github.com/nejim2001/bud-dial/blob/main/backend/api/end-call.ts"
click node_conversations "https://github.com/nejim2001/bud-dial/blob/main/backend/api/fetch-all-conversations.ts"
click node_analyze "https://github.com/nejim2001/bud-dial/blob/main/backend/api/analyze.ts"
click node_schemas "https://github.com/nejim2001/bud-dial/blob/main/backend/lib/schemas.ts"
click node_gemini "https://github.com/nejim2001/bud-dial/blob/main/backend/lib/gemini.ts"
click node_calendarcheck "https://github.com/nejim2001/bud-dial/blob/main/backend/api/tools/check-calendar.ts"
click node_calendarupdate "https://github.com/nejim2001/bud-dial/blob/main/backend/api/tools/update-calendar.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_welcome,node_business,node_details,node_callprogress,node_success,node_failure,node_user toneBlue
class node_callapi,node_statusapi,node_endapi,node_conversations,node_calendarcheck,node_calendarupdate toneAmber
class node_analyze,node_schemas,node_gemini toneMint
class node_eleven,node_geminiservice,node_businessphone,node_calendarservice toneRose
```

## Components

### Mobile app

- [Welcome and auth](https://github.com/nejim2001/bud-dial/blob/main/frontend/app/index.jsx): `frontend/app/index.jsx`
- [Business selection](https://github.com/nejim2001/bud-dial/blob/main/frontend/app/home.jsx): `frontend/app/home.jsx`
- [Appointment form](https://github.com/nejim2001/bud-dial/blob/main/frontend/app/appointment-details.jsx): `frontend/app/appointment-details.jsx`
- [Call progress](https://github.com/nejim2001/bud-dial/blob/main/frontend/app/ongoing-call.jsx): `frontend/app/ongoing-call.jsx`
- [Success result](https://github.com/nejim2001/bud-dial/blob/main/frontend/app/success-call.jsx): `frontend/app/success-call.jsx`
- [Failure result](https://github.com/nejim2001/bud-dial/blob/main/frontend/app/failed-call.jsx): `frontend/app/failed-call.jsx`

### Call orchestration

- [Start call API](https://github.com/nejim2001/bud-dial/blob/main/backend/api/call.ts): `backend/api/call.ts`
- [Conversation status](https://github.com/nejim2001/bud-dial/blob/main/backend/api/conversation-status.ts): `backend/api/conversation-status.ts`
- [End call API](https://github.com/nejim2001/bud-dial/blob/main/backend/api/end-call.ts): `backend/api/end-call.ts`
- [Conversation listing](https://github.com/nejim2001/bud-dial/blob/main/backend/api/fetch-all-conversations.ts): `backend/api/fetch-all-conversations.ts`
- [Check calendar](https://github.com/nejim2001/bud-dial/blob/main/backend/api/tools/check-calendar.ts): `backend/api/tools/check-calendar.ts`
- [Update calendar](https://github.com/nejim2001/bud-dial/blob/main/backend/api/tools/update-calendar.ts): `backend/api/tools/update-calendar.ts`

### Result analysis

- [Analyze conversation](https://github.com/nejim2001/bud-dial/blob/main/backend/api/analyze.ts): `backend/api/analyze.ts`
- [Extraction schemas](https://github.com/nejim2001/bud-dial/blob/main/backend/lib/schemas.ts): `backend/lib/schemas.ts`
- [Transcript extraction](https://github.com/nejim2001/bud-dial/blob/main/backend/lib/gemini.ts): `backend/lib/gemini.ts`

### External services

- **ElevenLabs voice**
- **Gemini service**
- **Business phone**
- **Calendar service**

### Other components

- **User**

## Connections

- User → Welcome and auth: opens app
- Welcome and auth → Business selection: continues
- Business selection → Appointment form: selects business
- User → Appointment form: enters request
- Appointment form → Start call API: posts call request
- Start call API → ElevenLabs voice: requests outbound call
- ElevenLabs voice → Business phone: places call
- Start call API → Call progress: returns call details
- Call progress → Conversation status: checks status
- Conversation status → ElevenLabs voice: fetches status
- Call progress → Analyze conversation: requests analysis
- Analyze conversation → ElevenLabs voice: fetches conversation
- Analyze conversation → Extraction schemas: selects schema
- Analyze conversation → Transcript extraction: submits transcript
- Transcript extraction → Gemini service: extracts fields
- Analyze conversation → Success result: returns result
- Analyze conversation → Failure result: returns result
- Check calendar → Calendar service: checks availability
- Update calendar → Calendar service: updates booking
