# id0omb/ict3113_p2-3 architecture

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

- Interactive diagram: https://gitdiagram.com/id0omb/ict3113_p2-3
- Repository: https://github.com/id0omb/ict3113_p2-3

## Overview

This repository implements a local complaint-ticket classification service: a client submits a narrative, the service classifies it with an Ollama-hosted model, stores the result, and returns the category. It also provides full-text search, category counts, health information, and request logging. The README frames this service as a system under test for performance and accuracy evaluation. The sampled application source shows the runtime routes and integrations; deployment and measurement details are not mapped where their implementation was not shown.

Main entry points: [`app/app.py`](https://github.com/id0omb/ict3113_p2-3/blob/main/app/app.py) (Request logging)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["Service API"]
  node_submit["Ticket submission<br/>[app.py]"]
  node_search["Ticket search<br/>[app.py]"]
  node_stats["Category statistics<br/>[app.py]"]
  node_health["Health endpoint<br/>[app.py]"]
end

subgraph group_classification["Classification"]
  node_classifier["Ticket classifier<br/>[app.py]"]
  node_ollama["Ollama model service"]
end

subgraph group_data["Persistence and Observability"]
  node_postgres[("Ticket database")]
  node_request_logging["Request logging<br/>[app.py]"]
end

node_client(("Client"))
node_log_file["Log file"]

node_client -->|"submits ticket"| node_submit
node_client -->|"searches tickets"| node_search
node_client -->|"requests counts"| node_stats
node_client -->|"checks status"| node_health
node_submit -->|"classifies narrative"| node_classifier
node_classifier -->|"requests inference"| node_ollama
node_submit -->|"stores result"| node_postgres
node_search -->|"queries tickets"| node_postgres
node_stats -->|"counts categories"| node_postgres
node_submit -->|"records request"| node_request_logging
node_search -->|"records request"| node_request_logging
node_stats -->|"records request"| node_request_logging
node_health -->|"records request"| node_request_logging
node_request_logging -->|"writes events"| node_log_file

click node_submit "https://github.com/id0omb/ict3113_p2-3/blob/main/app/app.py"
click node_search "https://github.com/id0omb/ict3113_p2-3/blob/main/app/app.py"
click node_stats "https://github.com/id0omb/ict3113_p2-3/blob/main/app/app.py"
click node_health "https://github.com/id0omb/ict3113_p2-3/blob/main/app/app.py"
click node_classifier "https://github.com/id0omb/ict3113_p2-3/blob/main/app/app.py"
click node_request_logging "https://github.com/id0omb/ict3113_p2-3/blob/main/app/app.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_submit,node_search,node_stats,node_health,node_client toneBlue
class node_classifier,node_ollama toneAmber
class node_postgres,node_request_logging toneMint
class node_log_file toneIndigo
```

## Components

### Service API

- [Ticket submission](https://github.com/id0omb/ict3113_p2-3/blob/main/app/app.py): `app/app.py`
- [Ticket search](https://github.com/id0omb/ict3113_p2-3/blob/main/app/app.py): `app/app.py`
- [Category statistics](https://github.com/id0omb/ict3113_p2-3/blob/main/app/app.py): `app/app.py`
- [Health endpoint](https://github.com/id0omb/ict3113_p2-3/blob/main/app/app.py): `app/app.py`

### Classification

- [Ticket classifier](https://github.com/id0omb/ict3113_p2-3/blob/main/app/app.py): `app/app.py`
- **Ollama model service**

### Persistence and Observability

- **Ticket database**
- [Request logging](https://github.com/id0omb/ict3113_p2-3/blob/main/app/app.py): `app/app.py`

### Other components

- **Client**
- **Log file**

## Connections

- Client → Ticket submission: submits ticket (evidence: `README.md`)
- Client → Ticket search: searches tickets (evidence: `app/app.py`)
- Client → Category statistics: requests counts (evidence: `app/app.py`)
- Client → Health endpoint: checks status (evidence: `app/app.py`)
- Ticket submission → Ticket classifier: classifies narrative (evidence: `app/app.py`)
- Ticket classifier → Ollama model service: requests inference (evidence: `app/app.py`)
- Ticket submission → Ticket database: stores result (evidence: `app/app.py`)
- Ticket search → Ticket database: queries tickets (evidence: `app/app.py`)
- Category statistics → Ticket database: counts categories (evidence: `app/app.py`)
- Ticket submission → Request logging: records request (evidence: `app/app.py`)
- Ticket search → Request logging: records request (evidence: `app/app.py`)
- Category statistics → Request logging: records request (evidence: `app/app.py`)
- Health endpoint → Request logging: records request (evidence: `app/app.py`)
- Request logging → Log file: writes events (evidence: `app/app.py`)
