todo-app
Simple todo list application demonstrating App Hub platform standards
Purpose
Created as a reference implementation showing standardized tech stack (AppHubApp, shared UI framework, process management)
Tech Stack
Tags
Shared Services
Startup Command
python3 app.py
Run from project directory: /root/ily.dog/apps/todo-app
README
Todo App
A simple todo list application demonstrating App Hub platform standards.
Features
- Add, edit, delete todos
- Mark todos as complete/incomplete
- Real-time statistics (total, completed, pending)
- Uses shared UI framework
- Uses common backend framework
- Managed by App Hub process manager
- AppHubApp base class from
shared_backend/apphub_backend.py - DatabaseManager for SQLite persistence
- Standardized API responses (success/error)
- Built-in error handling
- Shared UI framework (
css/apphub.css) - apphub.js utilities for API calls
- No frontend frameworks (pure HTML/CSS/JS)
- Responsive dark theme
- Auto-port allocation via App Hub
- Start/stop/restart from App Hub
- Health monitoring
Tech Stack
This app demonstrates the App Hub standardized tech stack:
Backend
Frontend
Process Management
Running
Manual
cd ~/projects/todo-app
python3 app.py
Via App Hub
1. Visit http://localhost:5002/processes 2. Click "Start" for todo-app 3. Port will be auto-allocatedAPI Endpoints
GET / - Todo list UIGET /api/todos - List all todosPOST /api/todos - Create todo (JSON: {"title": "..."})PUT /api/todos/ - Update todo (JSON: {"title": "...", "completed": true/false})DELETE /api/todos/ - Delete todoDatabase Schema
CREATE TABLE todo_items (
id INTEGER PRIMARY KEY AUTOINCREMENT,
title TEXT NOT NULL,
completed INTEGER DEFAULT 0,
created_at TEXT DEFAULT CURRENT_TIMESTAMP,
updated_at TEXT DEFAULT CURRENT_TIMESTAMP
);
Code Examples
Creating the App
from apphub_backend import AppHubAppapp = AppHubApp('todo-app')
Database Queries
Query all todos
todos = app.db.execute('todo-app', 'SELECT * FROM todo_items', fetch='all')Insert todo
app.db.execute('todo-app', 'INSERT INTO todo_items (title) VALUES (?)', (title,))
API Responses
Success
return app.api.success(data)Error
return app.api.error('Not found', 404)
This is a Reference Implementation
This app serves as a template for new App Hub applications. When building new apps, follow this pattern:
1. Use AppHubApp base class
2. Use shared UI framework
3. Include proper manifest.yaml with startup_cmd
4. Use DatabaseManager for data persistence
5. Keep frontend simple (no frameworks)
See ~/projects/app-hub/ARCHITECT_GUIDANCE.md for complete standards documentation.
Project Location: /root/ily.dog/apps/todo-app