Skip to main content
Simon Stijnen
Back to All Projects

ChitChatz

ChitChatz chat interface showing real-time messaging between users

ChitChatz chat interface showing real-time messaging between users

Users that are not logged in get a username prompt to fill in a username. This is then store in the JWT token provided by the server.

Users that are not logged in get a username prompt to fill in a username. This is then store in the JWT token provided by the server.

Once a user is logged in he gets to see the available rooms at the left of the screen. Together with the option to create a room for himself.

Once a user is logged in he gets to see the available rooms at the left of the screen. Together with the option to create a room for himself.

Once a user has joined the room by clicking it, he can start chatting!

Once a user has joined the room by clicking it, he can start chatting!

Because this project was all about JWT tokens, a user can view his JWT token in this popup.

Because this project was all about JWT tokens, a user can view his JWT token in this popup.

ChitChatz is a real-time messaging application built around WebSockets, exploring how stateless authentication with JWT tokens can be combined with persistent, bidirectional connections to deliver a snappy chat experience without polling.

How It Works

When a user first opens the app they are prompted to choose a username. The Node.js server mints a signed JWT containing that identity and sends it back; the browser stores it in a cookie for the duration of the session. Every subsequent WebSocket message carries this token, so the server can identify the sender without maintaining its own session store.

Users can browse available chat rooms, create their own, and join any room to start messaging — all updates arrive instantly over the open WebSocket connection.

Key Features

  • Persistent WebSocket connections managed server-side in Node.js, broadcasting messages only to members of the relevant room
  • JWT-based authentication — stateless by design, with token inspection available via an in-app debug panel for learning purposes
  • Cookie-based session persistence so users survive a page refresh without re-entering their username
  • Room creation and switching without reconnecting — the same socket handles multiple room contexts
  • TypeScript throughout both server and client, with jQuery powering the frontend DOM interactions

Technical Highlights

  • The debug panel exposing the raw decoded JWT payload was an intentional teaching tool, making the token’s structure and claims tangible
  • Docker containerises the Node.js server, keeping the runtime environment reproducible and the deployment a single docker run away
  • Keeping auth stateless means the server holds no session table — scaling out is a matter of adding instances behind a load balancer

Technologies Used

  • WebSocket
  • TypeScript
  • Docker
  • Node.js
  • JWT
  • JQuery
  • Cookies

Related Projects

Signapse
Using computer vision and machine learning to translate sign language gestures into text.
CERM MCP PoC
A proof of concept email automation agent using Microsoft 365 MCP server and LangChain.
Pop-a-loon
A full stack Chrome extension with 200+ users, featuring interactive balloons and real-time stats.