A minimalist, terminal-styled todo application built with modern web technologies.
Frontend:
Backend:
?add=your+task)simple-todo/
├── client/ # Svelte frontend
│ ├── src/
│ │ ├── lib/
│ │ │ ├── components/ # TodoInput, TodoItem, TodoList
│ │ │ ├── stores/ # Svelte stores for state management
│ │ │ └── api/ # API client functions
│ │ ├── App.svelte # Main component + URL param handling
│ │ └── app.css # Terminal theme
│ └── vite.config.ts # Vite configuration with API proxy
│
├── server/ # Fastify backend
│ ├── src/
│ │ ├── db/ # Database schema, queries, connection
│ │ ├── routes/ # REST API endpoints
│ │ ├── middleware/ # Zod validation schemas
│ │ ├── server.ts # Fastify app initialization
│ │ └── config.ts # Environment configuration
│ └── data/
│ └── todos.db # SQLite database
│
└── shared/ # Shared TypeScript types
└── types.ts
Both the backend and frontend are currently running:
To start them manually in the future:
# Terminal 1 - Start backend
cd server
npm run dev
# Terminal 2 - Start frontend
cd client
npm run dev
Or use the convenience script from the root:
npm run dev
(Note: This requires concurrently to be installed at the root level)
GET /api/todos # List all todos
POST /api/todos # Create todo
GET /api/todos/:id # Get single todo
PATCH /api/todos/:id # Update todo
DELETE /api/todos/:id # Delete todo
POST /api/todos/:id/complete # Toggle completion
GET /health # Health check
Add a todo directly via URL:
http://localhost:5174/?add=Buy+groceries
The task will be created automatically and the URL will be cleaned.
The SQLite database includes tables for future extensibility:
CREATE TABLE todos (
id INTEGER PRIMARY KEY AUTOINCREMENT,
description TEXT NOT NULL,
completed INTEGER DEFAULT 0,
created_at TEXT DEFAULT (datetime('now')),
updated_at TEXT DEFAULT (datetime('now')),
-- Future features
due_date TEXT,
priority INTEGER,
notes TEXT
);
-- Future tags support (many-to-many)
CREATE TABLE tags (...);
CREATE TABLE todo_tags (...);
> prefix[ ] for incomplete, [x] for complete#4ec9b0) - Success/completed tasks#dcdcaa) - Active/pending tasks#f48771) - Delete actions/errorsThe architecture supports these extensions:
API endpoints have been tested and verified:
# Create todo
curl -X POST http://localhost:3000/api/todos \
-H "Content-Type: application/json" \
-d '{"description": "Test task"}'
# List todos
curl http://localhost:3000/api/todos
# Toggle completion
curl -X POST http://localhost:3000/api/todos/1/complete
# Delete todo
curl -X DELETE http://localhost:3000/api/todos/1
/api/* requests are proxied to http://localhost:3000Server won't start:
# Ensure data directory exists
mkdir -p server/data
# Reinstall dependencies
cd server && npm install
Client won't start:
# Reinstall dependencies
cd client && npm install
# Clear Vite cache
rm -rf client/node_modules/.vite
Port conflicts:
PORT env var)MIT