Public
Email collection form for NYU workshop
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 fullstack form that collects email addresses for the NYU workshop. Built with Hono + Hono JSX on the server, Twind for styling, and Val Town SQLite for storage.
GET /— renders the email collection formPOST /submit— validates the email and inserts it into SQLiteGET /count— returns{ count }of total stored emails (JSON)GET /source— redirects to the val source on Val Town
Rendering mermaid diagram...
main.tsx— HTTP entrypoint, re-exportsapp.fetchserver/app.tsx— Hono app with all routes, uses Hono JSX to render pagesdatabase/migrations.ts— creates theworkshop_emails_v1tabledatabase/queries.ts—addEmail()andgetEmailCount()helpersfrontend/Layout.tsx— shared HTML shell (Twind + catch script)frontend/EmailForm.tsx— the form UI with optional error statefrontend/SuccessPage.tsx— confirmation page after submit
CREATE TABLE workshop_emails_v1 (
id INTEGER PRIMARY KEY AUTOINCREMENT,
email TEXT NOT NULL UNIQUE,
created_at TEXT NOT NULL DEFAULT (datetime('now'))
);
Emails are normalized to lowercase and trimmed before being stored. Duplicate submissions are silently treated as success thanks to the UNIQUE constraint.