# microsoft/embeddedteamschat architecture

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

- Interactive diagram: https://gitdiagram.com/microsoft/embeddedteamschat
- Repository: https://github.com/microsoft/embeddedteamschat

## Overview

Embedded Chat is a browser-embedded Teams chat experience, with an ASP.NET backend for mapping entity IDs to chat/meeting details and issuing ACS tokens or creating online meetings. The main flow is host-page embed → authentication → create or retrieve a chat mapping → load messages and participants → send messages and manage participants; Graph or ACS/GNB supplies notifications. The graph preserves the documented notification alternatives and major chat capabilities. Some links rely on README descriptions or the source index; unsampled implementation details are not inferred.

Main entry points: [`wwwroot/src/Components/App.ts`](https://github.com/microsoft/embeddedteamschat/blob/main/wwwroot/src/Components/App.ts) (Chat app), [`wwwroot/src/Components/ChatContainer.ts`](https://github.com/microsoft/embeddedteamschat/blob/main/wwwroot/src/Components/ChatContainer.ts) (Chat interface), [`Services/GraphService.cs`](https://github.com/microsoft/embeddedteamschat/blob/main/Services/GraphService.cs) (Graph service), [`Repositories/MappingRepository.cs`](https://github.com/microsoft/embeddedteamschat/blob/main/Repositories/MappingRepository.cs) (Mapping repository)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_embed["Embed and auth"]
  node_entry["Embed entry points<br/>[EmbedGraph.ts]"]
  node_auth["Authentication<br/>[AuthUtil.ts]"]
  node_authpage["Auth flow<br/>[Auth.ts]"]
end

subgraph group_chat["Chat experience"]
  node_app["Chat app<br/>[App.ts]"]
  node_chatui["Chat interface<br/>[ChatContainer.ts]"]
  node_participantui["Participant picker"]
  node_graphutil["Graph operations<br/>[GraphUtil.ts]"]
  node_chatmodels["Chat and person data<br/>[ChatMessage.ts]"]
  node_mappingui["Client mapping<br/>[Mapping.ts]"]
end

subgraph group_notify["Notifications"]
  node_notifyinterface["Notification contract"]
  node_graphnotify["Graph notifications"]
  node_acsnotify["ACS notifications"]
end

subgraph group_server["Backend services"]
  node_mappingapi["Mapping API"]
  node_mappingrepo["Mapping repository"]
  node_tokenapi["ACS token API"]
  node_acsservice["ACS service<br/>[AcsService.cs]"]
  node_meetingapi["Meeting API<br/>[GraphController.cs]"]
  node_graphservice["Graph service<br/>[GraphService.cs]"]
  node_settings["App settings<br/>[AppSettings.cs]"]
  node_threadinfo["Thread details<br/>[ThreadInfo.cs]"]
  node_mappingmodel["Backend mapping<br/>[Mapping.cs]"]
end

node_host(("Host application"))
node_graph{{"Microsoft Graph"}}
node_gnb{{"Graph notification broker"}}
node_acs{{"Azure Communication Services"}}
node_mappingstore[("Azure Table Storage")]

node_host -->|"embeds"| node_entry
node_entry -.->|"renders"| node_app
node_app -->|"requests tokens"| node_auth
node_auth -->|"messages"| node_authpage
node_app -->|"renders"| node_chatui
node_chatui -->|"opens picker"| node_participantui
node_chatui -->|"performs operations"| node_graphutil
node_graphutil -->|"calls API"| node_graph
node_chatui -->|"uses data"| node_chatmodels
node_app -->|"uses mapping"| node_mappingui
node_app -->|"starts notifications"| node_notifyinterface
node_graphnotify -->|"implements"| node_notifyinterface
node_acsnotify -->|"implements"| node_notifyinterface
node_graphnotify -.->|"subscribes"| node_gnb
node_acsnotify -.->|"uses notifications"| node_acs
node_mappingapi -->|"reads and writes"| node_mappingrepo
node_mappingrepo -->|"reads and writes"| node_mappingstore
node_mappingrepo -->|"converts"| node_mappingmodel
node_tokenapi -->|"requests token"| node_acsservice
node_meetingapi -->|"creates meeting"| node_graphservice
node_graphservice -->|"creates online meeting"| node_graph
node_graphservice -->|"uses details"| node_threadinfo
node_graphservice -->|"reads configuration"| node_settings
node_mappingmodel -->|"contains details"| node_threadinfo

click node_entry "https://github.com/microsoft/embeddedteamschat/blob/main/wwwroot/src/EmbedGraph.ts"
click node_auth "https://github.com/microsoft/embeddedteamschat/blob/main/wwwroot/src/Utils/AuthUtil.ts"
click node_authpage "https://github.com/microsoft/embeddedteamschat/blob/main/wwwroot/src/Auth.ts"
click node_app "https://github.com/microsoft/embeddedteamschat/blob/main/wwwroot/src/Components/App.ts"
click node_chatui "https://github.com/microsoft/embeddedteamschat/blob/main/wwwroot/src/Components/ChatContainer.ts"
click node_participantui "https://github.com/microsoft/embeddedteamschat/blob/main/wwwroot/src/Components/AddParticipantDialog.ts"
click node_graphutil "https://github.com/microsoft/embeddedteamschat/blob/main/wwwroot/src/Utils/GraphUtil.ts"
click node_chatmodels "https://github.com/microsoft/embeddedteamschat/blob/main/wwwroot/src/Models/ChatMessage.ts"
click node_mappingui "https://github.com/microsoft/embeddedteamschat/blob/main/wwwroot/src/Models/Mapping.ts"
click node_notifyinterface "https://github.com/microsoft/embeddedteamschat/blob/main/wwwroot/src/NotificationClients/INotificationClient.ts"
click node_graphnotify "https://github.com/microsoft/embeddedteamschat/blob/main/wwwroot/src/NotificationClients/GraphNotificationClient.ts"
click node_acsnotify "https://github.com/microsoft/embeddedteamschat/blob/main/wwwroot/src/NotificationClients/AcsMeetingNotificationClient.ts"
click node_mappingapi "https://github.com/microsoft/embeddedteamschat/blob/main/Controllers/MappingController.cs"
click node_mappingrepo "https://github.com/microsoft/embeddedteamschat/blob/main/Repositories/MappingRepository.cs"
click node_tokenapi "https://github.com/microsoft/embeddedteamschat/blob/main/Controllers/AcsTokenController.cs"
click node_acsservice "https://github.com/microsoft/embeddedteamschat/blob/main/Services/AcsService.cs"
click node_meetingapi "https://github.com/microsoft/embeddedteamschat/blob/main/Controllers/GraphController.cs"
click node_graphservice "https://github.com/microsoft/embeddedteamschat/blob/main/Services/GraphService.cs"
click node_settings "https://github.com/microsoft/embeddedteamschat/blob/main/Models/AppSettings.cs"
click node_threadinfo "https://github.com/microsoft/embeddedteamschat/blob/main/Models/ThreadInfo.cs"
click node_mappingmodel "https://github.com/microsoft/embeddedteamschat/blob/main/Models/Mapping.cs"

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_entry,node_auth,node_authpage toneBlue
class node_app,node_chatui,node_participantui,node_graphutil,node_chatmodels,node_mappingui,node_mappingstore toneAmber
class node_notifyinterface,node_graphnotify,node_acsnotify toneMint
class node_mappingapi,node_mappingrepo,node_tokenapi,node_acsservice,node_meetingapi,node_graphservice,node_settings,node_threadinfo,node_mappingmodel toneRose
class node_host,node_graph,node_gnb,node_acs toneIndigo
```

## Components

### Embed and auth

- [Embed entry points](https://github.com/microsoft/embeddedteamschat/blob/main/wwwroot/src/EmbedGraph.ts): `wwwroot/src/EmbedGraph.ts`
- [Authentication](https://github.com/microsoft/embeddedteamschat/blob/main/wwwroot/src/Utils/AuthUtil.ts): `wwwroot/src/Utils/AuthUtil.ts`
- [Auth flow](https://github.com/microsoft/embeddedteamschat/blob/main/wwwroot/src/Auth.ts): `wwwroot/src/Auth.ts`

### Chat experience

- [Chat app](https://github.com/microsoft/embeddedteamschat/blob/main/wwwroot/src/Components/App.ts): `wwwroot/src/Components/App.ts`
- [Chat interface](https://github.com/microsoft/embeddedteamschat/blob/main/wwwroot/src/Components/ChatContainer.ts): `wwwroot/src/Components/ChatContainer.ts`
- [Participant picker](https://github.com/microsoft/embeddedteamschat/blob/main/wwwroot/src/Components/AddParticipantDialog.ts): `wwwroot/src/Components/AddParticipantDialog.ts`
- [Graph operations](https://github.com/microsoft/embeddedteamschat/blob/main/wwwroot/src/Utils/GraphUtil.ts): `wwwroot/src/Utils/GraphUtil.ts`
- [Chat and person data](https://github.com/microsoft/embeddedteamschat/blob/main/wwwroot/src/Models/ChatMessage.ts): `wwwroot/src/Models/ChatMessage.ts`
- [Client mapping](https://github.com/microsoft/embeddedteamschat/blob/main/wwwroot/src/Models/Mapping.ts): `wwwroot/src/Models/Mapping.ts`

### Notifications

- [Notification contract](https://github.com/microsoft/embeddedteamschat/blob/main/wwwroot/src/NotificationClients/INotificationClient.ts): `wwwroot/src/NotificationClients/INotificationClient.ts`
- [Graph notifications](https://github.com/microsoft/embeddedteamschat/blob/main/wwwroot/src/NotificationClients/GraphNotificationClient.ts): `wwwroot/src/NotificationClients/GraphNotificationClient.ts`
- [ACS notifications](https://github.com/microsoft/embeddedteamschat/blob/main/wwwroot/src/NotificationClients/AcsMeetingNotificationClient.ts): `wwwroot/src/NotificationClients/AcsMeetingNotificationClient.ts`

### Backend services

- [Mapping API](https://github.com/microsoft/embeddedteamschat/blob/main/Controllers/MappingController.cs): `Controllers/MappingController.cs`
- [Mapping repository](https://github.com/microsoft/embeddedteamschat/blob/main/Repositories/MappingRepository.cs): `Repositories/MappingRepository.cs`
- [ACS token API](https://github.com/microsoft/embeddedteamschat/blob/main/Controllers/AcsTokenController.cs): `Controllers/AcsTokenController.cs`
- [ACS service](https://github.com/microsoft/embeddedteamschat/blob/main/Services/AcsService.cs): `Services/AcsService.cs`
- [Meeting API](https://github.com/microsoft/embeddedteamschat/blob/main/Controllers/GraphController.cs): `Controllers/GraphController.cs`
- [Graph service](https://github.com/microsoft/embeddedteamschat/blob/main/Services/GraphService.cs): `Services/GraphService.cs`
- [App settings](https://github.com/microsoft/embeddedteamschat/blob/main/Models/AppSettings.cs): `Models/AppSettings.cs`
- [Thread details](https://github.com/microsoft/embeddedteamschat/blob/main/Models/ThreadInfo.cs): `Models/ThreadInfo.cs`
- [Backend mapping](https://github.com/microsoft/embeddedteamschat/blob/main/Models/Mapping.cs): `Models/Mapping.cs`

### Other components

- **Host application**
- **Microsoft Graph**
- **Graph notification broker**
- **Azure Communication Services**
- **Azure Table Storage**

## Connections

- Host application → Embed entry points: embeds (evidence: `README.md`)
- Embed entry points → Chat app: renders
- Chat app → Authentication: requests tokens (evidence: `wwwroot/src/Components/App.ts`)
- Authentication → Auth flow: messages (evidence: `wwwroot/src/Utils/AuthUtil.ts`)
- Chat app → Chat interface: renders (evidence: `wwwroot/src/Components/App.ts`)
- Chat interface → Participant picker: opens picker (evidence: `wwwroot/src/Components/ChatContainer.ts`)
- Chat interface → Graph operations: performs operations (evidence: `wwwroot/src/Components/ChatContainer.ts`)
- Graph operations → Microsoft Graph: calls API (evidence: `wwwroot/src/Utils/GraphUtil.ts`)
- Chat interface → Chat and person data: uses data (evidence: `wwwroot/src/Components/ChatContainer.ts`)
- Chat app → Client mapping: uses mapping (evidence: `wwwroot/src/Components/App.ts`)
- Chat app → Notification contract: starts notifications (evidence: `wwwroot/src/Components/App.ts`)
- Graph notifications → Notification contract: implements (evidence: `wwwroot/src/NotificationClients/GraphNotificationClient.ts`)
- ACS notifications → Notification contract: implements (evidence: `wwwroot/src/NotificationClients/AcsMeetingNotificationClient.ts`)
- Graph notifications → Graph notification broker: subscribes
- ACS notifications → Azure Communication Services: uses notifications
- Mapping API → Mapping repository: reads and writes (evidence: `Controllers/MappingController.cs`)
- Mapping repository → Azure Table Storage: reads and writes (evidence: `Repositories/MappingRepository.cs`)
- Mapping repository → Backend mapping: converts (evidence: `Repositories/MappingRepository.cs`)
- ACS token API → ACS service: requests token (evidence: `Controllers/AcsTokenController.cs`)
- Meeting API → Graph service: creates meeting (evidence: `Controllers/GraphController.cs`)
- Graph service → Microsoft Graph: creates online meeting (evidence: `Services/GraphService.cs`)
- Graph service → Thread details: uses details (evidence: `Services/GraphService.cs`)
- Graph service → App settings: reads configuration (evidence: `Services/GraphService.cs`)
- Backend mapping → Thread details: contains details (evidence: `Models/Mapping.cs`)
