# shanmukhapasumarthi/ai-customer-ticket architecture

> Architecture diagram of the GitHub repository shanmukhapasumarthi/ai-customer-ticket, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/shanmukhapasumarthi/ai-customer-ticket
- Repository: https://github.com/shanmukhapasumarthi/ai-customer-ticket

## Overview

Customers submit ticket details in the Streamlit interface, which POSTs them to the FastAPI ticket endpoint and displays the returned classification and status. The endpoint delegates creation and retrieval to the service layer; that layer classifies the message and persists the ticket through SQLite. The application entry point initializes the database and mounts the API router. The README documents the end-to-end frontend/API flow; the sampled source shows the calls and storage operations. Other README-listed deployment and testing capabilities are outside this runtime map.

Main entry points: [`src/api/routes.py`](https://github.com/shanmukhapasumarthi/ai-customer-ticket/blob/main/src/api/routes.py) (Ticket endpoint), [`src/backend/services.py`](https://github.com/shanmukhapasumarthi/ai-customer-ticket/blob/main/src/backend/services.py) (Ticket services), [`frontend/app.py`](https://github.com/shanmukhapasumarthi/ai-customer-ticket/blob/main/frontend/app.py) (Streamlit form), [`src/database/database.py`](https://github.com/shanmukhapasumarthi/ai-customer-ticket/blob/main/src/database/database.py) (SQLite access)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Customer interface"]
  node_frontend["Streamlit form<br/>[app.py]"]
end

subgraph group_runtime["API runtime"]
  node_app["FastAPI app<br/>[main.py]"]
  node_routes["Ticket endpoint<br/>[routes.py]"]
end

subgraph group_domain["Ticket processing"]
  node_services["Ticket services<br/>[services.py]"]
  node_classifier["Rule classifier<br/>[classifier.py]"]
end

subgraph group_persistence["Ticket storage"]
  node_database_code["SQLite access<br/>[database.py]"]
  node_sqlite[("SQLite database")]
end

node_customer(("Customer"))

node_customer -->|"submits details"| node_frontend
node_frontend -->|"POSTs ticket"| node_routes
node_routes -->|"returns result"| node_frontend
node_app -->|"mounts router"| node_routes
node_app -->|"initializes database"| node_database_code
node_routes -->|"creates and retrieves"| node_services
node_services -->|"classifies message"| node_classifier
node_services -->|"reads and writes"| node_database_code
node_database_code -->|"reads and writes"| node_sqlite

click node_frontend "https://github.com/shanmukhapasumarthi/ai-customer-ticket/blob/main/frontend/app.py"
click node_app "https://github.com/shanmukhapasumarthi/ai-customer-ticket/blob/main/src/main.py"
click node_routes "https://github.com/shanmukhapasumarthi/ai-customer-ticket/blob/main/src/api/routes.py"
click node_services "https://github.com/shanmukhapasumarthi/ai-customer-ticket/blob/main/src/backend/services.py"
click node_classifier "https://github.com/shanmukhapasumarthi/ai-customer-ticket/blob/main/src/ai/classifier.py"
click node_database_code "https://github.com/shanmukhapasumarthi/ai-customer-ticket/blob/main/src/database/database.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_frontend toneBlue
class node_app,node_routes toneAmber
class node_services,node_classifier toneMint
class node_database_code,node_sqlite toneRose
class node_customer toneIndigo
```

## Components

### Customer interface

- [Streamlit form](https://github.com/shanmukhapasumarthi/ai-customer-ticket/blob/main/frontend/app.py): `frontend/app.py`

### API runtime

- [FastAPI app](https://github.com/shanmukhapasumarthi/ai-customer-ticket/blob/main/src/main.py): `src/main.py`
- [Ticket endpoint](https://github.com/shanmukhapasumarthi/ai-customer-ticket/blob/main/src/api/routes.py): `src/api/routes.py`

### Ticket processing

- [Ticket services](https://github.com/shanmukhapasumarthi/ai-customer-ticket/blob/main/src/backend/services.py): `src/backend/services.py`
- [Rule classifier](https://github.com/shanmukhapasumarthi/ai-customer-ticket/blob/main/src/ai/classifier.py): `src/ai/classifier.py`

### Ticket storage

- [SQLite access](https://github.com/shanmukhapasumarthi/ai-customer-ticket/blob/main/src/database/database.py): `src/database/database.py`
- **SQLite database**

### Other components

- **Customer**

## Connections

- Customer → Streamlit form: submits details (evidence: `README.md`)
- Streamlit form → Ticket endpoint: POSTs ticket (evidence: `frontend/app.py`)
- Ticket endpoint → Streamlit form: returns result (evidence: `src/api/routes.py`)
- FastAPI app → Ticket endpoint: mounts router (evidence: `src/main.py`)
- FastAPI app → SQLite access: initializes database (evidence: `src/main.py`)
- Ticket endpoint → Ticket services: creates and retrieves (evidence: `src/api/routes.py`)
- Ticket services → Rule classifier: classifies message (evidence: `src/backend/services.py`)
- Ticket services → SQLite access: reads and writes (evidence: `src/backend/services.py`)
- SQLite access → SQLite database: reads and writes (evidence: `src/database/database.py`)
