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 todo list app built with client-side React and a Hono API backend on Val Town. Todos persist in SQLite β they survive page reloads and server restarts.
- β Add todos
- βοΈ Toggle done / not done
- ποΈ Delete todos
- π Remaining count
- πΎ SQLite persistence (val-scoped database)
Rendering mermaid diagram...
index.ts β Hono backend (serves frontend + todo API)
frontend/
index.html β HTML shell (loads Twind + React)
index.tsx β React entrypoint (mounts <App />)
favicon.svg β App icon
components/
App.tsx β Root component (layout + view source link)
TodoApp.tsx β Todo UI (add, toggle, delete)
| Method | Route | Body | Description |
|---|---|---|---|
GET | /api/todos | β | List all todos |
POST | /api/todos | { "text": "..." } | Create a todo |
PATCH | /api/todos/:id | { "done": true } and/or { "text": "..." } | Update a todo |
DELETE | /api/todos/:id | β | Delete a todo |
index.tsis the HTTP entrypoint β a Hono server that serves the frontend and the REST API. On startup it creates thetodostable if it doesn't already exist.frontend/index.htmlloads Twind (Tailwind at runtime) and the React entrypoint.frontend/index.tsxmounts the React app.frontend/components/App.tsxis the root layout β renders<TodoApp />.frontend/components/TodoApp.tsxis the main UI β fetches, creates, toggles, and deletes todos via the API.