Building Instant Chat Rooms
· 3 min
What Is ChatWit?
ChatWit is a free chat room platform built around simplicity. There is no registration, no email, no password. You open the page, pick a display name, and either create a new room or join an existing public one. The entire experience is designed to get people talking as fast as possible with zero friction.
Architecture Overview
Real-time chat requires persistent two-way connections, so ChatWit is built on the AWS WebSocket API. When a user opens a chat room, their browser establishes a WebSocket connection through API Gateway. A Lambda function registers the connection in DynamoDB and associates it with the appropriate room. Every message triggers a broadcast Lambda that pushes the message to all connected users in that room.
User Browser
|
v
CloudFront (Static Assets from S3)
|
v
API Gateway (WebSocket API)
|
v
Lambda Functions (Connect / Disconnect / Send / Room Management)
|
v
DynamoDB (Connections, Rooms, Messages)
The frontend is a static site hosted on S3 and distributed through CloudFront. Because there is no server-rendered HTML, the static layer is extremely fast and cheap to serve globally.
Key Features
Instant Rooms are the core of ChatWit. Anyone can create a room with a single click. Each room gets a unique shareable link. Room creators can set the room to public, making it visible in the lobby, or keep it private so only people with the link can join.
No Registration means there is nothing standing between the user and a conversation. Display names are chosen on the fly and stored only for the duration of the session. When the user disconnects, their presence is cleaned up automatically by a disconnect Lambda triggered through the WebSocket API lifecycle.
Public Room Directory lists all active public rooms with their topic and participant count. The directory is powered by a DynamoDB query that filters rooms by visibility and sorts by activity, giving new users an easy way to find active conversations.
Performance
Message delivery averages 25ms from send to display. WebSocket connections are managed at CloudFront edge locations, so users connect to the nearest AWS region automatically. The static frontend loads in under 800ms on a standard connection. DynamoDB on-demand capacity handles traffic spikes without any manual intervention, and rooms with no activity for 24 hours are automatically cleaned up via DynamoDB TTL.