todo-list-test
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 persistent todo list application built with:
- Backend: Hono API framework with SQLite database
- Frontend: React with TypeScript
- Styling: TailwindCSS
- ✅ Add new todos
- ✅ Mark todos as complete/incomplete
- ✅ Delete todos
- ✅ Persistent storage with SQLite
- ✅ Real-time updates
- ✅ Responsive design
- ✅ Loading states and error handling
├── backend/
│ ├── database/
│ │ ├── migrations.ts # Database schema
│ │ └── queries.ts # Database operations
│ ├── routes/
│ │ └── todos.ts # Todo API routes
│ └── index.ts # Main Hono app
├── frontend/
│ ├── components/
│ │ ├── App.tsx # Main React component
│ │ ├── TodoItem.tsx # Individual todo component
│ │ └── TodoForm.tsx # Add todo form
│ ├── index.html # HTML template
│ └── index.tsx # React entry point
├── shared/
│ └── types.ts # Shared TypeScript types
└── README.md
GET /api/todos- Get all todosPOST /api/todos- Create a new todoPUT /api/todos/:id- Update a todoDELETE /api/todos/:id- Delete a todo
The app runs on Val Town with automatic deployment. The backend serves both the API and static frontend files.
- Visit the application URL
- Add new todos using the input form
- Click the checkbox to mark todos as complete/incomplete
- Click the delete button (trash icon) to remove todos
- All changes are automatically saved to the SQLite database
The application includes initial data injection to avoid extra API calls on page load, providing a smooth user experience.
