Backend service for triaging incoming issues with a simple rule-based classifier. Designed to evolve from a clean, stable API into a full triage platform with a data layer, frontend, and ML-based classification.
- A FastAPI backend that accepts issues and returns a triaged result.
- A foundation for a production-ready triage workflow.
POST /issues
Request body:
{
"title": "Payments failing for EU users",
"description": "Checkout returns 500 after submitting card details.",
"service": "checkout",
"environment": "prod"
}Response:
{
"id": "b1c2f02e-7a8d-4a36-9dc1-8e5b3b6c5a8f",
"title": "Payments failing for EU users",
"description": "Checkout returns 500 after submitting card details.",
"service": "checkout",
"environment": "prod",
"status": "new",
"predicted_severity": "critical",
"predicted_category": "outage",
"created_at": "2025-01-01T12:00:00Z"
}All error responses use a single envelope:
{
"code": "validation_error",
"message": "Request validation failed.",
"details": {
"errors": []
}
}Health:
GET /health->{"status": "ok"}
- Create and activate a virtual environment
- Install dependencies
pip install -r requirements.txt- Set environment variables (example)
DATABASE_URL=postgresql+psycopg://user:password@localhost:5432/triage
DB_SCHEMA=issue_triage
- Run the API
uvicorn app.main:app --reload- Data layer discipline: SQLAlchemy models, Alembic migrations, DB constraints, and indexes
- API contract hardening: explicit response models, enums, and error shapes
- Tests: unit tests for triage rules + integration tests for the create issue flow
- Observability: structured logging and error tracking
- Frontend: dashboard for issue intake and triage visualization
- AI: replace rule-based triage with a model and add evaluation metrics
- v0.1: API skeleton + rule-based triage + unified error responses
Each milestone focuses on a specific engineering practice to mirror production-quality systems.