# twiliodeved/essentials-messaging-voice-course architecture

> Architecture diagram of the GitHub repository twiliodeved/essentials-messaging-voice-course, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/twiliodeved/essentials-messaging-voice-course
- Repository: https://github.com/twiliodeved/essentials-messaging-voice-course

## Overview

Phonemo is the completed Twilio course project: it lets people register for talks by text, joins callers to a live talk, and lets an organizer start calls to speakers and registrants. After a participant leaves, it sends a feedback prompt and handles the reply. The sampled handlers show these flows using a shared data asset and Twilio’s runtime client/TwiML. The data asset implementation and function routing are not shown, so their internals and deployment wiring are omitted.

Main entry points: [`code/phonemo/assets/data.private.js`](https://github.com/twiliodeved/essentials-messaging-voice-course/blob/main/code/phonemo/assets/data.private.js) (Talk and registration data), [`code/phonemo/functions/incoming-message.js`](https://github.com/twiliodeved/essentials-messaging-voice-course/blob/main/code/phonemo/functions/incoming-message.js) (Join by text), [`code/phonemo/functions/incoming-call.js`](https://github.com/twiliodeved/essentials-messaging-voice-course/blob/main/code/phonemo/functions/incoming-call.js) (Join talk), [`code/phonemo/functions/start-talk.protected.js`](https://github.com/twiliodeved/essentials-messaging-voice-course/blob/main/code/phonemo/functions/start-talk.protected.js) (Start talk)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_messaging["Messaging"]
  node_incoming_message["Join by text"]
  node_survey_handler["Survey reply"]
end

subgraph group_voice["Voice"]
  node_incoming_call["Join talk<br/>[incoming-call.js]"]
  node_start_talk["Start talk"]
  node_status_handler["Leave callback"]
end

subgraph group_talk_data["Talk data"]
  node_talk_data_asset["Talk and registration data<br/>[data.private.js]"]
end

node_attendee(("Attendee"))
node_organizer(("Organizer"))
node_twilio["Twilio"]

node_attendee -->|"texts or calls"| node_twilio
node_twilio -.->|"routes message"| node_incoming_message
node_incoming_message -->|"parses and registers"| node_talk_data_asset
node_incoming_message -->|"returns reply"| node_twilio
node_twilio -.->|"routes call"| node_incoming_call
node_incoming_call -->|"reads current talk"| node_talk_data_asset
node_incoming_call -->|"returns voice response"| node_twilio
node_organizer -.->|"starts talk"| node_start_talk
node_start_talk -->|"reads talk and registrants"| node_talk_data_asset
node_start_talk -->|"creates participants"| node_twilio
node_twilio -->|"sends leave callback"| node_status_handler
node_status_handler -->|"looks up talk"| node_talk_data_asset
node_status_handler -->|"fetches call and sends prompt"| node_twilio
node_twilio -.->|"routes reply"| node_survey_handler
node_survey_handler -->|"returns acknowledgement"| node_twilio

click node_incoming_message "https://github.com/twiliodeved/essentials-messaging-voice-course/blob/main/code/phonemo/functions/incoming-message.js"
click node_survey_handler "https://github.com/twiliodeved/essentials-messaging-voice-course/blob/main/code/phonemo/functions/survey-handler.protected.js"
click node_incoming_call "https://github.com/twiliodeved/essentials-messaging-voice-course/blob/main/code/phonemo/functions/incoming-call.js"
click node_start_talk "https://github.com/twiliodeved/essentials-messaging-voice-course/blob/main/code/phonemo/functions/start-talk.protected.js"
click node_status_handler "https://github.com/twiliodeved/essentials-messaging-voice-course/blob/main/code/phonemo/functions/status-handler.protected.js"
click node_talk_data_asset "https://github.com/twiliodeved/essentials-messaging-voice-course/blob/main/code/phonemo/assets/data.private.js"

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_incoming_message,node_survey_handler toneBlue
class node_incoming_call,node_start_talk,node_status_handler toneAmber
class node_talk_data_asset toneMint
class node_attendee,node_organizer,node_twilio toneIndigo
```

## Components

### Messaging

- [Join by text](https://github.com/twiliodeved/essentials-messaging-voice-course/blob/main/code/phonemo/functions/incoming-message.js): `code/phonemo/functions/incoming-message.js`
- [Survey reply](https://github.com/twiliodeved/essentials-messaging-voice-course/blob/main/code/phonemo/functions/survey-handler.protected.js): `code/phonemo/functions/survey-handler.protected.js`

### Voice

- [Join talk](https://github.com/twiliodeved/essentials-messaging-voice-course/blob/main/code/phonemo/functions/incoming-call.js): `code/phonemo/functions/incoming-call.js`
- [Start talk](https://github.com/twiliodeved/essentials-messaging-voice-course/blob/main/code/phonemo/functions/start-talk.protected.js): `code/phonemo/functions/start-talk.protected.js`
- [Leave callback](https://github.com/twiliodeved/essentials-messaging-voice-course/blob/main/code/phonemo/functions/status-handler.protected.js): `code/phonemo/functions/status-handler.protected.js`

### Talk data

- [Talk and registration data](https://github.com/twiliodeved/essentials-messaging-voice-course/blob/main/code/phonemo/assets/data.private.js): `code/phonemo/assets/data.private.js`

### Other components

- **Attendee**
- **Organizer**
- **Twilio**

## Connections

- Attendee → Twilio: texts or calls (evidence: `README.md`)
- Twilio → Join by text: routes message
- Join by text → Talk and registration data: parses and registers (evidence: `code/phonemo/functions/incoming-message.js`)
- Join by text → Twilio: returns reply (evidence: `code/phonemo/functions/incoming-message.js`)
- Twilio → Join talk: routes call
- Join talk → Talk and registration data: reads current talk (evidence: `code/phonemo/functions/incoming-call.js`)
- Join talk → Twilio: returns voice response (evidence: `code/phonemo/functions/incoming-call.js`)
- Organizer → Start talk: starts talk
- Start talk → Talk and registration data: reads talk and registrants (evidence: `code/phonemo/functions/start-talk.protected.js`)
- Start talk → Twilio: creates participants (evidence: `code/phonemo/functions/start-talk.protected.js`)
- Twilio → Leave callback: sends leave callback
- Leave callback → Talk and registration data: looks up talk (evidence: `code/phonemo/functions/status-handler.protected.js`)
- Leave callback → Twilio: fetches call and sends prompt (evidence: `code/phonemo/functions/status-handler.protected.js`)
- Twilio → Survey reply: routes reply
- Survey reply → Twilio: returns acknowledgement (evidence: `code/phonemo/functions/survey-handler.protected.js`)
