ChatApp is a real-time messaging app I built to properly understand WebSockets. I’d read about them plenty of times, but reading and building are two very different things.

Tech Stack

React · Express · MongoDB · Socket.io

Live Demo

https://chat-client-33n1.onrender.com/

How It Works

Users connect, messages fly through Socket.io in real time, and chat history is persisted in MongoDB so conversations survive a page refresh. The UI is intentionally minimal — a clean message list, an input bar, and nothing else.

The backend is Express with two concerns: REST routes for fetching message history, and the Socket.io server for live messaging. Keeping them separate made the code easier to reason about.

On the frontend, React handles the reactive state — new messages from the socket update the UI instantly without polling or manual refresh.

What I Focused On

  • Stable socket connections — the last thing you want in a chat app is messages that don’t arrive. Socket.io handles reconnection, but I spent time making sure the UX doesn’t break when someone’s wifi dips.
  • A clean UI that stays readable even during long conversations. No busy backgrounds, no animated avatars, no distractions.
  • Clean separation between the frontend components, the API routes, and the socket event handlers. Made debugging a lot easier.

What I’d Add Next

  • Authentication and private rooms (right now anyone can join and see all messages)
  • Message timestamps and read indicators
  • Better mobile layout — the keyboard UX on phones is rough and needs work