recursive-task-lists
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.
main.ts
https://warianoguerra--e50f35d238af11f1998b42b51c65c3df.web.val.run
A REST API for managing recursive task lists, built on Val Town with per-val SQLite and owner-only OAuth authentication.
All /api/* endpoints are protected. Only the val owner can access them.
- Visit
/auth/loginto authenticate via Val Town OAuth - After login, your session cookie is set automatically
- All subsequent API requests use that cookie
Unauthenticated requests return 401. Non-owner users get 403.
| Method | Path | Description |
|---|---|---|
GET | /api/task-lists | List all task lists |
POST | /api/task-lists | Create a task list |
GET | /api/task-lists/:id | Get a task list with full recursive task tree |
PUT | /api/task-lists/:id | Update title/description |
DELETE | /api/task-lists/:id | Delete a list and all its tasks |
| Method | Path | Description |
|---|---|---|
POST | /api/task-lists/:listId/tasks | Create a top-level task (or nested via parent_task_id) |
GET | /api/tasks/:id | Get a task with its subtask tree |
PUT | /api/tasks/:id | Update title, description, or mark done |
DELETE | /api/tasks/:id | Delete a task and all subtasks |
POST | /api/tasks/:id/subtasks | Add a subtask to a task |
Rendering mermaid diagram...
# Create a task list curl -X POST /api/task-lists \ -H "Content-Type: application/json" \ -d '{"title": "My Project", "description": "Things to do"}' # Add a task curl -X POST /api/task-lists/1/tasks \ -H "Content-Type: application/json" \ -d '{"title": "Setup environment"}' # Add a subtask curl -X POST /api/tasks/1/subtasks \ -H "Content-Type: application/json" \ -d '{"title": "Install dependencies"}' # Mark task as done curl -X PUT /api/tasks/1 \ -H "Content-Type: application/json" \ -d '{"done": true}' # Get full tree curl /api/task-lists/1
main.ts # Hono HTTP entrypoint + OAuth wrapper
middleware/auth.ts # Owner-only auth middleware
database/migrations.ts # SQLite schema
database/queries.ts # All DB operations + recursive tree builder
routes/task-lists.ts # Task list CRUD routes
routes/tasks.ts # Task CRUD + subtask routes
