All work

Real-time chat

Real-time messaging app with group chats and file sharing

Role
Solo project
When
2025
Landing page of the chat app: the headline 'Connect with anyone, anywhere' above a Get Started button and three feature cards.

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

  1. 01

    Socket.IO with authenticated handshakes. Unauthenticated sockets are disconnected before any handler runs.

  2. 02

    Feature-scoped handlers for presence, typing indicators, chat rooms and connection lifecycle.

  3. 03

    Custom Redux middleware bridges socket events into the store, with optimistic updates on send.

Request path

  1. Next.js client
  2. Express API
  3. Socket.IO
  4. MongoDB

From the code

src/socket/index.tssource
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