How mingstar556/telegramcopy works
This is a self-hosted Telegram customer-support chat and bot-operator platform. An employee logs in to a bot-specific account, loads or syncs its conversations, and sends messages or media; the backend persists chat state and communicates with Telegram, while WebSockets provide live updates across devices. The frontend also provides private Saved Messages, AI chat summaries, session/account controls, audio tools, and theme settings. Several backend routes and frontend components are represented from the README and source index rather than inspected implementations, so those links are documented or omitted accordingly.
Main entry points: App.tsx Application Shell · ChatContext.tsx Conversation State · AuthContext.tsx Authentication State · ChatArea.tsx Chat Interface
Components 23
Web Client
- Application Shell
front-end/src/App.tsx - Login
front-end/src/components/auth/LoginModal.tsx - Chat Interface
front-end/src/components/layout/ChatArea.tsx - Conversation Sidebar
front-end/src/components/layout/Sidebar.tsx - Messaging Controls
front-end/src/components/chat/ChatBar.tsx - Message Rendering
front-end/src/components/chat/MessageList.tsx - Saved Messages
front-end/src/components/special/SpecialView.tsx - Chat Summary
front-end/src/components/chat/ChatSummaryModal.tsx - Media and Audio
front-end/src/services/audioRecorder.ts - Account Settings
front-end/src/components/modals/SettingsModal.tsx
Client State
- Authentication State
front-end/src/contexts/AuthContext.tsx - Conversation State
front-end/src/contexts/ChatContext.tsx - Theme Settings
front-end/src/contexts/ThemeContext.tsx - REST API Client
front-end/src/services/api.ts - WebSocket Client
front-end/src/services/websocket.ts
Django Backend
- Django REST Endpoints
backend/telegram_chat/views.py - WebSocket Consumer
backend/telegram_chat/consumers.py - WebSocket Routing
backend/telegram_chat/routing.py
Telegram Integration
- Bot Sync and Dispatch
backend/telegram_chat/bot_service.py
Persistent Data
- Chat and Account Records
backend/telegram_chat/models.py
Other components
- Employee
- Telegram Bot API
- AI Summary Service
Connections 29
- Employee → Application Shell: opens
README.md - Application Shell → Authentication State: checks auth
front-end/src/App.tsx - Application Shell → Conversation State: reads chat state
front-end/src/App.tsx - Application Shell → Login: shows login
front-end/src/App.tsx - Application Shell → Chat Interface: shows chat
front-end/src/App.tsx - Application Shell → Conversation Sidebar: shows conversations
front-end/src/App.tsx - Application Shell → Saved Messages: shows saved view
front-end/src/App.tsx - Login → Authentication State: submits credentials
front-end/src/components/auth/LoginModal.tsx - Chat Interface → Messaging Controls: renders
front-end/src/components/layout/ChatArea.tsx - Chat Interface → Message Rendering: renders
front-end/src/components/layout/ChatArea.tsx - Chat Interface → Chat Summary: opens summary
README.md - Messaging Controls → Conversation State: sends messages
- Conversation State → Authentication State: reads account
front-end/src/contexts/ChatContext.tsx - Conversation State → REST API Client: loads and sends
front-end/src/contexts/ChatContext.tsx - Conversation State → WebSocket Client: receives and sends
front-end/src/contexts/ChatContext.tsx - Conversation State → Media and Audio: creates voice audio
front-end/src/contexts/ChatContext.tsx - Authentication State → REST API Client: authenticates
front-end/src/contexts/AuthContext.tsx - Authentication State → WebSocket Client: connects session
front-end/src/contexts/AuthContext.tsx - Account Settings → Authentication State: updates account
front-end/src/components/modals/SettingsModal.tsx - Account Settings → Theme Settings: updates preferences
front-end/src/components/modals/SettingsModal.tsx - Saved Messages → Conversation State: uses chat state
front-end/src/components/special/SpecialView.tsx - Chat Summary → AI Summary Service: requests summary
README.md - REST API Client → Django REST Endpoints: calls REST endpoints
README.md - WebSocket Client → WebSocket Routing: opens socket
README.md - WebSocket Routing → WebSocket Consumer: routes connection
backend/telegram_chat/routing.py - Django REST Endpoints → Bot Sync and Dispatch: syncs and dispatches
- Bot Sync and Dispatch → Telegram Bot API: polls and sends
backend/telegram_chat/bot_service.py - Bot Sync and Dispatch → Chat and Account Records: stores messages
backend/telegram_chat/bot_service.py - WebSocket Consumer → Chat and Account Records: uses chat records
backend/telegram_chat/consumers.py