# oa-ek/c-sharp-net-dealing-whisper architecture

> Architecture diagram of the GitHub repository oa-ek/c-sharp-net-dealing-whisper, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/oa-ek/c-sharp-net-dealing-whisper
- Repository: https://github.com/oa-ek/c-sharp-net-dealing-whisper

## Overview

Whisper is a web-based secure messenger designed for end-to-end encrypted, real-time conversations. The main workflow is client-side key generation and registration, authenticated chat access, message encryption and socket delivery, then server-side authorization, persistence, and delivery to chat participants. The repository also includes device/key management, profiles, media and attachment handling, reactions, admin statistics, and emoji/GIF integrations. Source excerpts verify selected routes and service calls; several feature implementations are identified from the tree and README, so their unverified connections are dashed.

Main entry points: [`src/Whisper.Client/src/services/authService.ts`](https://github.com/oa-ek/c-sharp-net-dealing-whisper/blob/main/src/Whisper.Client/src/services/authService.ts) (Auth service), [`src/Whisper.Client/src/features/chats/components/ChatWindow.tsx`](https://github.com/oa-ek/c-sharp-net-dealing-whisper/blob/main/src/Whisper.Client/src/features/chats/components/ChatWindow.tsx) (Chat interface), [`src/Whisper.Client/src/services/ChatSocketService.ts`](https://github.com/oa-ek/c-sharp-net-dealing-whisper/blob/main/src/Whisper.Client/src/services/ChatSocketService.ts) (Socket client), [`src/Whisper.Client/src/api/agent.ts`](https://github.com/oa-ek/c-sharp-net-dealing-whisper/blob/main/src/Whisper.Client/src/api/agent.ts) (API agent)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client experience"]
  node_authui["Auth screens<br/>[Login.tsx]"]
  node_authclient["Auth service<br/>[authService.ts]"]
  node_cryptoclient["Client cryptography<br/>[cryptoService.ts]"]
  node_localdb[("Local key store<br/>[db.ts]")]
  node_chatui["Chat interface<br/>[ChatWindow.tsx]"]
  node_socketclient["Socket client"]
  node_encrypt["Message encryption"]
  node_httpclient["API agent<br/>[agent.ts]"]
end

subgraph group_api["API and realtime"]
  node_chatapi["Chat endpoints<br/>[ChatsController.cs]"]
  node_authapi["Auth endpoints<br/>[AuthController.cs]"]
  node_ws["Chat hub"]
  node_userapi["User endpoints<br/>[UsersController.cs]"]
  node_keyapi["Key endpoints<br/>[KeysController.cs]"]
  node_mediaapi["Media endpoints<br/>[MediaController.cs]"]
end

subgraph group_application["Application services"]
  node_appauth["Authentication service<br/>[AuthService.cs]"]
  node_chatservice["Chat service<br/>[ChatService.cs]"]
  node_messageservice["Message service<br/>[MessageService.cs]"]
  node_keyservice["Key management"]
  node_extras["Product features<br/>[Services]"]
end

subgraph group_storage["Persistence and integrations"]
  node_pg[("Relational data<br/>[AppDbContext.cs]")]
  node_mongomsg[("Message store")]
  node_media["Object storage<br/>[MediaService.cs]"]
  node_emoji["Emoji and GIF APIs<br/>[EmojiService.cs]"]
  node_gifservice["GIF integration<br/>[KlipyService.cs]"]
end

node_user(("Messenger user"))
node_external(("External services"))

node_user -.->|"starts session"| node_authui
node_authui -.->|"registers"| node_authclient
node_authclient -->|"generates keys"| node_cryptoclient
node_authclient -->|"submits registration"| node_httpclient
node_authclient -->|"stores credentials"| node_localdb
node_user -.->|"uses chats"| node_chatui
node_chatui -.->|"encrypts messages"| node_encrypt
node_socketclient -->|"uses encryption"| node_encrypt
node_chatui -.->|"sends and receives"| node_socketclient
node_socketclient -.->|"connects realtime"| node_ws
node_httpclient -.->|"calls auth"| node_authapi
node_httpclient -.->|"calls chat API"| node_chatapi
node_authapi -->|"delegates"| node_appauth
node_appauth -.->|"persists accounts"| node_pg
node_chatapi -->|"delegates"| node_chatservice
node_ws -->|"handles messages"| node_messageservice
node_messageservice -.->|"stores messages"| node_mongomsg
node_chatservice -.->|"counts unread"| node_mongomsg
node_userapi -.->|"serves profiles"| node_extras
node_keyapi -.->|"manages keys"| node_keyservice
node_keyservice -.->|"stores key records"| node_pg
node_mediaapi -.->|"delegates media"| node_media
node_media -.->|"stores files"| node_external
node_emoji -.->|"queries emoji"| node_external
node_gifservice -.->|"queries GIFs"| node_external
node_user -.->|"uses extras"| node_extras

click node_authui "https://github.com/oa-ek/c-sharp-net-dealing-whisper/blob/main/src/Whisper.Client/src/features/auth/Login.tsx"
click node_authclient "https://github.com/oa-ek/c-sharp-net-dealing-whisper/blob/main/src/Whisper.Client/src/services/authService.ts"
click node_cryptoclient "https://github.com/oa-ek/c-sharp-net-dealing-whisper/blob/main/src/Whisper.Client/src/services/cryptoService.ts"
click node_localdb "https://github.com/oa-ek/c-sharp-net-dealing-whisper/blob/main/src/Whisper.Client/src/api/db.ts"
click node_chatui "https://github.com/oa-ek/c-sharp-net-dealing-whisper/blob/main/src/Whisper.Client/src/features/chats/components/ChatWindow.tsx"
click node_socketclient "https://github.com/oa-ek/c-sharp-net-dealing-whisper/blob/main/src/Whisper.Client/src/services/ChatSocketService.ts"
click node_encrypt "https://github.com/oa-ek/c-sharp-net-dealing-whisper/blob/main/src/Whisper.Client/src/services/encryptionService.ts"
click node_httpclient "https://github.com/oa-ek/c-sharp-net-dealing-whisper/blob/main/src/Whisper.Client/src/api/agent.ts"
click node_chatapi "https://github.com/oa-ek/c-sharp-net-dealing-whisper/blob/main/src/Whisper.Server/Whisper.API/Controllers/ChatsController.cs"
click node_authapi "https://github.com/oa-ek/c-sharp-net-dealing-whisper/blob/main/src/Whisper.Server/Whisper.API/Controllers/AuthController.cs"
click node_ws "https://github.com/oa-ek/c-sharp-net-dealing-whisper/blob/main/src/Whisper.Server/Whisper.API/Controllers/WSChatController.cs"
click node_userapi "https://github.com/oa-ek/c-sharp-net-dealing-whisper/blob/main/src/Whisper.Server/Whisper.API/Controllers/UsersController.cs"
click node_keyapi "https://github.com/oa-ek/c-sharp-net-dealing-whisper/blob/main/src/Whisper.Server/Whisper.API/Controllers/KeysController.cs"
click node_mediaapi "https://github.com/oa-ek/c-sharp-net-dealing-whisper/blob/main/src/Whisper.Server/Whisper.API/Controllers/MediaController.cs"
click node_appauth "https://github.com/oa-ek/c-sharp-net-dealing-whisper/blob/main/src/Whisper.Server/Whisper.Application/Services/AuthService.cs"
click node_chatservice "https://github.com/oa-ek/c-sharp-net-dealing-whisper/blob/main/src/Whisper.Server/Whisper.Application/Services/ChatService.cs"
click node_messageservice "https://github.com/oa-ek/c-sharp-net-dealing-whisper/blob/main/src/Whisper.Server/Whisper.Application/Services/MessageService.cs"
click node_keyservice "https://github.com/oa-ek/c-sharp-net-dealing-whisper/blob/main/src/Whisper.Server/Whisper.Application/Services/OneTimePreKeyService.cs"
click node_extras "https://github.com/oa-ek/c-sharp-net-dealing-whisper/tree/main/src/Whisper.Server/Whisper.Application/Services"
click node_pg "https://github.com/oa-ek/c-sharp-net-dealing-whisper/blob/main/src/Whisper.Server/Whisper.Persistence/Context/AppDbContext.cs"
click node_mongomsg "https://github.com/oa-ek/c-sharp-net-dealing-whisper/blob/main/src/Whisper.Server/Whisper.Persistence/Repositories/MessageRepository.cs"
click node_media "https://github.com/oa-ek/c-sharp-net-dealing-whisper/blob/main/src/Whisper.Server/Whisper.Application/Services/MediaService.cs"
click node_emoji "https://github.com/oa-ek/c-sharp-net-dealing-whisper/blob/main/src/Whisper.Server/Whisper.Application/Services/EmojiService.cs"
click node_gifservice "https://github.com/oa-ek/c-sharp-net-dealing-whisper/blob/main/src/Whisper.Server/Whisper.Application/Services/KlipyService.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_authui,node_authclient,node_cryptoclient,node_localdb,node_chatui,node_socketclient,node_encrypt,node_httpclient,node_user toneBlue
class node_chatapi,node_authapi,node_ws,node_userapi,node_keyapi,node_mediaapi toneAmber
class node_appauth,node_chatservice,node_messageservice,node_keyservice,node_extras toneMint
class node_pg,node_mongomsg,node_media,node_emoji,node_gifservice toneRose
class node_external toneIndigo
```

## Components

### Client experience

- [Auth screens](https://github.com/oa-ek/c-sharp-net-dealing-whisper/blob/main/src/Whisper.Client/src/features/auth/Login.tsx): `src/Whisper.Client/src/features/auth/Login.tsx`
- [Auth service](https://github.com/oa-ek/c-sharp-net-dealing-whisper/blob/main/src/Whisper.Client/src/services/authService.ts): `src/Whisper.Client/src/services/authService.ts`
- [Client cryptography](https://github.com/oa-ek/c-sharp-net-dealing-whisper/blob/main/src/Whisper.Client/src/services/cryptoService.ts): `src/Whisper.Client/src/services/cryptoService.ts`
- [Local key store](https://github.com/oa-ek/c-sharp-net-dealing-whisper/blob/main/src/Whisper.Client/src/api/db.ts): `src/Whisper.Client/src/api/db.ts`
- [Chat interface](https://github.com/oa-ek/c-sharp-net-dealing-whisper/blob/main/src/Whisper.Client/src/features/chats/components/ChatWindow.tsx): `src/Whisper.Client/src/features/chats/components/ChatWindow.tsx`
- [Socket client](https://github.com/oa-ek/c-sharp-net-dealing-whisper/blob/main/src/Whisper.Client/src/services/ChatSocketService.ts): `src/Whisper.Client/src/services/ChatSocketService.ts`
- [Message encryption](https://github.com/oa-ek/c-sharp-net-dealing-whisper/blob/main/src/Whisper.Client/src/services/encryptionService.ts): `src/Whisper.Client/src/services/encryptionService.ts`
- [API agent](https://github.com/oa-ek/c-sharp-net-dealing-whisper/blob/main/src/Whisper.Client/src/api/agent.ts): `src/Whisper.Client/src/api/agent.ts`

### API and realtime

- [Chat endpoints](https://github.com/oa-ek/c-sharp-net-dealing-whisper/blob/main/src/Whisper.Server/Whisper.API/Controllers/ChatsController.cs): `src/Whisper.Server/Whisper.API/Controllers/ChatsController.cs`
- [Auth endpoints](https://github.com/oa-ek/c-sharp-net-dealing-whisper/blob/main/src/Whisper.Server/Whisper.API/Controllers/AuthController.cs): `src/Whisper.Server/Whisper.API/Controllers/AuthController.cs`
- [Chat hub](https://github.com/oa-ek/c-sharp-net-dealing-whisper/blob/main/src/Whisper.Server/Whisper.API/Controllers/WSChatController.cs): `src/Whisper.Server/Whisper.API/Controllers/WSChatController.cs`
- [User endpoints](https://github.com/oa-ek/c-sharp-net-dealing-whisper/blob/main/src/Whisper.Server/Whisper.API/Controllers/UsersController.cs): `src/Whisper.Server/Whisper.API/Controllers/UsersController.cs`
- [Key endpoints](https://github.com/oa-ek/c-sharp-net-dealing-whisper/blob/main/src/Whisper.Server/Whisper.API/Controllers/KeysController.cs): `src/Whisper.Server/Whisper.API/Controllers/KeysController.cs`
- [Media endpoints](https://github.com/oa-ek/c-sharp-net-dealing-whisper/blob/main/src/Whisper.Server/Whisper.API/Controllers/MediaController.cs): `src/Whisper.Server/Whisper.API/Controllers/MediaController.cs`

### Application services

- [Authentication service](https://github.com/oa-ek/c-sharp-net-dealing-whisper/blob/main/src/Whisper.Server/Whisper.Application/Services/AuthService.cs): `src/Whisper.Server/Whisper.Application/Services/AuthService.cs`
- [Chat service](https://github.com/oa-ek/c-sharp-net-dealing-whisper/blob/main/src/Whisper.Server/Whisper.Application/Services/ChatService.cs): `src/Whisper.Server/Whisper.Application/Services/ChatService.cs`
- [Message service](https://github.com/oa-ek/c-sharp-net-dealing-whisper/blob/main/src/Whisper.Server/Whisper.Application/Services/MessageService.cs): `src/Whisper.Server/Whisper.Application/Services/MessageService.cs`
- [Key management](https://github.com/oa-ek/c-sharp-net-dealing-whisper/blob/main/src/Whisper.Server/Whisper.Application/Services/OneTimePreKeyService.cs): `src/Whisper.Server/Whisper.Application/Services/OneTimePreKeyService.cs`
- [Product features](https://github.com/oa-ek/c-sharp-net-dealing-whisper/tree/main/src/Whisper.Server/Whisper.Application/Services): `src/Whisper.Server/Whisper.Application/Services`

### Persistence and integrations

- [Relational data](https://github.com/oa-ek/c-sharp-net-dealing-whisper/blob/main/src/Whisper.Server/Whisper.Persistence/Context/AppDbContext.cs): `src/Whisper.Server/Whisper.Persistence/Context/AppDbContext.cs`
- [Message store](https://github.com/oa-ek/c-sharp-net-dealing-whisper/blob/main/src/Whisper.Server/Whisper.Persistence/Repositories/MessageRepository.cs): `src/Whisper.Server/Whisper.Persistence/Repositories/MessageRepository.cs`
- [Object storage](https://github.com/oa-ek/c-sharp-net-dealing-whisper/blob/main/src/Whisper.Server/Whisper.Application/Services/MediaService.cs): `src/Whisper.Server/Whisper.Application/Services/MediaService.cs`
- [Emoji and GIF APIs](https://github.com/oa-ek/c-sharp-net-dealing-whisper/blob/main/src/Whisper.Server/Whisper.Application/Services/EmojiService.cs): `src/Whisper.Server/Whisper.Application/Services/EmojiService.cs`
- [GIF integration](https://github.com/oa-ek/c-sharp-net-dealing-whisper/blob/main/src/Whisper.Server/Whisper.Application/Services/KlipyService.cs): `src/Whisper.Server/Whisper.Application/Services/KlipyService.cs`

### Other components

- **Messenger user**
- **External services**

## Connections

- Messenger user → Auth screens: starts session
- Auth screens → Auth service: registers
- Auth service → Client cryptography: generates keys (evidence: `src/Whisper.Client/src/services/authService.ts`)
- Auth service → API agent: submits registration (evidence: `src/Whisper.Client/src/services/authService.ts`)
- Auth service → Local key store: stores credentials (evidence: `src/Whisper.Client/src/services/authService.ts`)
- Messenger user → Chat interface: uses chats
- Chat interface → Message encryption: encrypts messages
- Socket client → Message encryption: uses encryption (evidence: `src/Whisper.Client/src/services/ChatSocketService.ts`)
- Chat interface → Socket client: sends and receives
- Socket client → Chat hub: connects realtime
- API agent → Auth endpoints: calls auth
- API agent → Chat endpoints: calls chat API (evidence: `src/Whisper.Client/src/api/agent.ts`)
- Auth endpoints → Authentication service: delegates (evidence: `src/Whisper.Server/Whisper.API/Controllers/AuthController.cs`)
- Authentication service → Relational data: persists accounts
- Chat endpoints → Chat service: delegates (evidence: `src/Whisper.Server/Whisper.API/Controllers/ChatsController.cs`)
- Chat hub → Message service: handles messages (evidence: `src/Whisper.Server/Whisper.API/Controllers/WSChatController.cs`)
- Message service → Message store: stores messages (evidence: `src/Whisper.Server/Whisper.Application/Services/MessageService.cs`)
- Chat service → Message store: counts unread (evidence: `src/Whisper.Server/Whisper.Application/Services/ChatService.cs`)
- User endpoints → Product features: serves profiles (evidence: `src/Whisper.Server/Whisper.API/Controllers/UsersController.cs`)
- Key endpoints → Key management: manages keys
- Key management → Relational data: stores key records
- Media endpoints → Object storage: delegates media
- Object storage → External services: stores files
- Emoji and GIF APIs → External services: queries emoji
- GIF integration → External services: queries GIFs
- Messenger user → Product features: uses extras
