A FastAPI-based issue tracking system supporting users, labels, comments, bulk operations, history tracking, and optimistic concurrency control.
- Create, update, list, filter, bulk update, import from CSV, and view timeline/history for issues
- Assign and update labels for issues (many-to-many)
- Assign issues to users (unique email, versioning for concurrency)
- Add and list comments per issue
- Bulk update status and labels for multiple issues
- Track all changes to issues via timeline endpoint
- Validation for required fields, version conflicts, uniqueness, and format
- Comprehensive test suite for all major features and edge cases
- Alembic migrations for schema management
- Clone the repository
- Create and activate a virtual environment
python -m venv .venv source .venv/bin/activate # On Windows: .venv\Scripts\activate - Install dependencies
pip install -r app/requirements.txt - Configure the database
- Set
DATABASE_URLinapp/.envto your database connection string (used by the app) - Set the database URL in
alembic.iniunder thesqlalchemy.urlfield (used by Alembic migrations):sqlalchemy.url = postgresql+psycopg2://username:password@localhost:5432/issue_tracker_db - Run Alembic migrations if needed:
alembic upgrade head
- Set
uvicorn app.main:app --reload
POST /issues/— Create a new issueGET /issues/— List all issues (filter by status, assignee)GET /issues/{id}— Get a specific issuePATCH /issues/{id}— Update issue fields (title, description, status, assignee, labels, version)POST /issues/bulk-status— Bulk update status/labels for multiple issuesGET /issues/{id}/timeline— Get issue history/eventsPOST /issues/import— Import issues from CSV
- Managed via issue PATCH and bulk update endpoints
- Assign issues to users
- Unique email constraint
- Version field for concurrency control
POST /issues/{issue_id}/comments— Add a comment to an issue
GET /report/top-assignees— List top assignees by issue countGET /report/latency— Get average resolution time for closed issues
- Issue: id, title, description, status, assignee_id, version, created_at, updated_at, resolved_at, labels
- Label: id, name
- User: id, name, email, version
- Comment: id, body, author_id, issue_id, created_at
- IssueEvent: id, issue_id, field, old_value, new_value, created_at
Run all tests:
pytest app/tests/
Tests cover creation, update, bulk update, timeline, validation, labels, assignee, listing, filtering, and edge cases.
- Always provide the latest
versionwhen updating issues or users. - Use bulk endpoints for mass updates.
- Timeline endpoint shows all changes to an issue.
- All endpoints return detailed error messages for invalid input or conflicts.
- Labels and assignees are managed via PATCH and bulk endpoints.
- Timeline/history is available for audit and debugging.