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

kibet

kevin

Public
Like
kevin
Home
Code
5
backend
3
frontend
3
shared
1
README.md
new-file-6236.tsx
Branches
1
Pull requests
Remixes
1
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://kibet--6b300a543fa711f0832276b3cceeab13.web.val.run
README.md

Election Voting & Chat App

A real-time voting application with public chat functionality for election discussions.

Features

  • Voting System: Cast votes for different candidates/options
  • Public Chat Room: Real-time discussion about elections
  • Vote Results: Live vote tallies and percentages
  • User Authentication: Simple username-based system
  • Responsive Design: Works on desktop and mobile

Project Structure

β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ database/
β”‚   β”‚   β”œβ”€β”€ migrations.ts    # Database schema setup
β”‚   β”‚   └── queries.ts       # Database query functions
β”‚   β”œβ”€β”€ routes/
β”‚   β”‚   β”œβ”€β”€ votes.ts         # Voting API endpoints
β”‚   β”‚   └── chat.ts          # Chat API endpoints
β”‚   └── index.ts             # Main Hono server
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ App.tsx          # Main application component
β”‚   β”‚   β”œβ”€β”€ VotingPanel.tsx  # Voting interface
β”‚   β”‚   └── ChatRoom.tsx     # Chat interface
β”‚   β”œβ”€β”€ index.html           # Main HTML template
β”‚   └── index.tsx            # Frontend entry point
└── shared/
    └── types.ts             # Shared TypeScript types

Technology Stack

  • Backend: Hono (TypeScript API framework)
  • Frontend: React with TypeScript
  • Database: SQLite
  • Styling: TailwindCSS
  • Real-time: Server-Sent Events (SSE)

API Endpoints

  • GET / - Serve the main application
  • GET /api/votes - Get current vote results
  • POST /api/votes - Cast a vote
  • GET /api/chat/messages - Get chat messages
  • POST /api/chat/messages - Send a chat message
  • GET /api/chat/stream - SSE stream for real-time chat updates

Usage

  1. Enter your username to join
  2. Cast your vote for your preferred candidate
  3. Participate in the public chat discussion
  4. View live vote results and chat updates
HTTP
  • index.ts
    kibet--6b…13.web.val.run
Code
backendfrontendsharedREADME.mdnew-file-6236.tsx
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.