Thank you for your interest in contributing to FastAPI Task Manager! This guide will help you get started.
- Python 3.10+
- uv (package manager)
- Redis (for running the full test suite)
- pre-commit
- Clone the repository:
git clone https://github.com/Morry98/fastapi-task-manager.git cd fastapi-task-manager - Install dependencies:
uv sync
- Install pre-commit hooks:
pre-commit install
- Create a branch for your changes:
git checkout -b your-branch-name
Tip: This project includes a
CLAUDE.mdfile with detailed instructions for Claude Code. If you use Claude Code as your development tool, it will automatically pick up project context, commands, and conventions.
uv run pytestWith coverage:
uv run coverage run -m pytest && uv run coverage reportThe project uses pre-commit hooks that run automatically on git commit. You can also run them manually:
pre-commit run --all-filesThis includes:
- Ruff for linting and formatting (line length: 120)
- Bandit for security checks
- ty for type checking
Before pushing tags, run the manual pre-commit hook to remove local tags that have been deleted on the remote:
pre-commit run --hook-stage manual prune-stale-tagsIt's good practice to run this periodically to keep your local tags in sync with the remote.
- Line length: 120 characters
- Add clear and concise comments to explain non-obvious logic
- All code, comments, and documentation must be in English
- Follow existing patterns in the codebase
Documentation is built with MkDocs Material. To preview locally:
uv run mkdocs serveUse the Bug Report issue template. Include:
- Steps to reproduce
- Expected vs actual behavior
- Python version and OS
- Relevant logs or error messages
Use the Feature Request issue template. Please describe:
- The problem your feature would solve
- Your proposed solution
- Any alternatives you considered
- Open an issue first to discuss the change, unless it's a small fix
- Create a branch from
main - Write your code following the project's code style
- Add or update tests as needed
- Ensure all checks pass (
pre-commit run --all-filesanduv run pytest) - Update documentation if your change affects the public API
- Submit your PR against the
mainbranch
- Keep PRs focused — one feature or fix per PR
- Write a clear title and description
- Reference related issues (e.g.,
Closes #123) - Be responsive to review feedback
src/fastapi_task_manager/
├── task_manager.py # Entry point, FastAPI lifespan integration
├── task_group.py # Task grouping and registration
├── runner.py # Stream mode orchestrator
├── leader_election.py # Distributed leader election via Redis
├── coordinator.py # Task scheduling and stream publishing
├── stream_consumer.py # Redis Streams consumer groups
├── reconciler.py # Stale/failed task recovery
├── statistics.py # Execution history tracking
├── config.py # Pydantic configuration model
├── redis_keys.py # Redis key pattern definitions
├── task_router_services.py # Management API service layer
├── async_utils.py # Shared async utilities
└── schema/ # Pydantic response models
By contributing, you agree that your contributions will be licensed under the MIT License.