• Townie
    AI
  • Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
chinweike

chinweike

untitled-4770

Public
Like
untitled-4770
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
/
Code
/
Search
index.ts
https://chinweike--306020003f8211f0935176b3cceeab13.web.val.run
README.md

Work Group Messaging App

A real-time messaging application for work groups where team members can register with unique usernames and send messages to keep each other updated.

Features

  • User registration with unique usernames
  • Real-time messaging within work groups
  • Message history with timestamps
  • Username display alongside each message
  • Simple, clean interface

Project Structure

β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ database/
β”‚   β”‚   β”œβ”€β”€ blob-storage.ts    # Blob storage functions
β”‚   β”‚   β”œβ”€β”€ migrations.ts      # SQLite schema (backup)
β”‚   β”‚   └── queries.ts         # SQLite queries (backup)
β”‚   β”œβ”€β”€ routes/
β”‚   β”‚   β”œβ”€β”€ auth.ts           # User registration/login
β”‚   β”‚   └── messages.ts       # Message CRUD operations
β”‚   └── index.ts              # Main Hono server
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ App.tsx         # Main app component
β”‚   β”‚   β”œβ”€β”€ Login.tsx       # Login/registration form
β”‚   β”‚   β”œβ”€β”€ MessageList.tsx # Message display
β”‚   β”‚   └── MessageForm.tsx # Message input form
β”‚   β”œβ”€β”€ index.html          # Main HTML template
β”‚   └── index.tsx           # Frontend entry point
└── shared/
    └── types.ts            # Shared TypeScript types

API Endpoints

  • POST /api/auth/register - Register new user
  • POST /api/auth/login - Login existing user
  • GET /api/messages - Get all messages
  • POST /api/messages - Send new message

Data Storage

The app uses Val Town's blob storage for persistence:

Users Storage

  • Key: workgroup_users
  • Structure: Array of User objects
  • Counter: workgroup_user_counter

Messages Storage

  • Key: workgroup_messages
  • Structure: Array of Message objects
  • Counter: workgroup_message_counter

Database Schema

User Object

{ id: number; username: string; created_at: string; }

Message Object

{ id: number; user_id: number; username: string; content: string; created_at: string; }

Usage

  1. Register with a unique username
  2. Start sending messages to your work group
  3. View real-time updates from other team members
HTTP
  • index.ts
    chinweike--30…13.web.val.run
Code
backendfrontendsharedREADME.md
FeaturesVersion controlCode intelligenceCLI
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Terms of usePrivacy policyAbuse contact
Β© 2025 Val Town, Inc.