Public
Like
untitled-266
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.
index.ts
https://mmmm--41724bf23fb411f09f2e76b3cceeab13.web.val.run
A full-stack messaging application built with Val Town, featuring real-time communication between users.
- User registration and authentication
- Real-time messaging between users
- User list and online status
- Message history
- Clean, responsive UI
βββ backend/
β βββ database/
β β βββ migrations.ts # Database schema setup
β β βββ queries.ts # Database query functions
β βββ routes/
β β βββ auth.ts # Authentication routes
β β βββ messages.ts # Message routes
β β βββ users.ts # User routes
β β βββ static.ts # Static file serving
β βββ index.ts # Main Hono app entry point
βββ frontend/
β βββ components/
β β βββ App.tsx # Main app component
β β βββ Login.tsx # Login/register form
β β βββ MessageList.tsx # Message display
β β βββ MessageInput.tsx # Message input form
β β βββ UserList.tsx # Online users list
β βββ index.html # Main HTML template
β βββ index.tsx # Frontend entry point
β βββ style.css # Custom styles
βββ shared/
β βββ types.ts # Shared TypeScript types
βββ README.md
- Backend: Hono (API framework)
- Database: SQLite
- Frontend: React with TypeScript
- Styling: TailwindCSS
- Real-time: Server-Sent Events (SSE)
POST /api/auth/register
- Register new userPOST /api/auth/login
- User loginGET /api/users
- Get all usersGET /api/messages
- Get message historyPOST /api/messages
- Send new messageGET /api/messages/stream
- SSE endpoint for real-time messages
- The app will automatically set up the database on first run
- Navigate to the app URL to start using the messaging system
- Register a new account or login with existing credentials
- Start messaging with other users in real-time!