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

ikeali

untitled-1496

Public
Like
untitled-1496
Home
Code
5
backend
3
frontend
3
shared
1
README.md
main.tsx
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://ikeali--909566ce3fa011f0970476b3cceeab13.web.val.run
README.md

Online Voting System

A comprehensive online voting platform built with TypeScript, Hono, React, and SQLite.

Features

  • πŸ—³οΈ Poll Creation: Create polls with multiple options
  • πŸ‘₯ User Authentication: Secure user registration and login
  • πŸ“Š Real-time Results: Live vote counting and visualization
  • πŸ”’ Vote Security: One vote per user per poll
  • πŸ“± Responsive Design: Works on desktop and mobile
  • πŸ‘‘ Admin Dashboard: Manage polls and users

Project Structure

β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ database/
β”‚   β”‚   β”œβ”€β”€ migrations.ts    # Database schema setup
β”‚   β”‚   └── queries.ts       # Database query functions
β”‚   β”œβ”€β”€ routes/
β”‚   β”‚   β”œβ”€β”€ auth.ts         # Authentication routes
β”‚   β”‚   β”œβ”€β”€ polls.ts        # Poll management routes
β”‚   β”‚   └── votes.ts        # Voting routes
β”‚   └── index.ts            # Main server entry point
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ App.tsx         # Main application component
β”‚   β”‚   β”œβ”€β”€ Auth.tsx        # Login/Register forms
β”‚   β”‚   β”œβ”€β”€ PollList.tsx    # Display all polls
β”‚   β”‚   β”œβ”€β”€ PollDetail.tsx  # Individual poll view
β”‚   β”‚   β”œβ”€β”€ CreatePoll.tsx  # Poll creation form
β”‚   β”‚   └── Results.tsx     # Vote results visualization
β”‚   β”œβ”€β”€ index.html          # Main HTML template
β”‚   └── index.tsx           # Frontend entry point
└── shared/
    └── types.ts            # Shared TypeScript interfaces

API Endpoints

Authentication

  • POST /api/auth/register - User registration
  • POST /api/auth/login - User login
  • GET /api/auth/me - Get current user

Polls

  • GET /api/polls - List all polls
  • POST /api/polls - Create new poll
  • GET /api/polls/:id - Get specific poll
  • DELETE /api/polls/:id - Delete poll (admin only)

Voting

  • POST /api/votes - Cast a vote
  • GET /api/polls/:id/results - Get poll results

Getting Started

  1. Set up the database by running the migrations
  2. Start the server with the HTTP trigger
  3. Access the application at the provided URL
  4. Register a new account or login
  5. Create polls and start voting!

Security Features

  • Password hashing with bcrypt
  • JWT-based authentication
  • Vote uniqueness enforcement
  • Input validation and sanitization
HTTP
  • index.ts
    ikeali--90…13.web.val.run
Code
backendfrontendsharedREADME.mdmain.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.