A word game where players must think of the biggest word that fits a given constraint (e.g., "starts with HI").
The game requires a word database to validate submissions. Before playing, you need to initialize the database:
-
Run the initialization script by visiting the script's endpoint in your browser:
- Navigate to the
scripts/initDb.tsfile in Val Town - Click the endpoint URL to trigger the script
- Or run it via curl:
curl https://your-val-endpoint/scripts/initDb.ts
- Navigate to the
-
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.
-
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.
- which in turn imports
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 } ] }
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
- 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.