How hakkul/chat-group works
Group Chat is a no-login group messaging app: users create or browse groups, enter a group with a chosen or generated name, then exchange live messages. The browser separates group browsing, chat presentation, API access, and socket reconnection; the Worker serves group endpoints and dispatches room connections, while D1 stores group metadata and Durable Objects handle chat history, messages, and presence. The README documents these capabilities; source excerpts show the principal request and message paths.
Main entry points: worker/index.ts HTTP routes · ChatView.vue Chat interface · router/index.ts Page routing · api.ts HTTP and WS client
Components 15
Browser application
- App bootstrap
src/main.ts - App shell
src/App.vue - Page routing
src/router/index.ts - Group browser
src/views/HomeView.vue - Chat interface
src/views/ChatView.vue - Username state
src/composables/useUsername.ts - Socket client
src/composables/useChatSocket.ts - HTTP and WS client
src/api.ts
Group API
- HTTP routes
worker/index.ts - Group schema
worker/index.ts
Realtime chat
- Chat room
worker/chat-room.ts
Persistence
- Group table
worker/schema.ts - Group metadata
- Message history
worker/chat-room.ts
Other components
- User
Connections 20
- App bootstrap → App shell: mounts
src/main.ts - App bootstrap → Page routing: installs
src/main.ts - App shell → Page routing: renders
src/App.vue - Page routing → Group browser: routes to
src/router/index.ts - Page routing → Chat interface: routes to
src/router/index.ts - User → Group browser: browses groups
README.md - Group browser → HTTP and WS client: calls
src/views/HomeView.vue - Group browser → Page routing: navigates to
src/views/HomeView.vue - User → Chat interface: joins and chats
README.md - Chat interface → HTTP and WS client: loads group
src/views/ChatView.vue - Chat interface → Username state: uses
src/views/ChatView.vue - Username state → HTTP and WS client: generates name
src/composables/useUsername.ts - Chat interface → Socket client: controls connection
src/views/ChatView.vue - Socket client → HTTP and WS client: opens socket
src/composables/useChatSocket.ts - HTTP and WS client → HTTP routes: requests API
src/api.ts - HTTP routes → Group schema: validates input
worker/index.ts - HTTP routes → Group table: queries table
worker/index.ts - HTTP routes → Group metadata: reads and writes
worker/index.ts - HTTP routes → Chat room: dispatches socket
worker/index.ts - Chat room → Message history: reads and writes
worker/chat-room.ts