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

td0034

BookClubVoter

Public
Like
BookClubVoter
Home
Code
3
backend
1
frontend
3
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://td0034--46964808356a11f0a59f9e149126039e.web.val.run
README.md

Book Club Suggestion and Voting System

A simple web application for book club members to suggest books and vote on them.

Features

  • Suggest new books with title, author, description, and suggester name
  • View all suggested books in a list
  • Vote for books you're interested in reading
  • Books are sorted by vote count (highest first)
  • Persistent storage using SQLite
  • Anonymous voting with browser-based user identification

Technical Details

This application is built using:

  • Backend: Hono.js with SQLite for data storage
  • Frontend: Vanilla JavaScript with Tailwind CSS for styling
  • Data is stored in two tables:
    • book_club_books: Stores book suggestions
    • book_club_votes: Tracks votes by anonymous user IDs

How It Works

  1. Suggesting Books:

    • Fill out the form at the top of the page
    • Title and author are required
    • Description and your name are optional
  2. Voting:

    • Click the up arrow on any book to vote for it
    • Each user (browser) can only vote once per book
    • Click again to remove your vote
    • Books with the most votes appear at the top
  3. User Identification:

    • A random user ID is generated and stored in your browser's localStorage
    • This ID is used to track your votes without requiring login
    • Clearing your browser data will reset your voting history

API Endpoints

  • GET /api/books - Get all books with vote counts
  • POST /api/books - Add a new book
  • POST /api/books/:id/vote - Vote for a book
  • DELETE /api/books/:id/vote - Remove a vote from a book
HTTP
  • index.ts
    td0034--46…9e.web.val.run
Code
backendfrontendREADME.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.