• Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
alexwein

alexwein

thinkalittlelonger

a little game where you think of big words
Public
Like
thinkalittlelonger
Home
Code
5
frontend
6
scripts
2
towniePrompts
4
README.md
H
index.ts
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://alexwein--019bcd4f053b76eba453718b43a5c39c.web.val.run
README.md

Your Biggest Word

A word game where players must think of the biggest word that fits a given constraint (e.g., "starts with HI").

Setup

Database Initialization

The game requires a word database to validate submissions. Before playing, you need to initialize the database:

  1. Run the initialization script by visiting the script's endpoint in your browser:

    • Navigate to the scripts/initDb.ts file in Val Town
    • Click the endpoint URL to trigger the script
    • Or run it via curl: curl https://your-val-endpoint/scripts/initDb.ts
  2. Verify initialization - The script will return a JSON response showing:

    • Total number of words loaded
    • List of available rounds and their rules

Note: This only needs to be done once, or when the word list is updated. The script is idempotent and will drop/recreate the table if run again.

How it works

  • The entrypoint is index.ts. That's the backend HTTP server, which also serves the all the frontend assets.

  • The client-side entrypoint is /frontend/index.html

    • which in turn imports /frontend/index.tsx
    • which in turn imports the React app from /frontend/components/App.tsx.

API Endpoints

POST /api/validate

Validates word submissions against the game's word database.

Request body:

{ "submissions": [ { "round": 1, "word": "history" }, { "round": 1, "word": "hippopotamus" } ] }

Response:

{ "results": [ { "round": 1, "word": "history", "isValid": true }, { "round": 1, "word": "hippopotamus", "isValid": true } ] }

File Structure

index.ts              # Main HTTP handler with /api/validate endpoint
scripts/
  initDb.ts           # Database initialization script (HTTP type)
frontend/
  index.html          # Client-side HTML entry point
  index.tsx           # Client-side React entry point
  components/
    App.tsx           # Main React app component
README.md             # This file

Further resources

  • React Hono Example is a bigger example project, with a SQLite database table, queries, client-side CSS, a favicon, and shared code that runs on both client and server.
Code
frontendscriptstowniePromptsREADME.md
H
index.ts
FeaturesVersion controlCode intelligenceCLIMCP
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Open Source Pledge
Terms of usePrivacy policyAbuse contact
© 2026 Val Town, Inc.