How omprakash20071125-a11y/nexuschat works
NexusChat is a browser-based real-time messaging application supporting direct and group conversations. The main workflow is browser REST or Socket.IO requests, routed through authentication and chat handlers, then validated and persisted; live messages are additionally broadcast to conversation rooms. The graph preserves account management, conversation membership and management, message history/search/read status, and the browser client. Relationship evidence comes from the README and shown source excerpts; unsampled frontend behavior is represented only as documented.
Main entry points: db.py Database sessions · events.py Socket event handlers · user/controller.py Account and auth logic · chat/controller.py Conversation and message logic
Components 18
Browser client
- Web client
app.html
REST API and accounts
- ASGI application
main.py - User routes
src/user/router.py - Account and auth logic
src/user/controller.py - User schemas
src/user/dtos.py - Bearer authentication
src/utils/helpers.py - User model
src/user/models.py
Conversations and messaging
- Chat routes
src/chat/router.py - Conversation and message logic
src/chat/controller.py - Chat schemas
src/chat/dtos.py - Conversation and message models
src/chat/models.py
Real-time delivery
- Socket.IO ASGI server
src/realtime/socket_server.py - Socket event handlers
src/realtime/events.py
Persistence and configuration
- Database sessions
src/utils/db.py - SQL database
- Runtime settings
src/utils/settings.py - Registration email sender
src/utils/mail.py
Other components
- Browser user
Connections 31
- Browser user → Web client: uses
Readme.md - Web client → ASGI application: REST requests
Readme.md - Web client → Socket.IO ASGI server: Socket.IO connects
Readme.md - ASGI application → User routes: mounts
main.py - ASGI application → Chat routes: mounts
main.py - ASGI application → Socket.IO ASGI server: wraps ASGI
main.py - User routes → Account and auth logic: calls
src/user/router.py - User routes → Bearer authentication: depends on
src/user/router.py - User routes → User schemas: validates with
src/user/router.py - Account and auth logic → User model: queries and creates
src/user/controller.py - Account and auth logic → Runtime settings: reads token settings
src/user/controller.py - Bearer authentication → User model: loads user
src/utils/helpers.py - Bearer authentication → Runtime settings: reads token settings
src/utils/helpers.py - Chat routes → Conversation and message logic: calls
src/chat/router.py - Chat routes → Bearer authentication: depends on
src/chat/router.py - Chat routes → Chat schemas: validates with
src/chat/router.py - Conversation and message logic → Conversation and message models: queries and writes
src/chat/controller.py - Conversation and message logic → User model: loads participants
src/chat/controller.py - Socket.IO ASGI server → Socket event handlers: registers handlers
src/realtime/events.py - Socket event handlers → Conversation and message logic: saves messages
src/realtime/events.py - Socket event handlers → User model: loads connected user
src/realtime/events.py - Socket event handlers → Chat schemas: builds message DTO
src/realtime/events.py - Socket event handlers → Socket.IO ASGI server: broadcasts to room
src/realtime/events.py - Account and auth logic → Database sessions: uses DB dependency
- Conversation and message logic → Database sessions: uses DB session
- Socket event handlers → Database sessions: opens session
src/realtime/events.py - Database sessions → SQL database: connects
src/utils/db.py - Conversation and message models → Database sessions: uses declarative base
src/chat/models.py - User model → Database sessions: uses declarative base
src/user/models.py - Database sessions → Runtime settings: reads connection setting
src/utils/db.py - Account and auth logic → Registration email sender: optional mail task
src/user/controller.py