• Townie
    AI
  • Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
bart

bart

Todo

Public
Like
Todo
Home
Code
3
frontend
3
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
/
README.md
Code
/
README.md
Search
8/15/2025
README.md

Todo App

A modern todo application built with React and @sqlife/react for local-first data management.

Features

  • βœ… Add, edit, and delete todos
  • πŸ“Œ Pin important todos to the top
  • βœ“ Mark todos as completed
  • πŸ” Filter todos by status (All, Active, Completed)
  • πŸ“± Responsive design with Tailwind CSS
  • πŸ’Ύ Local-first data storage with SQLite

Technology Stack

  • Frontend: React 18.2.0 with TypeScript
  • Database: SQLite via @sqlife/react
  • Styling: Tailwind CSS
  • Backend: Hono for serving static files
  • Platform: Val Town

Database Schema

The app uses a SQLite table with the following structure:

CREATE TABLE todo ( id TEXT PRIMARY KEY NOT NULL, title TEXT NOT NULL, completed BOOLEAN NOT NULL DEFAULT 0, created_at TEXT NOT NULL, updated_at TEXT NOT NULL, completed_at TEXT NOT NULL DEFAULT "", pinned INTEGER NOT NULL DEFAULT 0 )

Project Structure

β”œβ”€β”€ index.ts                    # Main HTTP handler
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ index.html             # HTML template
β”‚   β”œβ”€β”€ index.tsx              # React app entry point
β”‚   └── components/
β”‚       β”œβ”€β”€ App.tsx            # Main app component
β”‚       β”œβ”€β”€ TodoItem.tsx       # Individual todo item
β”‚       └── AddTodoForm.tsx    # Form for adding new todos
└── README.md

Usage

  1. Add todos: Type in the input field and click "Add Todo" or press Enter
  2. Complete todos: Click the checkbox next to any todo
  3. Pin todos: Click the πŸ“Œ icon to pin important todos to the top
  4. Edit todos: Click on the todo text to edit it inline
  5. Delete todos: Click the πŸ—‘οΈ icon to delete a todo
  6. Filter todos: Use the All/Active/Completed buttons to filter the view

Local-First Architecture

This app uses @sqlife/react which provides:

  • Client-side SQLite database
  • Reactive queries that automatically update the UI
  • Offline-first functionality
  • No server-side database required

The database is created automatically when the first todo is added.

FeaturesVersion controlCode intelligenceCLI
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
Β© 2025 Val Town, Inc.