# mehdichihi-web/ticket_it_classifier architecture

> Architecture diagram of the GitHub repository mehdichihi-web/ticket_it_classifier, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mehdichihi-web/ticket_it_classifier
- Repository: https://github.com/mehdichihi-web/ticket_it_classifier

## Overview

IT Ticket Classifier lets users authenticate, submit natural-language IT issues, receive category/priority/team predictions, and review ticket results. Its main runtime flow runs from the React app through Express to FastAPI, then stores the prediction in MongoDB and returns the ticket. Separate branches cover personal history, dashboard statistics, and administrator ticket/user management. The README documents these capabilities; some frontend service wiring and unsampled backend internals are represented only where the tree or README supports them.

Main entry points: [`frontend/src/App.jsx`](https://github.com/mehdichihi-web/ticket_it_classifier/blob/main/frontend/src/App.jsx) (App routing), [`frontend/src/services/api.js`](https://github.com/mehdichihi-web/ticket_it_classifier/blob/main/frontend/src/services/api.js) (API services), [`backend/app.js`](https://github.com/mehdichihi-web/ticket_it_classifier/blob/main/backend/app.js) (Express app), [`backend/controllers/ticketController.js`](https://github.com/mehdichihi-web/ticket_it_classifier/blob/main/backend/controllers/ticketController.js) (Ticket controller)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["React application"]
  node_app["App routing<br/>[App.jsx]"]
  node_login["Login<br/>[Login.jsx]"]
  node_create["Create ticket<br/>[CreerTicket.jsx]"]
  node_history["Ticket history<br/>[Historique.jsx]"]
  node_dashboard["Dashboard<br/>[Dashboard.jsx]"]
  node_adminui["Admin panel<br/>[Admin.jsx]"]
  node_clientapi["API services<br/>[api.js]"]
end

subgraph group_backend["Express API"]
  node_express["Express app<br/>[app.js]"]
  node_authroutes["Auth routes<br/>[authRoutes.js]"]
  node_ticketroutes["Ticket routes<br/>[ticketRoutes.js]"]
  node_adminroutes["Admin routes<br/>[adminRoutes.js]"]
  node_authcontroller["Auth controller<br/>[authController.js]"]
  node_ticketcontroller["Ticket controller"]
  node_admincontroller["Admin controller<br/>[adminController.js]"]
  node_authmw["Auth middleware<br/>[authMiddleware.js]"]
end

subgraph group_prediction["ML prediction"]
  node_mlapi["Prediction API<br/>[main.py]"]
end

subgraph group_data["Ticket and user data"]
  node_ticketmodel["Ticket model<br/>[Ticket.js]"]
  node_usermodel["User model<br/>[User.js]"]
  node_mongodb[("MongoDB")]
end

node_user(("User"))

node_user -->|"uses"| node_app
node_app -->|"routes to"| node_login
node_app -->|"routes to"| node_create
node_app -->|"routes to"| node_history
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_adminui
node_login -->|"requests auth"| node_clientapi
node_create -->|"submits ticket"| node_clientapi
node_history -->|"requests history"| node_clientapi
node_dashboard -->|"requests stats"| node_clientapi
node_adminui -->|"requests admin"| node_clientapi
node_clientapi -->|"HTTP requests"| node_express
node_express -->|"mounts"| node_authroutes
node_express -->|"mounts"| node_ticketroutes
node_express -->|"mounts"| node_adminroutes
node_authroutes -->|"auth limits"| node_authmw
node_authroutes -->|"dispatches"| node_authcontroller
node_ticketroutes -->|"protects routes"| node_authmw
node_ticketroutes -->|"dispatches"| node_ticketcontroller
node_adminroutes -->|"checks access"| node_authmw
node_adminroutes -->|"dispatches"| node_admincontroller
node_authcontroller -->|"reads/writes"| node_usermodel
node_ticketcontroller -->|"requests prediction"| node_mlapi
node_mlapi -->|"returns labels"| node_ticketcontroller
node_ticketcontroller -->|"creates/reads"| node_ticketmodel
node_admincontroller -->|"manages tickets"| node_ticketmodel
node_admincontroller -->|"manages users"| node_usermodel
node_ticketmodel -->|"persists tickets"| node_mongodb
node_usermodel -->|"persists users"| node_mongodb

click node_app "https://github.com/mehdichihi-web/ticket_it_classifier/blob/main/frontend/src/App.jsx"
click node_login "https://github.com/mehdichihi-web/ticket_it_classifier/blob/main/frontend/src/pages/Login.jsx"
click node_create "https://github.com/mehdichihi-web/ticket_it_classifier/blob/main/frontend/src/pages/CreerTicket.jsx"
click node_history "https://github.com/mehdichihi-web/ticket_it_classifier/blob/main/frontend/src/pages/Historique.jsx"
click node_dashboard "https://github.com/mehdichihi-web/ticket_it_classifier/blob/main/frontend/src/pages/Dashboard.jsx"
click node_adminui "https://github.com/mehdichihi-web/ticket_it_classifier/blob/main/frontend/src/pages/Admin.jsx"
click node_clientapi "https://github.com/mehdichihi-web/ticket_it_classifier/blob/main/frontend/src/services/api.js"
click node_express "https://github.com/mehdichihi-web/ticket_it_classifier/blob/main/backend/app.js"
click node_authroutes "https://github.com/mehdichihi-web/ticket_it_classifier/blob/main/backend/routes/authRoutes.js"
click node_ticketroutes "https://github.com/mehdichihi-web/ticket_it_classifier/blob/main/backend/routes/ticketRoutes.js"
click node_adminroutes "https://github.com/mehdichihi-web/ticket_it_classifier/blob/main/backend/routes/adminRoutes.js"
click node_authcontroller "https://github.com/mehdichihi-web/ticket_it_classifier/blob/main/backend/controllers/authController.js"
click node_ticketcontroller "https://github.com/mehdichihi-web/ticket_it_classifier/blob/main/backend/controllers/ticketController.js"
click node_admincontroller "https://github.com/mehdichihi-web/ticket_it_classifier/blob/main/backend/controllers/adminController.js"
click node_authmw "https://github.com/mehdichihi-web/ticket_it_classifier/blob/main/backend/middleware/authMiddleware.js"
click node_mlapi "https://github.com/mehdichihi-web/ticket_it_classifier/blob/main/api/main.py"
click node_ticketmodel "https://github.com/mehdichihi-web/ticket_it_classifier/blob/main/backend/models/Ticket.js"
click node_usermodel "https://github.com/mehdichihi-web/ticket_it_classifier/blob/main/backend/models/User.js"

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_app,node_login,node_create,node_history,node_dashboard,node_adminui,node_clientapi,node_user toneBlue
class node_express,node_authroutes,node_ticketroutes,node_adminroutes,node_authcontroller,node_ticketcontroller,node_admincontroller,node_authmw toneAmber
class node_mlapi toneMint
class node_ticketmodel,node_usermodel,node_mongodb toneRose
```

## Components

### React application

- [App routing](https://github.com/mehdichihi-web/ticket_it_classifier/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Login](https://github.com/mehdichihi-web/ticket_it_classifier/blob/main/frontend/src/pages/Login.jsx): `frontend/src/pages/Login.jsx`
- [Create ticket](https://github.com/mehdichihi-web/ticket_it_classifier/blob/main/frontend/src/pages/CreerTicket.jsx): `frontend/src/pages/CreerTicket.jsx`
- [Ticket history](https://github.com/mehdichihi-web/ticket_it_classifier/blob/main/frontend/src/pages/Historique.jsx): `frontend/src/pages/Historique.jsx`
- [Dashboard](https://github.com/mehdichihi-web/ticket_it_classifier/blob/main/frontend/src/pages/Dashboard.jsx): `frontend/src/pages/Dashboard.jsx`
- [Admin panel](https://github.com/mehdichihi-web/ticket_it_classifier/blob/main/frontend/src/pages/Admin.jsx): `frontend/src/pages/Admin.jsx`
- [API services](https://github.com/mehdichihi-web/ticket_it_classifier/blob/main/frontend/src/services/api.js): `frontend/src/services/api.js`

### Express API

- [Express app](https://github.com/mehdichihi-web/ticket_it_classifier/blob/main/backend/app.js): `backend/app.js`
- [Auth routes](https://github.com/mehdichihi-web/ticket_it_classifier/blob/main/backend/routes/authRoutes.js): `backend/routes/authRoutes.js`
- [Ticket routes](https://github.com/mehdichihi-web/ticket_it_classifier/blob/main/backend/routes/ticketRoutes.js): `backend/routes/ticketRoutes.js`
- [Admin routes](https://github.com/mehdichihi-web/ticket_it_classifier/blob/main/backend/routes/adminRoutes.js): `backend/routes/adminRoutes.js`
- [Auth controller](https://github.com/mehdichihi-web/ticket_it_classifier/blob/main/backend/controllers/authController.js): `backend/controllers/authController.js`
- [Ticket controller](https://github.com/mehdichihi-web/ticket_it_classifier/blob/main/backend/controllers/ticketController.js): `backend/controllers/ticketController.js`
- [Admin controller](https://github.com/mehdichihi-web/ticket_it_classifier/blob/main/backend/controllers/adminController.js): `backend/controllers/adminController.js`
- [Auth middleware](https://github.com/mehdichihi-web/ticket_it_classifier/blob/main/backend/middleware/authMiddleware.js): `backend/middleware/authMiddleware.js`

### ML prediction

- [Prediction API](https://github.com/mehdichihi-web/ticket_it_classifier/blob/main/api/main.py): `api/main.py`

### Ticket and user data

- [Ticket model](https://github.com/mehdichihi-web/ticket_it_classifier/blob/main/backend/models/Ticket.js): `backend/models/Ticket.js`
- [User model](https://github.com/mehdichihi-web/ticket_it_classifier/blob/main/backend/models/User.js): `backend/models/User.js`
- **MongoDB**

### Other components

- **User**

## Connections

- User → App routing: uses
- App routing → Login: routes to
- App routing → Create ticket: routes to
- App routing → Ticket history: routes to
- App routing → Dashboard: routes to
- App routing → Admin panel: routes to
- Login → API services: requests auth
- Create ticket → API services: submits ticket
- Ticket history → API services: requests history
- Dashboard → API services: requests stats
- Admin panel → API services: requests admin
- API services → Express app: HTTP requests
- Express app → Auth routes: mounts
- Express app → Ticket routes: mounts
- Express app → Admin routes: mounts
- Auth routes → Auth middleware: auth limits
- Auth routes → Auth controller: dispatches
- Ticket routes → Auth middleware: protects routes
- Ticket routes → Ticket controller: dispatches
- Admin routes → Auth middleware: checks access
- Admin routes → Admin controller: dispatches
- Auth controller → User model: reads/writes
- Ticket controller → Prediction API: requests prediction
- Prediction API → Ticket controller: returns labels
- Ticket controller → Ticket model: creates/reads
- Admin controller → Ticket model: manages tickets
- Admin controller → User model: manages users
- Ticket model → MongoDB: persists tickets
- User model → MongoDB: persists users
