Task Manager PRO is a production-grade distributed task management system combining a Python CLI tool with a modern REST API.
It demonstrates mastery of full-stack development: SQLAlchemy ORM, FastAPI REST endpoints, JWT authentication, comprehensive testing, and CI/CD automation.
- 17 Production-Ready Endpoints across 3 resource types
- JWT Bearer Token Authentication
- Full pagination support (skip/limit)
- Automatic OpenAPI/Swagger documentation
- CORS middleware enabled
- bcrypt password hashing (12-round salting)
- JWT token generation and validation
- User isolation (tasks scoped by user)
- Pydantic v2 input validation
- Environment variable credential management
- SQLAlchemy ORM with SQLite/PostgreSQL support
- User and Task models with relationships
- Automatic timestamp tracking
- Query optimization with indexes
- Migration utilities for data portability
- 15 comprehensive API integration tests
- 4+ unit tests for core functionality
- Full test isolation with database cleanup
- 100% passing test suite (20/20 β )
- GitHub Actions CI/CD pipeline
- User login system
- Add/Update/Delete/List tasks
- Mark tasks completed
- Task filtering and summaries
- JSON-based storage
- Email reminders via SMTP
- CRON automation support
| Layer | Technology |
|---|---|
| API Framework | FastAPI 0.100+, Uvicorn |
| Database | SQLAlchemy 2.0+, SQLite/PostgreSQL |
| Security | bcrypt, PyJWT, Pydantic v2 |
| Testing | pytest, pytest-cov |
| DevOps | GitHub Actions, Docker |
| CLI | argparse, python-dotenv |
| Python | 3.10, 3.11, 3.12 |
# Install dependencies
pip install -r requirements.txt
# Start the development server
uvicorn task_manager_pro.api.main:app --reload
# Access documentation
# - Interactive Docs: http://localhost:8000/docs
# - ReDoc: http://localhost:8000/redocpip install -e .
task-manager login --username <username>
task-manager add-task --title "My Task" --due 2025-12-31- QUICKSTART.md - Get started with the API in 5 minutes
- IMPLEMENTATION_SUMMARY.md - Complete project overview
- docs/PHASE2_DATABASE_SECURITY.md - Database architecture
- docs/PHASE3_REST_API.md - API reference with examples
- docs/PHASE4_TESTING_CI_CD.md - Testing infrastructure
task_manager_pro/
βββ api/ # REST API Layer (Phase 3)
β βββ main.py # FastAPI app with 17 endpoints
β βββ dependencies.py # JWT auth & dependency injection
β βββ routes/
β βββ auth.py # Authentication endpoints
β βββ tasks.py # Task CRUD operations
β βββ users.py # User management
βββ storage/ # Data Persistence (Phase 2)
β βββ database.py # SQLAlchemy setup
β βββ models.py # ORM entities (User, Task)
β βββ sql_storage.py # SQL implementation
β βββ json_storage.py # Original JSON storage
β βββ interface.py # Storage abstraction
β βββ migration.py # Data migration utilities
βββ schemas/ # Validation (Phase 2)
β βββ user.py # User request/response schemas
β βββ task.py # Task request/response schemas
βββ services/ # Business Logic
β βββ task_manager.py # Core task operations
βββ models/ # Domain Models
β βββ task.py
β βββ user.py
βββ utils/ # Utilities
β βββ security.py # bcrypt, JWT, password hashing
β βββ decorators.py
β βββ emailer.py # SMTP integration
β βββ logger_context.py
β βββ session.py
βββ cli.py # CLI entrypoint (argparse)
βββ send_reminders.py # Reminder automation
tests/ # Test Suite (Phase 4)
βββ test_api.py # 15 API integration tests β
βββ test_tasks.py # Task unit tests
βββ test_users.py # User model tests
βββ test_email.py # Email utility tests
.github/workflows/ # CI/CD Pipeline (Phase 4)
βββ ci-cd.yml # GitHub Actions workflow
docs/ # Documentation
βββ PHASE2_DATABASE_SECURITY.md
βββ PHASE3_REST_API.md
βββ PHASE4_TESTING_CI_CD.md
.env.template # Environment variables template
dockerfile # Container image
requirements.txt # Dependencies
requirements_dev.txt # Dev dependencies
pyproject.toml # Project config & CLI registration
Key Design Patterns:
- Layered Architecture: Routes β Validation β Services β Storage β Database
- Dependency Injection: FastAPI dependencies for auth and storage
- Abstract Interfaces: StorageInterface supports multiple backends
- Security-First: JWT tokens, bcrypt hashing, Pydantic validation
uvicorn task_manager_pro.api.main:app --reloadAccess interactive docs: http://localhost:8000/docs
# Register
curl -X POST http://localhost:8000/api/auth/register \
-H "Content-Type: application/json" \
-d '{
"username": "john_doe",
"email": "john@example.com",
"password": "secure_password_123"
}'
# Login
curl -X POST http://localhost:8000/api/auth/login \
-H "Content-Type: application/json" \
-d '{
"username": "john_doe",
"password": "secure_password_123"
}'TOKEN="your_jwt_token"
# Create task
curl -X POST http://localhost:8000/api/tasks \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"title": "Buy groceries",
"description": "Milk, bread, eggs",
"due_date": "2025-12-31",
"priority": "high"
}'
# List tasks (paginated)
curl -X GET "http://localhost:8000/api/tasks?skip=0&limit=10" \
-H "Authorization: Bearer $TOKEN"
# Update task
curl -X PUT http://localhost:8000/api/tasks/{task_id} \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"completed": true}'
# Delete task
curl -X DELETE http://localhost:8000/api/tasks/{task_id} \
-H "Authorization: Bearer $TOKEN"For complete API examples, see QUICKSTART.md
pip install -e .# Login
task-manager login --username <username>
# Add task
task-manager add-task --title <title> --desc <description> --due <yyyy-mm-dd>
# List tasks
task-manager list-tasks --filter all --verbose
# Mark completed
task-manager complete-task --id <task_id>
# Delete task
task-manager delete-task --id <task_id>
# Toggle email reminders
task-manager toggle-email-reminders
# Logout
task-manager logoutRun the comprehensive test suite:
# All tests (20/20 passing)
pytest tests/ -v
# With coverage report
pytest tests/ --cov=task_manager_pro
# Specific test file
pytest tests/test_api.py -v
# Specific test
pytest tests/test_api.py::test_create_task_authenticated -vTest Coverage:
- 15 API integration tests (authentication, CRUD, pagination)
- 4+ unit tests (task models, user models)
- 100% test isolation with fresh database per test
- Full authentication flow testing
- Error case and edge case coverage
- JWT Bearer tokens with HS256 encryption
- 30-minute token expiration (configurable)
- Secure token refresh endpoint
- User isolation on all operations
- bcrypt hashing with 12-round salting
- Never stored in plain text
- Secure comparison to prevent timing attacks
- Pydantic v2 schema validation on all endpoints
- Email format validation
- Username and password constraints
- Type checking and automatic coercion
- All secrets use environment variables
.env.templatefor safe configuration.envexcluded from git via.gitignore- Database passwords in connection strings
- Hardened
.gitignore(databases, keys, secrets excluded) - No sensitive data in git history
- Docker image security best practices
- GitHub Actions secrets for CI/CD
For detailed security audit, see git commit: 7f49c77
- Enable App Passwords: https://myaccount.google.com/apppasswords
- Create
.envfile:
EMAIL_USER=your_email@gmail.com
EMAIL_PASS=your_app_password_here
SMTP_SERVER=smtp.gmail.com
SMTP_PORT=587- Toggle reminders:
task-manager toggle-email-reminderscrontab -e
# Add this line to run daily at 9:00 AM:
0 9 * * * /bin/bash -c 'source /path/to/venv/bin/activate && python /path/to/task_manager_pro/send_reminders.py'docker build -t task-manager-pro:latest .docker run -p 8000:8000 \
-e DATABASE_URL="sqlite:///./tasks.db" \
-e SECRET_KEY="your-secret-key" \
task-manager-pro:latestdocker run -p 8000:8000 \
-e DATABASE_URL="postgresql://user:password@postgres:5432/taskdb" \
-e SECRET_KEY="your-secret-key" \
task-manager-pro:latest- Phase 1: Branch consolidation and analysis
- Phase 2: Database (SQLAlchemy) & Security (JWT, bcrypt)
- Phase 3: REST API with FastAPI (17 endpoints)
- Phase 4: Testing (20 tests) & CI/CD (GitHub Actions)
- Phase 5: Advanced features (tags, categories, subtasks, time tracking)
- Phase 6: Web UI (React/Vue) & monitoring (logging, APM)
- FastAPI & REST APIs - 17 production endpoints
- SQLAlchemy ORM - Relational database modeling
- JWT Authentication - Secure token-based auth
- Pydantic Validation - Type-safe input/output
- Python CLI - argparse command-line tools
- Password Hashing - bcrypt with salting
- Credential Management - Environment variables
- Git Security - Sensitive data exclusion
- Docker - Container orchestration
- GitHub Actions - CI/CD automation
- pytest Framework - Unit and integration tests
- Test Fixtures - Database cleanup and isolation
- API Testing - Full endpoint coverage
- Coverage Reports - Code quality metrics
- Layered Architecture - Clean separation of concerns
- Design Patterns - Dependency injection, factories
- SOLID Principles - Single responsibility, interfaces
- Code Organization - Modular, scalable structure
DATABASE_URL=postgresql://user:password@localhost/taskdb
SECRET_KEY=your-secret-key-change-in-production
JWT_ALGORITHM=HS256
JWT_EXPIRATION_HOURS=0.5
DEBUG=False- Set environment variables in hosting platform
- Use PostgreSQL for production database
- Set
DEBUG=Falsein production - Enable HTTPS only
- Use GitHub Secrets for CI/CD credentials
- All code includes type hints for IDE support
- Modular architecture enables easy testing and maintenance
- Abstraction via
StorageInterfacesupports multiple backends - Clean OOP design with composition and proper encapsulation
- Fully documented with docstrings and comments
Feel free to fork, enhance, and submit a pull request. To suggest features or report bugs, open an issue.
This project is licensed under the GNU General Public License v3.0. See the LICENSE file for more details.
Built with β€οΈ by Satvik Praveen