Public
Remixed
Simple todo list app with React UI and SQLite persistence
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.

πŸ“ Todo List App

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.

Features

  • βœ… Add todos
  • β˜‘οΈ Toggle done / not done
  • πŸ—‘οΈ Delete todos
  • πŸ“Š Remaining count
  • πŸ’Ύ SQLite persistence (val-scoped database)

Architecture

Rendering mermaid diagram...

File structure

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)

API

MethodRouteBodyDescription
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

How it works

  1. index.ts is the HTTP entrypoint β€” a Hono server that serves the frontend and the REST API. On startup it creates the todos table if it doesn't already exist.
  2. frontend/index.html loads Twind (Tailwind at runtime) and the React entrypoint.
  3. frontend/index.tsx mounts the React app.
  4. frontend/components/App.tsx is the root layout β€” renders <TodoApp />.
  5. frontend/components/TodoApp.tsx is the main UI β€” fetches, creates, toggles, and deletes todos via the API.