# yangwu0/dubhacks26-call-helper architecture

> Architecture diagram of the GitHub repository yangwu0/dubhacks26-call-helper, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/yangwu0/dubhacks26-call-helper
- Repository: https://github.com/yangwu0/dubhacks26-call-helper

## Overview

Sift is a phone-answering and call-screening app; the README describes it as a hackathon scaffold with features not yet built. The intended flow is an inbound call, voice-agent setup and tool actions, then post-call transcript processing and a dashboard record. The app also exposes account settings, weekly reporting, and call scanning. The graph keeps the documented Photon voice option and disabled messaging distinct. Several routes and integrations are unsampled, so their internal links are omitted rather than inferred.

Main entry points: [`app/api/tools/db.ts`](https://github.com/yangwu0/dubhacks26-call-helper/blob/main/app/api/tools/db.ts) (Call Data Access), [`app/api/elevenlabs/post-call/route.ts`](https://github.com/yangwu0/dubhacks26-call-helper/blob/main/app/api/elevenlabs/post-call/route.ts) (Post-Call Handler), [`app/api/elevenlabs/init/route.ts`](https://github.com/yangwu0/dubhacks26-call-helper/blob/main/app/api/elevenlabs/init/route.ts) (Voice Setup), [`lib/commands.ts`](https://github.com/yangwu0/dubhacks26-call-helper/blob/main/lib/commands.ts) (Report Commands)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_voice["Voice and Calls"]
  node_photon{{"Photon SIP"}}
  node_line["Line Routing<br/>[route.ts]"]
  node_init["Voice Setup<br/>[route.ts]"]
  node_elevenlabs{{"ElevenLabs"}}
  node_contracts["Request Contracts<br/>[contracts.ts]"]
end

subgraph group_actions["Call Actions"]
  node_tools["Call Tools"]
  node_availability["Availability Checks<br/>[route.ts]"]
  node_calendar["Calendar Rules<br/>[calendar.ts]"]
  node_booking["Event Booking<br/>[route.ts]"]
  node_verification["Caller Verification<br/>[route.ts]"]
  node_matching["Contact Matching<br/>[match.ts]"]
  node_risk["Risk Reporting<br/>[route.ts]"]
  node_forwarding["Call Forwarding<br/>[route.ts]"]
  node_message["Message Capture<br/>[route.ts]"]
end

subgraph group_processing["Post-Call Processing"]
  node_postcall["Post-Call Handler<br/>[route.ts]"]
  node_scoring["Call Scoring<br/>[scoring.ts]"]
  node_summaries["AI Summaries<br/>[anthropic.ts]"]
  node_scan["Call Scan<br/>[route.ts]"]
end

subgraph group_data["Account and Data"]
  node_db["Call Data Access<br/>[db.ts]"]
  node_database[("Supabase")]
  node_crypto["Account Encryption<br/>[account-crypto.ts]"]
  node_login["Login API<br/>[route.ts]"]
  node_account["Account API<br/>[route.ts]"]
end

subgraph group_product["Dashboard and Reports"]
  node_dashboard["Dashboard State<br/>[sift-provider.tsx]"]
  node_dashboard_pages["Call Dashboard"]
  node_report["Weekly Report<br/>[route.ts]"]
  node_commands["Report Commands<br/>[commands.ts]"]
end

node_caller(("Caller"))
node_owner(("Owner"))

node_caller -.->|"calls"| node_photon
node_photon -.->|"routes through"| node_line
node_elevenlabs -.->|"requests setup"| node_init
node_elevenlabs -->|"sends webhook"| node_postcall
node_init -->|"loads call data"| node_db
node_init -->|"uses schemas"| node_contracts
node_tools -.->|"accesses data"| node_db
node_availability -->|"checks slots"| node_calendar
node_availability -->|"loads events"| node_db
node_booking -->|"checks booking"| node_calendar
node_booking -->|"loads and records"| node_db
node_verification -->|"matches caller"| node_matching
node_verification -->|"loads call data"| node_db
node_risk -->|"classifies risk"| node_scoring
node_risk -->|"records result"| node_db
node_forwarding -->|"checks risk"| node_scoring
node_forwarding -->|"loads call data"| node_db
node_message -->|"records message"| node_db
node_postcall -->|"stores transcript"| node_db
node_postcall -->|"classifies call"| node_scoring
node_postcall -->|"generates summary"| node_summaries
node_scan -->|"scans call"| node_summaries
node_scan -.->|"authenticates owner"| node_db
node_db -->|"reads and writes"| node_database
node_db -->|"seals owner data"| node_crypto
node_login -->|"loads owner"| node_db
node_login -->|"seals owner data"| node_crypto
node_account -->|"authenticates owner"| node_db
node_account -->|"seals profile"| node_crypto
node_dashboard -->|"updates profile"| node_account
node_dashboard_pages -->|"uses state"| node_dashboard
node_report -->|"loads call data"| node_db
node_report -->|"builds report"| node_commands
node_commands -->|"reads call data"| node_db
node_commands -->|"generates narrative"| node_summaries
node_owner -.->|"reviews calls"| node_dashboard_pages
node_owner -.->|"signs in"| node_login

click node_line "https://github.com/yangwu0/dubhacks26-call-helper/blob/main/app/api/line/route.ts"
click node_init "https://github.com/yangwu0/dubhacks26-call-helper/blob/main/app/api/elevenlabs/init/route.ts"
click node_contracts "https://github.com/yangwu0/dubhacks26-call-helper/blob/main/lib/contracts.ts"
click node_tools "https://github.com/yangwu0/dubhacks26-call-helper/tree/main/app/api/tools"
click node_availability "https://github.com/yangwu0/dubhacks26-call-helper/blob/main/app/api/tools/check_availability/route.ts"
click node_calendar "https://github.com/yangwu0/dubhacks26-call-helper/blob/main/app/api/tools/calendar.ts"
click node_booking "https://github.com/yangwu0/dubhacks26-call-helper/blob/main/app/api/tools/book_event/route.ts"
click node_verification "https://github.com/yangwu0/dubhacks26-call-helper/blob/main/app/api/tools/verify_caller_target/route.ts"
click node_matching "https://github.com/yangwu0/dubhacks26-call-helper/blob/main/app/api/tools/match.ts"
click node_risk "https://github.com/yangwu0/dubhacks26-call-helper/blob/main/app/api/tools/report_risk/route.ts"
click node_forwarding "https://github.com/yangwu0/dubhacks26-call-helper/blob/main/app/api/tools/forward_call/route.ts"
click node_message "https://github.com/yangwu0/dubhacks26-call-helper/blob/main/app/api/tools/take_message/route.ts"
click node_postcall "https://github.com/yangwu0/dubhacks26-call-helper/blob/main/app/api/elevenlabs/post-call/route.ts"
click node_scoring "https://github.com/yangwu0/dubhacks26-call-helper/blob/main/lib/scoring.ts"
click node_summaries "https://github.com/yangwu0/dubhacks26-call-helper/blob/main/lib/anthropic.ts"
click node_scan "https://github.com/yangwu0/dubhacks26-call-helper/blob/main/app/api/scan/route.ts"
click node_db "https://github.com/yangwu0/dubhacks26-call-helper/blob/main/app/api/tools/db.ts"
click node_crypto "https://github.com/yangwu0/dubhacks26-call-helper/blob/main/lib/account-crypto.ts"
click node_login "https://github.com/yangwu0/dubhacks26-call-helper/blob/main/app/api/auth/login/route.ts"
click node_account "https://github.com/yangwu0/dubhacks26-call-helper/blob/main/app/api/account/route.ts"
click node_dashboard "https://github.com/yangwu0/dubhacks26-call-helper/blob/main/components/sift-provider.tsx"
click node_dashboard_pages "https://github.com/yangwu0/dubhacks26-call-helper/tree/main/app/dashboard"
click node_report "https://github.com/yangwu0/dubhacks26-call-helper/blob/main/app/api/report/weekly/route.ts"
click node_commands "https://github.com/yangwu0/dubhacks26-call-helper/blob/main/lib/commands.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_photon,node_line,node_init,node_elevenlabs,node_contracts toneBlue
class node_tools,node_availability,node_calendar,node_booking,node_verification,node_matching,node_risk,node_forwarding,node_message toneAmber
class node_postcall,node_scoring,node_summaries,node_scan toneMint
class node_db,node_database,node_crypto,node_login,node_account toneRose
class node_dashboard,node_dashboard_pages,node_report,node_commands,node_caller,node_owner toneIndigo
```

## Components

### Voice and Calls

- **Photon SIP**
- [Line Routing](https://github.com/yangwu0/dubhacks26-call-helper/blob/main/app/api/line/route.ts): `app/api/line/route.ts`
- [Voice Setup](https://github.com/yangwu0/dubhacks26-call-helper/blob/main/app/api/elevenlabs/init/route.ts): `app/api/elevenlabs/init/route.ts`
- **ElevenLabs**
- [Request Contracts](https://github.com/yangwu0/dubhacks26-call-helper/blob/main/lib/contracts.ts): `lib/contracts.ts`

### Call Actions

- [Call Tools](https://github.com/yangwu0/dubhacks26-call-helper/tree/main/app/api/tools): `app/api/tools`
- [Availability Checks](https://github.com/yangwu0/dubhacks26-call-helper/blob/main/app/api/tools/check_availability/route.ts): `app/api/tools/check_availability/route.ts`
- [Calendar Rules](https://github.com/yangwu0/dubhacks26-call-helper/blob/main/app/api/tools/calendar.ts): `app/api/tools/calendar.ts`
- [Event Booking](https://github.com/yangwu0/dubhacks26-call-helper/blob/main/app/api/tools/book_event/route.ts): `app/api/tools/book_event/route.ts`
- [Caller Verification](https://github.com/yangwu0/dubhacks26-call-helper/blob/main/app/api/tools/verify_caller_target/route.ts): `app/api/tools/verify_caller_target/route.ts`
- [Contact Matching](https://github.com/yangwu0/dubhacks26-call-helper/blob/main/app/api/tools/match.ts): `app/api/tools/match.ts`
- [Risk Reporting](https://github.com/yangwu0/dubhacks26-call-helper/blob/main/app/api/tools/report_risk/route.ts): `app/api/tools/report_risk/route.ts`
- [Call Forwarding](https://github.com/yangwu0/dubhacks26-call-helper/blob/main/app/api/tools/forward_call/route.ts): `app/api/tools/forward_call/route.ts`
- [Message Capture](https://github.com/yangwu0/dubhacks26-call-helper/blob/main/app/api/tools/take_message/route.ts): `app/api/tools/take_message/route.ts`

### Post-Call Processing

- [Post-Call Handler](https://github.com/yangwu0/dubhacks26-call-helper/blob/main/app/api/elevenlabs/post-call/route.ts): `app/api/elevenlabs/post-call/route.ts`
- [Call Scoring](https://github.com/yangwu0/dubhacks26-call-helper/blob/main/lib/scoring.ts): `lib/scoring.ts`
- [AI Summaries](https://github.com/yangwu0/dubhacks26-call-helper/blob/main/lib/anthropic.ts): `lib/anthropic.ts`
- [Call Scan](https://github.com/yangwu0/dubhacks26-call-helper/blob/main/app/api/scan/route.ts): `app/api/scan/route.ts`

### Account and Data

- [Call Data Access](https://github.com/yangwu0/dubhacks26-call-helper/blob/main/app/api/tools/db.ts): `app/api/tools/db.ts`
- **Supabase**
- [Account Encryption](https://github.com/yangwu0/dubhacks26-call-helper/blob/main/lib/account-crypto.ts): `lib/account-crypto.ts`
- [Login API](https://github.com/yangwu0/dubhacks26-call-helper/blob/main/app/api/auth/login/route.ts): `app/api/auth/login/route.ts`
- [Account API](https://github.com/yangwu0/dubhacks26-call-helper/blob/main/app/api/account/route.ts): `app/api/account/route.ts`

### Dashboard and Reports

- [Dashboard State](https://github.com/yangwu0/dubhacks26-call-helper/blob/main/components/sift-provider.tsx): `components/sift-provider.tsx`
- [Call Dashboard](https://github.com/yangwu0/dubhacks26-call-helper/tree/main/app/dashboard): `app/dashboard`
- [Weekly Report](https://github.com/yangwu0/dubhacks26-call-helper/blob/main/app/api/report/weekly/route.ts): `app/api/report/weekly/route.ts`
- [Report Commands](https://github.com/yangwu0/dubhacks26-call-helper/blob/main/lib/commands.ts): `lib/commands.ts`

### Other components

- **Caller**
- **Owner**

## Connections

- Caller → Photon SIP: calls
- Photon SIP → Line Routing: routes through
- ElevenLabs → Voice Setup: requests setup (evidence: `app/api/elevenlabs/init/route.ts`)
- ElevenLabs → Post-Call Handler: sends webhook (evidence: `app/api/elevenlabs/post-call/route.ts`)
- Voice Setup → Call Data Access: loads call data (evidence: `app/api/elevenlabs/init/route.ts`)
- Voice Setup → Request Contracts: uses schemas (evidence: `app/api/elevenlabs/init/route.ts`)
- Call Tools → Call Data Access: accesses data (evidence: `app/api/tools/book_event/route.ts`)
- Availability Checks → Calendar Rules: checks slots (evidence: `app/api/tools/check_availability/route.ts`)
- Availability Checks → Call Data Access: loads events (evidence: `app/api/tools/check_availability/route.ts`)
- Event Booking → Calendar Rules: checks booking (evidence: `app/api/tools/book_event/route.ts`)
- Event Booking → Call Data Access: loads and records (evidence: `app/api/tools/book_event/route.ts`)
- Caller Verification → Contact Matching: matches caller (evidence: `app/api/tools/verify_caller_target/route.ts`)
- Caller Verification → Call Data Access: loads call data (evidence: `app/api/tools/verify_caller_target/route.ts`)
- Risk Reporting → Call Scoring: classifies risk (evidence: `app/api/tools/report_risk/route.ts`)
- Risk Reporting → Call Data Access: records result (evidence: `app/api/tools/report_risk/route.ts`)
- Call Forwarding → Call Scoring: checks risk (evidence: `app/api/tools/forward_call/route.ts`)
- Call Forwarding → Call Data Access: loads call data (evidence: `app/api/tools/forward_call/route.ts`)
- Message Capture → Call Data Access: records message (evidence: `app/api/tools/take_message/route.ts`)
- Post-Call Handler → Call Data Access: stores transcript (evidence: `app/api/elevenlabs/post-call/route.ts`)
- Post-Call Handler → Call Scoring: classifies call (evidence: `app/api/elevenlabs/post-call/route.ts`)
- Post-Call Handler → AI Summaries: generates summary (evidence: `app/api/elevenlabs/post-call/route.ts`)
- Call Scan → AI Summaries: scans call (evidence: `app/api/scan/route.ts`)
- Call Scan → Call Data Access: authenticates owner
- Call Data Access → Supabase: reads and writes (evidence: `app/api/tools/db.ts`)
- Call Data Access → Account Encryption: seals owner data (evidence: `app/api/tools/db.ts`)
- Login API → Call Data Access: loads owner (evidence: `app/api/auth/login/route.ts`)
- Login API → Account Encryption: seals owner data (evidence: `app/api/auth/login/route.ts`)
- Account API → Call Data Access: authenticates owner (evidence: `app/api/account/route.ts`)
- Account API → Account Encryption: seals profile (evidence: `app/api/account/route.ts`)
- Dashboard State → Account API: updates profile (evidence: `components/sift-provider.tsx`)
- Call Dashboard → Dashboard State: uses state (evidence: `app/dashboard/calls/page.tsx`)
- Weekly Report → Call Data Access: loads call data (evidence: `app/api/report/weekly/route.ts`)
- Weekly Report → Report Commands: builds report (evidence: `app/api/report/weekly/route.ts`)
- Report Commands → Call Data Access: reads call data (evidence: `lib/commands.ts`)
- Report Commands → AI Summaries: generates narrative (evidence: `lib/commands.ts`)
- Owner → Call Dashboard: reviews calls
- Owner → Login API: signs in
