A complete backend-focused ephemeral (self-destructing) chat rooms project. Built with FastAPI, WebSockets, and Redis for real-time messaging with automatic room expiration.
Need this service for your use case or want a tailored solution?
Experience EphemeralChat in real-time. Create or join a chat room and start messaging. Rooms automatically expire after the set time.
EphemeralChat is built with a scalable architecture designed for real-time messaging and horizontal scaling. The system uses Redis pub/sub for message distribution across multiple instances, enabling high availability and performance.
EphemeralChat Architecture
Architecture diagram showing Redis pub/sub, WebSocket connections, and horizontal scaling
High-performance async API server handling WebSocket connections and REST endpoints for room management
Modern, fast web framework for building APIs with automatic OpenAPI documentation and WebSocket support
Message distribution system enabling horizontal scaling. Messages broadcast to all instances via pub/sub channels
Containerized deployment with Docker Compose for easy setup and consistent environments
Run multiple instances behind a load balancer. Redis pub/sub ensures messages reach all instances
Distribute WebSocket connections across multiple application instances for high availability
EphemeralChat provides a complete solution for ephemeral chat rooms with real-time messaging, automatic expiration, and horizontal scaling capabilities.
Chat rooms automatically expire after a set time (default 10 minutes). No manual cleanup required - rooms disappear when their TTL expires.
WebSocket-based real-time communication ensures instant message delivery across all connected clients in a room.
Optional password protection for rooms. Secure your conversations with simple password-based access control.
Configurable maximum users per room (default 20). Prevents overcrowding and maintains performance.
Redis pub/sub architecture enables horizontal scaling. Run multiple instances behind a load balancer for high availability.
Fully containerized with Docker and Docker Compose. Deploy in seconds with a single command.
Integrate EphemeralChat into your application using our RESTful API and WebSocket endpoints. Full interactive documentation is available.
curl -X 'POST' \
'https://ephemeralchat.hansraj.me/rooms/' \
-H 'accept: application/json' \
-H 'content-type: application/json' \
-d '{
"name": "My Chat Room",
"owner_name": "JohnDoe",
"expiry_seconds": 600,
"max_users": 20,
"password": "optional_password"
}'
import asyncio
import websockets
import json
async def chat_client():
uri = "ws://ephemeralchat.hansraj.me/rooms/{room_id}/ws"
async with websockets.connect(uri) as websocket:
# Send a message
message = {
"type": "message",
"content": "Hello, World!"
}
await websocket.send(json.dumps(message))
# Receive messages
async for message in websocket:
data = json.loads(message)
print(f"Received: {data}")
asyncio.run(chat_client())
// Create room first
const createRoom = async () => {
const response = await fetch('https://ephemeralchat.hansraj.me/rooms/', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'My Chat Room',
owner_name: 'JohnDoe',
expiry_seconds: 600,
max_users: 20
})
});
const room = await response.json();
return room.room_id;
};
// Connect via WebSocket
const roomId = await createRoom();
const ws = new WebSocket(`wss://ephemeralchat.hansraj.me/rooms/${roomId}/ws`);
ws.onopen = () => {
console.log('Connected to room');
ws.send(JSON.stringify({
type: 'message',
content: 'Hello, World!'
}));
};
ws.onmessage = (event) => {
const data = JSON.parse(event.data);
console.log('Received:', data);
};
EphemeralChat is built with enterprise-grade architecture and can handle real-time messaging at scale. If you need a similar ephemeral chat solution for your business or want a tailored solution customized to your specific requirements, I'd love to help you build it.