ZenChat
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Viewing readonly version of main branch: v6View latest version
This directory contains the backend code for the real-time chat application.
index.ts: Main entry point with Hono setup, WebSocket handling, and HTTP routesdatabase/: Database setup and queriesmigrations.ts: Schema definitionsqueries.ts: Database query functions
The WebSocket connection handles the following message types:
join: User joining the chat with a usernamemessage: User sending a message
message: New message from a useruser_joined: Notification when a user joinsuser_left: Notification when a user leaveshistory: Message history when a user first connects