CLI for interacting with the Bug Tracker API
Project description
Bug-Tracker
A comprehensive issue tracking system with both web interface and command-line interface, featuring automated tag generation and intelligent assignee suggestions.
Features
- Web Interface: Modern, responsive web UI for managing projects, issues, and tags
- Command Line Interface: Full CLI for automation and power users
- Project Management: Create and organize projects with associated issues
- Issue Tracking: Complete CRUD operations with filtering and search capabilities
- Automated Tag Generation: AI-powered tag suggestions based on issue content
- Smart Assignee Assignment: Intelligent assignee suggestions based on expertise and workload
- Analytics Dashboard: Visual insights with charts
- Tag Management: Organize and analyze tag usage across projects
Quick Start
Prerequisites
- Python 3.8 or higher
- Virtual environment (recommended)
Installation
- Clone the repository:
git clone <repository-url>
cd Bug-Tracker
- Create and activate a virtual environment:
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
- Install dependencies:
pip install -r requirements.txt
- Start the web server:
uvicorn app:app --reload
- Open your browser and navigate to
http://localhost:8000
Web Interface
The web interface provides:
- Dashboard (
/) - Overview with statistics and charts - Projects (
/projects) - Manage projects and view associated issues - Issues (
/issues) - Create, edit, filter, and manage issues - Tags (
/tags) - Manage tags and view usage analytics
API Documentation
When the server is running, access the interactive API documentation:
- Swagger UI:
http://localhost:8000/docs - ReDoc:
http://localhost:8000/redoc
Command Line Interface
The CLI is published on PyPI and can also be run directly from the repo. Use whichever invocation matches how you installed it:
- Installed from PyPI (or
pip install .): run commands withcli ... - Running directly from the repo without installing: use
python -m cli ...
Install from PyPI
pip install bug-tracker-cli
# verify installation
cli --help
Set API_URL to point at your deployment when needed (defaults to the hosted demo), and optionally API_TOKEN if auth is enabled.
Run locally from this repo
# from the project root without installing
python -m cli --help
Project Management
# Create a project
cli projects add --name "My Project"
# List projects
cli projects list
# Update project name
cli projects update --old-name "Old Name" --new-name "New Name"
# Delete a project
cli projects rm --name "Project Name"
Issue Management
# Create an issue
cli issues add --project-name "My Project" --title "Bug Report" --priority high --status open
# Create issue with auto-features
cli issues add --project-id 1 --title "Feature Request" --priority medium --status open --auto-tags --auto-assignee
# List issues with filters
cli issues list --priority high --status open
cli issues list --project-name "My Project" --tags "frontend,bug"
# Update an issue
cli issues update --id 42 --status closed --assignee "john_doe"
# Delete an issue
cli issues rm 42
Tag Management
# List tags
cli tags list
# Show tag usage statistics
cli tags list --stats
# Rename a tag globally
cli tags rename --old-name "frontend" --new-name "ui"
# Delete a tag
cli tags delete --id 5
# Clean up unused tags
cli tags cleanup
Architecture
Main project Structure
Bug-Tracker/
├── app.py # FastAPI web application
├── config.py # Configuration settings
├── requirements.txt # Python dependencies
├── cli/ # Command line interface
│ ├── main.py # CLI commands and logic
│ └── __main__.py # CLI entry point
├── core/ # Core business logic
│ ├── models.py # Database models
│ ├── schemas.py # Pydantic schemas
│ ├── db.py # Database configuration
│ ├── validation.py # Data validation
│ ├── automation/ # Automation features
│ │ ├── tag_generator.py # Auto tag generation
│ │ └── assignee_suggestion.py # Smart assignee assigner
│ └── repos/ # Data access layer
│ ├── projects.py # Project repository - handles project creation, retrieval, updates, deletion
│ ├── issues.py # Issue repository - manages issue CRUD, filtering, tag associations, auto-assignment
│ └── tags.py # Tag repository - tag operations, usage stats, cleanup, renaming
├── web/ # Web interface
│ ├── api/ # REST API endpoints
│ │ ├── projects.py
│ │ ├── issues.py
│ │ └── tags.py
│ │
│ ├── templates/ # HTML templates
│ └── static/ # CSS, JavaScript, assets
└── tests/ # Test suite
Technology Stack
- Backend: FastAPI, SQLAlchemy, SQLite
- Frontend: HTML5, CSS3, JavaScript, Chart.js
- CLI: Typer
- Testing: pytest
- Automation Features:
- Tag Generation: Custom keyword-based algorithms
- Assignee Assignment: Data-driven expertise and workload analysis
Automation Features
Automatic Tag Generation
The system can automatically suggest tags based on issue content:
# Keywords are analyzed from title, description, and logs
Keywords = {
"bug": ["error", "bug", "fail", "crash", "broken", "issue"],
"frontend": ["ui", "frontend", "interface", "button", "form", "page"],
"backend": ["backend", "server", "api", "database", "db"],
"performance": ["slow", "performance", "timeout", "lag"]
}
Smart Assignee Assignment
Assignee suggestions are based on:
- Tag expertise (success rate with specific tags)
- Current workload (number of open issues)
Assignment logic only applies to:
- Status: "open" (unresolved issues)
- Priority: "high" (critical issues need immediate attention by best experts)
Database Schema
The system uses SQLite with the following main entities:
- Projects: Container for organizing issues
- Issues: Core tracking entity with title, description, log, summary, status, priority, assignee
- Tags: Categorization system with many-to-many relationship to issues
- Issue-Tag Association: Junction table for flexible tagging
API Endpoints
Projects
GET /projects/- List all projectsPOST /projects/- Create new projectGET /projects/{id}- Get project detailsPUT /projects/{id}- Update projectDELETE /projects/{id}- Delete projectGET /projects/{id}/issues- Get project issues
Issues
GET /issues/- List issues (with filtering)POST /issues/- Create new issueGET /issues/{id}- Get issue detailsPUT /issues/{id}- Update issueDELETE /issues/{id}- Delete issuePOST /issues/{id}/auto-assign- Auto-assign issuePOST /issues/suggest-tags- Get tag suggestions
Tags
GET /tags/- List all tagsDELETE /tags/{id}- Delete tagPATCH /tags/rename- Rename tag globallyDELETE /tags/cleanup- Remove unused tagsGET /tags/stats/usage- Get usage statistics
Testing
Run the test suite:
# Run all tests
pytest
# Run specific test categories
pytest tests/test_api_*.py # API tests
pytest tests/test_repo_*.py # Repository tests
pytest tests/test_cli.py # CLI tests
Configuration
The application can be configured through environment variables or config.py:
DATABASE_URL: Database connection string (default: SQLite)
Development
Code Structure
- Repository Pattern: Clean separation between business logic and data access through repository classes
- Schema Validation: Pydantic schemas ensure data integrity
- Error Handling: Consistent exception handling across CLI and API
- Separation of Concerns: Clear separation between web, CLI, and core logic
Adding New Features
- Define data models in
core/models.py - Create Pydantic schemas in
core/schemas.py - Implement repository methods in
core/repos/ - Add API endpoints in
web/api/ - Add CLI commands in
cli/main.py - Create tests in
tests/
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bug_tracker_cli-0.1.2.tar.gz.
File metadata
- Download URL: bug_tracker_cli-0.1.2.tar.gz
- Upload date:
- Size: 32.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4ef012ef71aadc2ad757dc202f1f06b61bbea337aac8c82a77fb6c690a89151d
|
|
| MD5 |
4889fead4a07c33b4f187b05b1df7f8e
|
|
| BLAKE2b-256 |
1379fde9047ad60a5b1ab2d1baa638848cba6875e9a40fed210a83206938c6b2
|
File details
Details for the file bug_tracker_cli-0.1.2-py3-none-any.whl.
File metadata
- Download URL: bug_tracker_cli-0.1.2-py3-none-any.whl
- Upload date:
- Size: 41.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e519fd97fbe93647c4987b012b2845b1ad0b840e50c5de5056b4fc4c99f1c39b
|
|
| MD5 |
440602be52e0ca90c4a76b0fbc23b9b9
|
|
| BLAKE2b-256 |
157ef6dd9adee58037398c7e6d185f2205787630e64f8257cbd8725f30ec8d67
|