• Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
mehran

mehran

ZenChat

Public
Like
ZenChat
Home
Code
4
backend
3
frontend
3
shared
1
README.md
Branches
1
Pull requests
Remixes
History
Environment variables
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.
Sign up now
Code
/
backend
/
README.md
Code
/
backend
/
README.md
Search
5/14/2025
Viewing readonly version of main branch: v14
View latest version
README.md

Backend for Real-Time Chat

This directory contains the backend code for the real-time chat application.

Components

  • index.ts: Main entry point with Hono setup, WebSocket handling, and HTTP routes
  • database/: Database setup and queries
    • migrations.ts: Schema definitions
    • queries.ts: Database query functions

WebSocket Protocol

The WebSocket connection handles the following message types:

From Client to Server:

  • join: User joining the chat with a username
  • message: User sending a message

From Server to Client:

  • message: New message from a user
  • user_joined: Notification when a user joins
  • user_left: Notification when a user leaves
  • history: Message history when a user first connects
FeaturesVersion controlCode intelligenceCLIMCP
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Open Source Pledge
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.