Real-time chat
Real-time messaging app with group chats and file sharing
- Role
- Solo project
- When
- 2025

Overview
A messaging app with a Next.js client and a separate Express and Socket.IO backend, built to recover from dropped connections.
The constraint
A dropped socket shouldn't break a conversation. The client has to reconnect and pick up where it left off.
What I built
- 01
Socket.IO with authenticated handshakes. Unauthenticated sockets are disconnected before any handler runs.
- 02
Feature-scoped handlers for presence, typing indicators, chat rooms and connection lifecycle.
- 03
Custom Redux middleware bridges socket events into the store, with optimistic updates on send.
Request path
- Next.js client
- Express API
- Socket.IO
- MongoDB
From the code
io.use(authSocket); io.on("connection", async (socket: CustomSocket) => { if (!socket.user) { return socket.disconnect(true); } OnlineStatusHandlers.setupOnlineStatusHandlers(socket, onlineUserIds); ConnectionHandlers.setupConnectionHandlers(socket); TypingHandlers.setupTypingHandlers(socket); ChatRoomHandlers.setupChatRoomHandlers(socket); socket.on("disconnect", () => { ConnectionHandlers.handleSocketDisconnection(socket, onlineUserIds); OnlineStatusHandlers.handleUserDisconnection(socket, onlineUserIds); });});Outcome
Group and direct chats with typing indicators, read receipts, reactions and file attachments.
- Next.js
- React
- TypeScript
- Redux
- Node.js
- Express
- Socket.IO
- MongoDB
Next project
twinfi
Linux Wi-Fi hotspot that keeps your Wi-Fi connected