Public
Like
BookClubVoter
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.
A simple web application for book club members to suggest books and vote on them.
- 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
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 suggestionsbook_club_votes
: Tracks votes by anonymous user IDs
-
Suggesting Books:
- Fill out the form at the top of the page
- Title and author are required
- Description and your name are optional
-
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
-
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
GET /api/books
- Get all books with vote countsPOST /api/books
- Add a new bookPOST /api/books/:id/vote
- Vote for a bookDELETE /api/books/:id/vote
- Remove a vote from a book