How yamaan18/chatlive works
LiveChat is a browser-based, shared-room chat application. A user enters a username, the browser opens a WebSocket to FastAPI, and the server tracks connections and broadcasts chat messages, join/leave notices, and online counts. The browser renders those events and sends typed or emoji messages over the same socket. The README also describes a responsive dark-themed interface; its template and stylesheet are present in the tree but were not sampled, so their detailed responsibilities and links are limited to documented behavior.
Main entry points: script.js WebSocket client · index.html Chat page · main.py Connection manager · style.css Responsive dark theme
Components 10
Browser chat
- Join and profile UI
Static/script.js - Chat rendering
Static/script.js - WebSocket client
Static/script.js - Chat page
templates/index.html - Responsive dark theme
Static/style.css
Chat server
- Page route
main.py - WebSocket endpoint
main.py - Connection manager
main.py - Active connections
main.py
Other components
- Chat participant
Connections 13
- Chat participant → Join and profile UI: enters username
README.md - Join and profile UI → WebSocket client: opens socket
Static/script.js - WebSocket client → WebSocket endpoint: connects and sends
Static/script.js - WebSocket endpoint → Connection manager: registers and broadcasts
main.py - Connection manager → Active connections: tracks connections
main.py - WebSocket endpoint → Connection manager: reads user count
main.py - Connection manager → WebSocket client: broadcasts JSON
main.py - WebSocket client → Chat rendering: passes received events
Static/script.js - Chat rendering → Chat participant: renders messages and status
Static/script.js - Chat participant → Chat page: requests chat page
README.md - Page route → Chat page: serves page
main.py - Chat page → WebSocket client: loads client logic
- Chat page → Responsive dark theme: uses styles