Initialization
Socket server is initialized in `socket/index.js` via `initializeSocketIO(server)` from `app.js`.
Backend Documentation
Socket.IO runtime structure and chat event handling across user and agent channels.
Socket server is initialized in `socket/index.js` via `initializeSocketIO(server)` from `app.js`.
Handler modules include bot, conversation, message, order, typing, user, and disconnect handlers under `socket/handlers`.
Connection-level state and tracking are centralized through `socket/state.js` and related utility methods.
Socket client assets are exposed through `/socket.io` static mount from `node_modules/socket.io/client-dist`.