Skip to content

shubh100802/Support-Ticket-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Support Ticket System

A full-stack support ticket application with LLM-assisted ticket classification.

Quick Start (From a Fresh Clone)

git clone https://github.com/shubh100802/Support-Ticket-System.git
cd Support-Ticket-System

Create .env in project root:

LLM_API_KEY=your_api_key
LLM_MODEL=

Run with Docker:

docker compose up --build

Or follow the local setup steps in the Run Locally (Without Docker) section below.

Features

  • Create support tickets
  • Auto-suggest category and priority from description using an LLM
  • Override suggested values before submission
  • List tickets with combined filters and search
  • Update ticket status
  • View aggregated ticket statistics

Stack

  • Backend: Django + Django REST Framework
  • Database: PostgreSQL
  • Frontend: React (Vite)
  • LLM: OpenAI Chat Completions API
  • Containers: Docker + Docker Compose

Repository Structure

backend/             Django API
frontend/            React app
docker-compose.yml   Multi-service setup

Prerequisites

  • Docker Desktop (or Docker Engine + Compose plugin)
  • Optional for local non-Docker run:
    • Python 3.11+
    • Node.js 20+
    • npm 10+
    • PostgreSQL 14+

Run with Docker (Recommended)

  1. Build and start services:
docker compose up --build
  1. Open:
  • Frontend: http://localhost:5173
  • Backend API: http://localhost:8000/api
  • Django admin: http://localhost:8000/admin

To stop services:

docker compose down

To stop and remove DB volume:

docker compose down -v

Run Locally (Without Docker)

1. Backend

From the project root:

cd backend
python -m venv .venv

Activate virtual environment:

  • macOS/Linux:
source .venv/bin/activate
  • Windows PowerShell:
.venv\Scripts\Activate.ps1

Install dependencies and run migrations:

pip install -r requirements.txt
python manage.py migrate
python manage.py runserver

2. Frontend

In a new terminal:

cd frontend
npm install
npm run dev

3. Database for local mode

Backend reads PostgreSQL from environment variables in backend/.env.example. If those variables are not set, it falls back to SQLite for quick local testing.

API Endpoints

  • POST /api/tickets/
  • GET /api/tickets/
    • Query params: category, priority, status, search
  • PATCH /api/tickets/<id>/
  • GET /api/tickets/stats/
  • POST /api/tickets/classify/

Classify request:

{
  "description": "Card charged twice this month"
}

Classify response:

{
  "suggested_category": "billing",
  "suggested_priority": "high"
}

Fallback response when LLM is unavailable:

{
  "suggested_category": null,
  "suggested_priority": null
}

Notes

  • Stats endpoint uses database-level aggregation.
  • Ticket field constraints are enforced at DB level.
  • CORS is configured for local frontend development on localhost:5173.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors