How itzap77/chathubtrial works
This is a browser-based chat application with accounts, persistent rooms and direct messages, temporary spaces, file sharing, presence, and WebRTC signaling. Users authenticate in the web client, choose or create a conversation, then exchange messages over WebSockets or room APIs; messages and account state persist in SQLite, while connection and temporary-room state is in memory. The graph connects sampled routes and services to their callers where evidence is available. Several client capabilities are README-absent and source references do not reveal their wiring, so those links are omitted.
Main entry points: main.py FastAPI application · messages_repo.py Message repository · auth.py Session and passwords · db.py SQLite database
Components 29
Browser client
- Chat interface
static/index.html - Client coordinator
static/js/app.js - Account client
static/js/auth.js - Messaging client
static/js/chat.js - Room client
static/js/rooms.js - People directory
static/js/directory.js - Notifications
static/js/notifications.js - Ephemeral client
static/js/ephemeral.js - Client cryptography
static/js/crypto.js - Call client
static/js/webrtc.js - UI shell
static/js/ui-shell.js - Client utilities
static/js/utils.js
HTTP and realtime API
- FastAPI application
app/main.py - WebSocket handler
app/ws.py - Static and upload serving
app/static_files.py
Chat capabilities
- Account routes
app/routes/auth_routes.py - User routes
app/routes/users.py - Room management
app/routes/rooms.py - DM and ephemeral routes
app/routes/dm.py - Upload routes
app/routes/uploads.py - Message history route
app/routes/messages.py - Room connections
app/connection_manager.py
Persistence and identity
- Session and passwords
app/auth.py - Message repository
app/messages_repo.py - Profile repository
app/profile_repo.py - SQLite database
app/db.py - Runtime configuration
app/config.py - Chat identifiers
app/utils.py
Other components
- Chat user
Connections 41
- Chat user → Chat interface: uses
- Chat interface → Client coordinator: loads
- Client coordinator → FastAPI application: requests
- FastAPI application → Account routes: registers
app/main.py - FastAPI application → User routes: registers
app/main.py - FastAPI application → DM and ephemeral routes: registers
app/main.py - FastAPI application → Room management: registers
app/main.py - FastAPI application → Upload routes: registers
app/main.py - FastAPI application → Message history route: registers
app/main.py - FastAPI application → WebSocket handler: registers
app/main.py - FastAPI application → Static and upload serving: mounts
app/main.py - FastAPI application → SQLite database: initializes
app/main.py - Account routes → Session and passwords: authenticates
app/routes/auth_routes.py - Account routes → SQLite database: reads and writes
app/routes/auth_routes.py - User routes → Session and passwords: authenticates
app/routes/users.py - User routes → Profile repository: reads
app/routes/users.py - Room management → Session and passwords: authenticates
app/routes/rooms.py - Room management → Room connections: checks presence
app/routes/rooms.py - Room management → Message repository: uses history
app/routes/rooms.py - DM and ephemeral routes → Session and passwords: authenticates
app/routes/dm.py - DM and ephemeral routes → Room connections: notifies
app/routes/dm.py - DM and ephemeral routes → SQLite database: reads and writes
app/routes/dm.py - Upload routes → Session and passwords: authenticates
app/routes/uploads.py - Upload routes → Room connections: notifies
app/routes/uploads.py - Upload routes → Message repository: stores metadata
app/routes/uploads.py - Message history route → Message repository: loads
app/routes/messages.py - WebSocket handler → Session and passwords: authenticates
app/ws.py - WebSocket handler → Room connections: dispatches events
app/ws.py - WebSocket handler → Message repository: saves and reads
app/ws.py - Room connections → Message repository: loads history
app/connection_manager.py - Room connections → SQLite database: checks membership
app/connection_manager.py - Message repository → SQLite database: reads and writes
app/messages_repo.py - Message repository → Profile repository: looks up names
app/messages_repo.py - Profile repository → SQLite database: reads
app/profile_repo.py - Session and passwords → SQLite database: reads and writes
app/auth.py - Account client → Account routes: calls account API
- Messaging client → WebSocket handler: exchanges chat events
- Room client → Room management: calls room API
- People directory → User routes: calls user API
- Ephemeral client → DM and ephemeral routes: calls ephemeral API
- Call client → WebSocket handler: signals calls