How ajaxy/telegram-tt works
Telegram Web A is Telegram’s browser client, built around a custom Teact UI and a custom GramJS MTProto implementation. The principal workflow is opening the client, rendering the application, maintaining shared state, and communicating with Telegram; incoming updates are reconciled through the update manager. The tree also shows distinct chat, messaging, media, calls, settings, and instant-view areas. Some feature-level wiring is not shown in the excerpts, so those connections are omitted or marked unverified rather than inferred from folder names.
Main entry points: Main.tsx Main interface · index.tsx Application entry · updateManager.ts Update manager · TelegramClient.ts MTProto client
Components 17
Client application
- Application entry
src/index.tsx - Main interface
src/components/main/Main.tsx
User features
- Chat navigation
src/components/left/main/ChatList.tsx - Message interactions
src/components/middle/message/hooks/useInnerHandlers.ts - Voice and video calls
src/components/calls - Settings
src/components/left/settings/Settings.tsx - Instant View
src/components/iv
Telegram transport
- Telegram API methods
src/api/gramjs/methods - MTProto client
src/lib/gramjs/client/TelegramClient.ts - Update manager
src/api/gramjs/updates/updateManager.ts - Entity processor
src/api/gramjs/updates/entityProcessor.ts - Local API database
src/api/gramjs/localDb.ts
Runtime foundations
- Shared state
src/global/index.ts - Teact runtime
src/lib/teact/teact.ts - DOM renderer
src/lib/teact/teact-dom.ts
Other components
- Telegram user
- Telegram service
Connections 17
- Telegram user → Application entry: opens client
README.md - Application entry → Shared state: initializes state
src/index.tsx - Application entry → DOM renderer: uses renderer
src/index.tsx - Application entry → Main interface: loads interface
- Main interface → Chat navigation
- Main interface → Message interactions
- Main interface → Voice and video calls
- Main interface → Settings
- Main interface → Instant View
- Application entry → Teact runtime: uses runtime
src/index.tsx - Teact runtime → DOM renderer: renders through
src/lib/teact/teact.ts - MTProto client → Telegram service: exchanges MTProto
README.md - MTProto client → Update manager: handles updates
src/lib/gramjs/client/TelegramClient.ts - Update manager → Entity processor: processes entities
src/api/gramjs/updates/updateManager.ts - Update manager → Local API database: reads update state
src/api/gramjs/updates/updateManager.ts - Telegram API methods → MTProto client
- Shared state → Telegram API methods