Public
Remixed
Real-time assistance request tracker + chat app
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.

🛟 Assist Hub

A real-time assistance request tracker and chat app built on Val Town.

Features

  • 📋 Requests Tab — Submit, view, and delete assistance requests. All requests persist in SQLite with timestamps.
  • 💬 Chat Tab — Join with a username and send messages. Messages sync across users via polling (every 2 seconds). Chat history persists across sessions.
  • 🔔 Toast Notifications — Visual confirmations for all actions (submit, delete, join, errors).
  • 📱 Responsive — Works on mobile and desktop with flex layouts.
  • ✅ Validation — Empty submissions are rejected on both client and server.

Architecture

Rendering mermaid diagram...

File Structure

index.ts                          ← Hono server (API + static files)
shared/
  db.ts                           ← SQLite schema & init
frontend/
  index.html                      ← HTML shell
  index.tsx                       ← React entrypoint
  favicon.svg                     ← App icon
  components/
    App.tsx                       ← Root layout + tab navigation
    RequestsTab.tsx               ← Submit & view requests
    ChatTab.tsx                   ← Real-time chat with username
    Toast.tsx                     ← Toast notification system

API

MethodPathDescription
GET/api/requestsList all requests (newest first)
POST/api/requestsCreate request ({ text })
DELETE/api/requests/:idDelete a request
GET/api/chatGet last 200 chat messages
POST/api/chatSend message ({ username, message })
GET/api/chat/stream?after=IDPoll for new messages after ID