# rashmikaramkumar/ticketbotpro architecture

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

- Interactive diagram: https://gitdiagram.com/rashmikaramkumar/ticketbotpro
- Repository: https://github.com/rashmikaramkumar/ticketbotpro

## Overview

##### Main Components Identification

a) Chatbot Service
- Frontend (chatbot-frontend)
- Backend (backend)
b) QR Scanner Service
- Frontend (qr-scanner-frontend)
c) Speech-to-Text Service
- Frontend (speech2text/frontend)
- Backend (speech2text/backend)
d) LLM Service
- Backend (llm-backend)

##### Component Details

For the Chatbot Backend:
- API Layer (routes/)
- Business Logic Layer (routes/chatbot_helper/)
- Model Layer (models/)
- Data Layer (data/)
- Neural Network model (data.pth)
- Intent processing system (intents.json)

For the Frontend Components:
- Them as modern React applications (based on vite.config.js and React files)
- UI components and their interactions
- Tailwind CSS styling framework (noted from configuration files)

##### Interactions and Data Flow

- Frontend-to-Backend API communications
- Inter-service communications
- Data flow between components
- Model inference paths

##### Technical Stack Representation

Technology badges or labels for:
- Python (Backend)
- React (Frontend)
- Neural Network Models
- Prisma (noted from schema.prisma)
- Vite (Build tool)

##### Specific Component Details

Chatbot System:
- NLP pipeline (nltk_utils.py)
- Model loading and inference path
- Intent processing flow
- Ticket handling system

QR Scanner:
- Scanning flow
- Validation process (qr_validate.py)

Speech-to-Text:
- Audio processing pipeline
- Text conversion flow

##### Additional Elements

Include:
- Environment configurations
- API endpoints
- Security boundaries
- Load balancers (if applicable)
- Database connections
- Caching layers (if present)

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Frontend
        CF["Chatbot Frontend"]:::frontend
        QF["QR Scanner Frontend"]:::frontend
        SF["Speech-to-Text Frontend"]:::frontend
    end

    subgraph "Backend Services"
        subgraph "Chatbot Backend"
            BE["Main Backend Entry"]:::backend
            API["API Layer"]:::api
            BL["Business Logic"]:::logic
            TP["Ticket Processing"]:::logic
            NLP["NLP Utils"]:::util
            ML["Model Loading"]:::model
        end

        subgraph "Data Layer"
            NN["Neural Network Model"]:::model
            INT["Intent Processing"]:::data
            DB[(Database)]:::database
            SCHEMA["Database Schema"]:::database
        end

        subgraph "Additional Services"
            QV["QR Validation Service"]:::backend
            STB["Speech-to-Text Backend"]:::backend
            LLM["LLM Service"]:::backend
        end
    end

    %% Frontend to Backend Connections
    CF --> API
    QF --> QV
    SF --> STB

    %% Backend Internal Flow
    API --> BL
    BL --> TP
    BL --> NLP
    NLP --> ML
    ML --> NN
    BL --> INT
    API --> DB
    SCHEMA --- DB

    %% Service Interactions
    BL --> LLM
    BL --> STB
    QV --> API

    %% Click Events
    click CF "https://github.com/RashmikaRamkumar/TicketBotPro/tree/concertBranch/chatbot-frontend"
    click API "https://github.com/RashmikaRamkumar/TicketBotPro/blob/concertBranch/backend/routes/chatbot.py"
    click BL "https://github.com/RashmikaRamkumar/TicketBotPro/blob/concertBranch/backend/routes/chatbot_helper/chatbot_helper.py"
    click TP "https://github.com/RashmikaRamkumar/TicketBotPro/blob/concertBranch/backend/routes/chatbot_helper/ticket_helper.py"
    click NN "https://github.com/RashmikaRamkumar/TicketBotPro/blob/concertBranch/backend/data/data.pth"
    click INT "https://github.com/RashmikaRamkumar/TicketBotPro/blob/concertBranch/backend/data/intents.json"
    click NLP "https://github.com/RashmikaRamkumar/TicketBotPro/blob/concertBranch/backend/routes/model/nltk_utils.py"
    click QF "https://github.com/RashmikaRamkumar/TicketBotPro/tree/concertBranch/qr-scanner-frontend"
    click QV "https://github.com/RashmikaRamkumar/TicketBotPro/blob/concertBranch/backend/routes/qr_validate.py"
    click SF "https://github.com/RashmikaRamkumar/TicketBotPro/tree/concertBranch/speech2text/frontend"
    click STB "https://github.com/RashmikaRamkumar/TicketBotPro/blob/concertBranch/speech2text/backend/app.py"
    click LLM "https://github.com/RashmikaRamkumar/TicketBotPro/blob/concertBranch/llm-backend/app.py"
    click ML "https://github.com/RashmikaRamkumar/TicketBotPro/blob/concertBranch/backend/routes/model/load_model.py"
    click SCHEMA "https://github.com/RashmikaRamkumar/TicketBotPro/blob/concertBranch/backend/schema.prisma"
    click BE "https://github.com/RashmikaRamkumar/TicketBotPro/blob/concertBranch/backend/app.py"

    %% Styling
    classDef frontend fill:#2196F3,stroke:#fff,stroke-width:2px,color:#fff
    classDef backend fill:#4CAF50,stroke:#fff,stroke-width:2px,color:#fff
    classDef api fill:#9C27B0,stroke:#fff,stroke-width:2px,color:#fff
    classDef logic fill:#FF9800,stroke:#fff,stroke-width:2px,color:#fff
    classDef model fill:#F44336,stroke:#fff,stroke-width:2px,color:#fff
    classDef data fill:#FFEB3B,stroke:#333,stroke-width:2px,color:#333
    classDef database fill:#795548,stroke:#fff,stroke-width:2px,color:#fff
    classDef util fill:#607D8B,stroke:#fff,stroke-width:2px,color:#fff

    %% Legend
    subgraph Legend
        F[Frontend]:::frontend
        B[Backend]:::backend
        A[API]:::api
        L[Logic]:::logic
        M[Model]:::model
        D[Data]:::data
        DB2[Database]:::database
        U[Utility]:::util
    end
```
