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

cricks_unmixed4u

kuadratic

Remix of cricks_unmixed4u/ai-prompted
Public
Like
kuadratic
Home
Code
9
.cursor
1
dist
1
lib
5
public
1
.cursorrules
.vtignore
deno.json
knowledge.md
H
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
/
lib
/
knowledge-addition.md
Code
/
lib
/
knowledge-addition.md
Search
6/25/2025
knowledge-addition.md

Kuadratic Voting Component

Kuadratic is a Val Town voting widget that exports embeddable HTML components backed by SQLite, with configurable limits for fair participation.

Features

  • Multiple Options: Support for multi-choice polls
  • Persistent Storage: Votes saved in Val Town's SQLite DB
  • Vote Limits: Configurable per-user and global caps
  • Embeddable: Self-contained HTML with CSS/JS
  • Live Feedback: UI updates after voting, with validations

Basic Usage

Create val
import { createVotingWidget, initializeOptions } from "./index.ts"; const config = { pollId: "my-poll-2024", maxTotalVotes: 1000, maxVotesPerUser: 3, options: [ { id: "option1", title: "Option 1", description: "First choice" }, { id: "option2", title: "Option 2", description: "Second choice" }, { id: "option3", title: "Option 3" } ] }; await initializeOptions(config); const widgetHTML = createVotingWidget(config); ## API * POST /api/vote: Submit vote * GET /api/results/:pollId: Retrieve current results ### Payload example { "pollId": "my-poll-2024", "optionId": "option1", "voterId": "unique-voter-id", "maxTotalVotes": 1000, "maxVotesPerUser": 3 } ## Vote Limiting Global Limit: maxTotalVotes restricts total submissions per poll Per-User Limit: maxVotesPerUser enforced via voterId ## Integration Embed the generated HTML on any webpage Automatically loads current vote counts and handles updates Enforces all vote limits with appropriate messaging Kuadratic ensures secure, easy-to-integrate voting with real-time behavior and robust guardrails for fair use.
FeaturesVersion controlCode intelligenceCLI
Use cases
TeamsAI agentsSlackGTM
ExploreDocsShowcaseTemplatesNewestTrendingAPI 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.