Case study Open source / Terminal tools
Relay
An open-source terminal chat application with rooms, direct messages, presence, and optional client-side encrypted rooms.
Problem statement
Keep a live, multi-room conversation usable inside a text-first terminal interface with lightweight session-based server state.
Proof / A quick look
See the product before the detail.
01 / Overview
The brief.
Relay brings a live conversation into the terminal. I built the JavaScript application around a Node.js WebSocket server and a React/Ink terminal interface, with multi-room chat, direct messages, presence, and scrollback. Capped, in-memory server state keeps recent room activity available during the running session, while optional encrypted rooms put key derivation and message encryption in the client.
02 / Situation
What was already true.
The application needs to show conversation, room context, and other participants within a text-first interface.
03 / Decision
The choice that set the shape.
Use React/Ink for the terminal UI, WebSockets for live communication, and capped in-memory server state for the chat session.
04 / Responsibilities
What I designed and built.
I implemented the terminal interaction, server messaging, room and direct-message flows, presence, scrollback, and the optional encrypted-room client path.
05 / Architecture
The implementation behind the interface.
A Node.js 22 server communicates over ws with a JavaScript React/Ink client. Optional encrypted rooms derive a key client-side with scrypt and encrypt messages using AES-256-GCM. The persistence model is capped, in-memory server state, holding recent chat activity for the running session.
06 / System
How the pieces fit.
Participants move between rooms, follow presence, exchange room or direct messages, and inspect recent scrollback. For optional encrypted rooms, the client handles key derivation and message encryption before sending messages over the WebSocket connection.
07 / Evidence
What the shipped interface can show.
The React/Ink interface presents room conversations, direct messages, presence, and scrollback in the terminal. The WebSocket server manages live messaging and capped in-memory state, while the client crypto module implements scrypt key derivation and AES-256-GCM for optional encrypted rooms.
08 / Feature list
Features.
- Terminal chat interface
- Multiple rooms
- Direct messages
- Presence and scrollback
- Optional client-side encrypted rooms
- Capped in-memory server state