Challenge
Make conversations feel immediate while keeping access to rooms tied to each user.
My approach
I integrated Socket.io with the Next.js server, authentication at the handshake, and MongoDB persistence.
Socket.io updates the conversation without a page reload, while MongoDB stores room history.
Authentication is checked during the real-time connection to associate messages and permissions with the user.