▶ Live demo — the demo is a static JavaScript version that saves tasks in your browser; the main application is written in Python with Flask.
A small task manager with a web interface and a command-line interface, both built on the same business-logic layer and backed by a local SQLite database.
The goal of the project is to stay simple and readable while following good practices: separation of concerns, input validation, error handling and tests.
A mobile screenshot is also available.
- Add, edit and delete tasks (deleting asks for confirmation)
- Mark tasks as done or back to pending
- Priority per task: low, medium or high (shown as colored badges)
- Filter by status: all, pending or done, with counters
- Progress bar, empty states and clear validation messages (e.g. blank titles)
- Responsive light theme with a pastel orange and green palette (WCAG AA text contrast)
- Data persists between runs in SQLite
- Databases from the first version of the project are migrated automatically
- A corrupted database file is moved aside instead of crashing the app
- Python 3.10+
- Flask for the web interface (HTML, CSS and a few lines of JavaScript)
- SQLite (
sqlite3from the standard library) - Nunito font, self-hosted (SIL Open Font License)
- pytest for automated tests
task_manager/
├── core.py # Business logic: TaskManager, validation, SQLite storage
├── cli.py # Terminal interface (uses core only)
└── web/
├── app.py # Flask routes (uses core only)
├── templates/ # Jinja templates
└── static/ # CSS and JavaScript
tests/
├── test_core.py # Business-logic tests
├── test_web.py # Web route tests
└── e2e/ # Playwright tests of the static demo
demo/ # Static JavaScript demo for GitHub Pages
scripts/ # Screenshot and demo build helpers
Both interfaces only call TaskManager; neither knows anything about SQL.
Requires Python 3.10 or newer.
git clone https://github.com/sugixp/task-manager.git
cd task-manager
python -m venv .venv
# Windows
.venv\Scripts\activate
# macOS / Linux
source .venv/bin/activate
pip install -r requirements.txtpython -m task_manager.web.appThen open http://127.0.0.1:5000. You can also use the Flask CLI:
flask --app task_manager.web.app runDebug mode is off by default. To enable it during development, set
FLASK_DEBUG=1 before running the command.
python -m task_manager.cli=== Task Manager ===
1. Add task
2. List tasks
3. Edit task
4. Toggle done / pending
5. Delete task
6. Quit
Choose an option: 2
Show (all/pending/done) [all]:
=== Your tasks (all) ===
[ ] 3. Update portfolio (high)
[ ] 2. Read a book (low)
[x] 1. Study Flask (medium)
The live demo lives in demo/ and is
plain HTML, CSS and JavaScript using localStorage. It reuses the Flask app's
style.css, which is copied in at build time. It is deployed automatically by
the Deploy demo to GitHub Pages workflow. To preview it locally:
python scripts/build_demo.py
python -m http.server --directory _site| Environment variable | Purpose | Default |
|---|---|---|
TASK_MANAGER_DB |
Path to the SQLite database file | tasks.db in the project root |
TASK_MANAGER_SECRET_KEY |
Key used to sign the web session (flash messages) | Random key generated at startup |
FLASK_DEBUG |
Set to 1 to enable Flask debug mode |
Off |
The database file is local user data and is ignored by Git.
Unit and web tests (no browser needed):
pip install -r requirements-dev.txt
python -m pytestEnd-to-end tests of the static demo, using Playwright.
They build the demo into _site/, serve it locally and drive it in headless Chromium.
They are excluded from the default run, so pass the folder explicitly:
pip install -r requirements-e2e.txt
python -m playwright install chromium
python -m pytest tests/e2eBoth suites run on every push and pull request in GitHub Actions.
The images in docs/ are generated with Playwright
using a temporary database with sample tasks (your tasks.db is not touched):
pip install -r requirements-e2e.txt
python -m playwright install chromium
python scripts/screenshot.py