Backend REST API for the Task Management application.
- Task creation, reading, updating, and deletion
- Task state management (todo, in_progress, done, archived)
- Due date tracking and automatic task processing
- Task printing support (PDF and USB thermal printer)
- Automatic task archiving after completion
- RESTful API with OpenAPI documentation
- Comprehensive logging and error handling
- Install Poetry (if not already installed):
(Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | py -
or
curl -sSL https://install.python-poetry.org | python3 -
- Install dependencies:
poetry install # Installs all dependencies including development ones
# OR
poetry install --only main # For production dependencies only
- Set up environment variables:
Copy-Item .env.example .env
poetry run python -c "import secrets; print(f'SECRET_KEY: {secrets.token_hex(32)}\nADMIN_API_KEY: {secrets.token_hex(32)}')"
- Run database migrations:
poetry run alembic upgrade head
- Start the development server:
poetry run uvicorn taskmanagement_app.main:app --reload
├── taskmanagement_app/
│ ├── api/ # API routes and endpoints
│ │ └── v1/ # API version 1
│ ├── core/ # Core functionality, config, printing
│ ├── crud/ # Database operations
│ ├── db/ # Database models and sessions
│ ├── jobs/ # Background jobs and schedulers
│ └── schemas/ # Pydantic models
├── tests/ # Test files
├── alembic/ # Database migrations
├── .env # Environment variables
├── pyproject.toml # Project dependencies and configuration
└── README.md # Project documentation
Run quality checks with individual tools:
poetry run black .
poetry run isort .
poetry run flake8
poetry run mypy .
poetry run pytest --cov
- Automatically creates PDF files in the configured output directory
- Configure output directory in
config/printers.ini
- Supports ESC/POS compatible printers
- Configure USB vendor_id and product_id in
config/printers.ini
- Prints task details with QR code for quick access
- Default configuration for ZJ-5870 printer included
When the server is running:
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
- OpenAPI Schema: http://localhost:8000/openapi.json
- Fork the repository
- Create a feature branch
- Make your changes
- Run all quality checks:
- Submit a pull request
MIT License - see LICENSE file for details