How kaushikcodes-112/chat_application_using_websockets works
Back Rooms is a room-based, real-time chat application. A user creates a room or submits a room ID and alias; after the backend authorizes the join, the app opens the chat view, fetches active users, and connects by WebSocket. Chat messages, typing notifications, and join/leave events are broadcast to room participants. The backend keeps room membership and sockets in memory. Source excerpts support the frontend-to-backend calls and the backend's manager operations; no persistent database is shown.
Main entry points: new_main.py Room HTTP routes · AccessPortal.jsx Room access portal · ChatArea.jsx Chat view · App.jsx Screen coordinator
Components 12
Chat client
- React entry
frontend/Chat_app/src/main.jsx - Screen coordinator
frontend/Chat_app/src/App.jsx - Room access portal
frontend/Chat_app/src/components/AccessPortal.jsx - Loading screen
frontend/Chat_app/src/components/LoadingScreen.jsx - Chat view
frontend/Chat_app/src/components/ChatArea.jsx - Room roster
frontend/Chat_app/src/components/Sidebar.jsx - WebSocket client
frontend/Chat_app/src/hooks/useChatWebSocket.js
Chat backend
- Room HTTP routes
backend/new_main.py - Room code generator
backend/check_secrets.py
Room messaging
- Room registry
backend/new_main.py - WebSocket route
backend/new_main.py
Other components
- Room participant
Connections 15
- Room participant → Room access portal: uses
frontend/Chat_app/src/components/AccessPortal.jsx - React entry → Screen coordinator: renders
frontend/Chat_app/src/main.jsx - Screen coordinator → Room access portal: renders
frontend/Chat_app/src/App.jsx - Screen coordinator → Chat view: renders
frontend/Chat_app/src/App.jsx - Room access portal → Loading screen: renders
frontend/Chat_app/src/components/AccessPortal.jsx - Room access portal → Room HTTP routes: requests registration
frontend/Chat_app/src/components/AccessPortal.jsx - Room access portal → Room HTTP routes: requests room creation
frontend/Chat_app/src/components/AccessPortal.jsx - Room HTTP routes → Room registry: checks room membership
backend/new_main.py - Room HTTP routes → Room code generator: requests room code
backend/new_main.py - Chat view → Room roster: renders
frontend/Chat_app/src/components/ChatArea.jsx - Chat view → Room HTTP routes: fetches occupants
frontend/Chat_app/src/components/ChatArea.jsx - Chat view → WebSocket client: sends chat and typing
frontend/Chat_app/src/components/ChatArea.jsx - WebSocket client → WebSocket route: opens WebSocket
frontend/Chat_app/src/hooks/useChatWebSocket.js - WebSocket route → Room registry: connects and broadcasts
backend/new_main.py - Room HTTP routes → Room registry: creates rooms and lists users
backend/new_main.py