A high-performance, production-ready Todo application built with Python 3.11+ and SQLite, featuring extensive testing including evolutionary techniques to ensure robustness and security.
- Add, toggle, delete, and list tasks with robust validation
- High performance (10ms SLA for all operations)
- Optimized SQLite database with transaction support
- Comprehensive input validation and sanitization
- Protection against SQL injection and other security issues
- Structured JSON logging for observability
- Python 3.11 or higher
- SQLite3
The easiest way to run the application is with Docker:
# Clone the repository
git clone https://github.com/copyleftdev/vibe-todo.git
cd vibe-todo
# Run the application with Docker
docker-compose run app
# Clone the repository
git clone https://github.com/copyleftdev/vibe-todo.git
cd vibe-todo
# Create and activate a virtual environment (optional but recommended)
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Run the application
python -m todo
from todo.models import init_db
from todo.controller import add_task, toggle_done, delete_task, list_tasks
# Initialize database connection
conn = init_db()
# Add a new task
task = add_task(conn, "Complete the project")
print(f"Added task: {task}")
# Toggle a task's status
updated_task = toggle_done(conn, task['id'])
print(f"Toggled task: {updated_task}")
# List all tasks
all_tasks = list_tasks(conn)
print(f"All tasks: {all_tasks}")
# List only completed tasks
done_tasks = list_tasks(conn, done=True)
print(f"Completed tasks: {done_tasks}")
# Delete a task
delete_task(conn, task['id'])
print("Task deleted")
The project includes comprehensive test suites:
# Run all tests with Docker (excluding evolutionary tests)
docker-compose run test-all
# Run all tests including evolutionary tests
docker-compose run test-all-evolutionary
# Run specific test suites
docker-compose run test-unit
docker-compose run test-regression
docker-compose run test-benchmark
docker-compose run test-evolutionary
For local development:
# Run all tests
python run_all_tests.py
# Run all tests including evolutionary tests
python run_all_tests.py --evolutionary
# Run tests in quick mode
python run_all_tests.py --quick
# Run linting with Docker
docker-compose run lint
# Run linting locally
ruff check .
black --check .
mypy todo tests
The repository includes a pre-commit hook that runs tests before allowing commits:
# Set up the pre-commit hook
python setup_hooks.py
The application follows a modular architecture:
todo/models.py
- Database initialization and schematodo/controller.py
- Core business logic and database operationstodo/validation.py
- Input validation and sanitizationtests/
- Comprehensive test suites
The project embraces thorough testing:
- Unit Tests - Basic functionality validation
- Hypothesis Tests - Property-based tests with randomized inputs
- Regression Tests - Tests for known edge cases
- Benchmark Tests - Performance tests to ensure SLA compliance
- Evolutionary Tests - Uses DEAP to evolve inputs that might break the system
All operations must meet a Service-Level Agreement (SLA) of 10 milliseconds maximum latency per task operation. The benchmark tests verify this requirement continuously.
The application employs several security measures:
- All user inputs are validated and sanitized
- Protection against SQL injection
- Proper handling of special characters and large inputs
- Transaction-based operations with rollback capability
- 1.0.0 (2025-04-13) - Initial release with core functionality, Docker support, and comprehensive testing
This project is licensed under the MIT License - see the LICENSE file for details.