- Built a production-style full-stack triage system with FastAPI, a responsive vanilla JS dashboard, and deterministic classification logic.
- Delivered a plain-English input experience so non-technical users can submit tickets without JSON or structured syntax.
- Implemented explainable ticket decisions with priority scoring (P0-P3), team routing, rationale output, and one-line summaries.
- Added optional OpenAI-powered summarization with a robust fallback path to keep results available even without API access.
- Shipped deployment-ready engineering standards: automated CI checks, Docker packaging, Render configuration, and tested API workflows.
- FastAPI app serves both the REST API and the static frontend from a single process.
- Keyword-matching engine in
workflow.pydrives priority and team inference β deterministic and testable. OptionalLLMSummarizerwraps OpenAI with graceful fallback so the app never breaks without a key.- Pydantic models enforce request validation at the API boundary.
- Frontend communicates via
POST /api/triageand requires no build step β plain HTML, CSS, JS.
Paste support tickets in plain English, click Run, and get back:
- Priority level β P0 (critical) to P3 (low)
- Assigned team β Security, Billing, Auth, Platform, or Support
- Reason β why that priority and team were chosen
- Summary β one-line plain English description of the issue
- Keyword-based priority and routing β no model required
- Optional OpenAI integration for richer summaries (
gpt-4.1-mini) - Rule-based fallback summary when AI is unavailable
- Handles multiple tickets in a single run
- Plain-English input β type tickets naturally, no JSON or brackets
- Stats bar: total tickets, critical count, top team, last run time
- Copy and download results buttons
- Detailed view panel for full JSON output
- Mobile-friendly responsive layout
POST /api/triageβ classify and route a batch of ticketsGET /api/tickets/sampleβ load example ticketsGET /api/healthβ health check endpoint- Auto-generated interactive docs at
/docs
- GitHub Actions CI β runs on every push to
main - Dockerfile for containerised deployment
- Docker Compose for local multi-service setup
render.yamlfor one-click Render deployment- 4 automated tests covering triage logic and API endpoints
pip install -r requirements.txtcopy .env.example .env
# Add your OPENAI_API_KEY to .envuvicorn src.api:app --reloadOpen http://127.0.0.1:8000 in your browser.
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/triage |
Classify and route a batch of tickets |
GET |
/api/tickets/sample |
Returns sample tickets |
GET |
/api/health |
Health check |
GET |
/docs |
Interactive Swagger UI |
- FastAPI 0.115 β REST API framework
- Uvicorn β ASGI server
- Pydantic β Request validation and serialisation
- OpenAI SDK β Optional AI summarisation (
gpt-4.1-mini) - Python-dotenv β Environment variable management
- pytest + httpx β API and unit testing
- Docker + Docker Compose β Containerisation
- Render β Cloud deployment target
- GitHub Actions β CI pipeline
AI-Ticket-Triage_Assistant/
βββ .github/
β βββ workflows/
β βββ ci.yml # GitHub Actions CI pipeline
βββ data/
β βββ tickets.json # Sample ticket data
βββ src/
β βββ api.py # FastAPI app, routes, request models
β βββ models.py # Ticket and TriageResult data models
β βββ workflow.py # Priority + team inference engine
β βββ main.py # CLI entry point
βββ tests/
β βββ conftest.py # Pytest path setup
β βββ test_api.py # API and triage logic tests
βββ web/
β βββ index.html # Frontend dashboard
β βββ styles.css # Responsive stylesheet
β βββ app.js # Frontend logic
βββ Dockerfile # Container build definition
βββ docker-compose.yml # Local multi-service config
βββ render.yaml # Render deployment config
βββ requirements.txt # Python dependencies
βββ .env.example # Environment variable template
- β Keyword-based priority scoring (P0βP3)
- β Team routing across 5 domains
- β Rule-based summary fallback
- β Optional OpenAI integration
- β Plain-English ticket input (no JSON)
- β Stats dashboard (total, critical, top team, last run)
- β Copy and download results
- β Responsive mobile layout
- β Batch triage endpoint with Pydantic validation
- β Sample data endpoint
- β Health check endpoint
- β Auto-generated Swagger docs
- β GitHub Actions CI β passing on all pushes
- β Dockerfile for containerised builds
- β Docker Compose for local development
- β
Render deployment config (
render.yaml) - β 4 automated tests
docker build -t ai-ticket-assistant .
docker run -p 8000:8000 --env-file .env ai-ticket-assistantdocker-compose up --buildConnect this repo to Render. It will detect render.yaml automatically and deploy using Docker. Set OPENAI_API_KEY in Render's environment variables (optional).
- API keys are never committed β use
.envlocally and Render environment variables in production. - Input is validated with Pydantic at the API boundary before processing.
- CORS is configured to allow frontendβbackend communication.
Yousaf Zeb Full-Stack Software Engineer | Python Β· FastAPI Β· React Β· CI/CD
