Source: src/sockets/socket-manager.ts

Initialization

initializeSocket(io) registers connection handler on the shared Socket.IO Server instance created in app.ts.

User → socket mapping

Clients connect with query param userId:
Server maintains userSocketMap: Map<userId, socketId[]> for targeted emits (e.g. profile updates).

Connection handlers

Listener registration (once)

Called during app bootstrap after Mongo connects.

Exports