How vardhan-billakanti/doomchat works
DoomChat is an account-free, ephemeral group chat. Users create or join a room, connect over WebSockets, exchange messages and typing/participant updates, then leave or disband the room. The React app coordinates this flow; the Worker routes API and socket requests to one Durable Object per room. The README documents room ownership, broadcasts, inactivity alarms, and ephemeral room behavior. Edges reflect shown imports/calls or README architecture; some Durable Object capabilities are documented but their detailed implementation was not sampled.
Main entry points: App.tsx App state machine · ChatRoom.tsx Chat room view · ChatRoom.ts Room Durable Object · useChatRoom.ts Room state hook
Components 21
React client
- App state machine
frontend/src/App.tsx
Room entry
- Landing page
frontend/src/components/LandingPage.tsx - Create room form
frontend/src/components/CreateRoom.tsx - Join room form
frontend/src/components/JoinRoom.tsx - Room code sharing
frontend/src/components/RoomCreated.tsx - API URL config
frontend/src/lib/api.ts
Realtime rooms
- Chat room view
frontend/src/components/ChatRoom.tsx - Room state hook
frontend/src/hooks/useChatRoom.ts - WebSocket client
frontend/src/hooks/useWebSocket.ts - Message encryption
frontend/src/lib/crypto.ts - Message input
frontend/src/components/MessageInput.tsx - Message history view
frontend/src/components/MessageList.tsx - Participant list
frontend/src/components/ParticipantList.tsx - Typing indicator
frontend/src/components/TypingIndicator.tsx - Connection status
frontend/src/components/ConnectionStatus.tsx - Leave/disband confirm
frontend/src/components/ConfirmModal.tsx - Room Durable Object
worker/src/ChatRoom.ts
Worker services
- Worker router
worker/src/index.ts - Validation and sanitizing
worker/src/validation.ts - Rate limiter
worker/src/rateLimit.ts
Other components
- Chat participant
Connections 32
- Chat participant → App state machine: opens chat
README.md - App state machine → Landing page: shows
frontend/src/App.tsx - App state machine → Create room form: routes to
frontend/src/App.tsx - App state machine → Join room form: routes to
frontend/src/App.tsx - App state machine → Room code sharing: shows
frontend/src/App.tsx - App state machine → Chat room view: shows
frontend/src/App.tsx - Landing page → App state machine: chooses create/join
frontend/src/App.tsx - Create room form → API URL config: builds API request
frontend/src/components/CreateRoom.tsx - Join room form → API URL config: builds API request
frontend/src/components/JoinRoom.tsx - Create room form → App state machine: returns room details
frontend/src/App.tsx - Join room form → App state machine: returns joined room
frontend/src/App.tsx - API URL config → Worker router: targets API
README.md - Worker router → Room Durable Object: routes room requests
worker/src/index.ts - Worker router → Validation and sanitizing: validates and generates
worker/src/index.ts - Room Durable Object → Validation and sanitizing: uses utilities
worker/src/ChatRoom.ts - Room Durable Object → Rate limiter: limits messages
worker/src/ChatRoom.ts - Room Durable Object → Chat participant: broadcasts room events
README.md - Room Durable Object → Room Durable Object: manages room lifecycle
README.md - Chat room view → Room state hook: reads room state
frontend/src/components/ChatRoom.tsx - Chat room view → Message input: renders
frontend/src/components/ChatRoom.tsx - Chat room view → Message history view: renders
frontend/src/components/ChatRoom.tsx - Chat room view → Participant list: renders
frontend/src/components/ChatRoom.tsx - Chat room view → Typing indicator: renders
frontend/src/components/ChatRoom.tsx - Chat room view → Connection status: renders
frontend/src/components/ChatRoom.tsx - Chat room view → Leave/disband confirm: renders
frontend/src/components/ChatRoom.tsx - Room state hook → WebSocket client: manages connection
frontend/src/hooks/useChatRoom.ts - Room state hook → Message encryption: encrypts/decrypts messages
frontend/src/hooks/useChatRoom.ts - WebSocket client → API URL config: builds socket URL
frontend/src/hooks/useWebSocket.ts - WebSocket client → Worker router: opens WebSocket
README.md - Message input → Room state hook: sends message/typing
frontend/src/components/ChatRoom.tsx - Room state hook → Message history view: supplies messages
- Leave/disband confirm → Room state hook: confirms leave/disband