# sfkunal/resolveiq architecture

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

- Interactive diagram: https://gitdiagram.com/sfkunal/resolveiq
- Repository: https://github.com/sfkunal/resolveiq

## Overview

##### Project Type and Purpose
- The project (“ResolveIQ”) appears to be a support/ticketing application with a knowledge management component. The backend holds support ticket data and an employee support database (employee_support.db), while the frontend contains multiple React components for displaying chats, tickets, and a knowledge wiki.
- The purpose is likely to manage support tickets, provide real-time chats (see Chat.tsx and ChatPanel.tsx), and integrate knowledge sharing through markdown files (knowledge_wiki.md).

##### File Structure
- There are two top-level directories: “backend” and “frontend”.
– In the backend folder, you have the main application scripts (main.py, engine.py, functions.py), a SQLite database file (employee_support.db), and JSON files (support_tickets.json). There are also notebooks (experiment.ipynb, experiment2.ipynb) for perhaps exploratory testing or prototyping.
– The frontend folder is clearly a React-based application (note the presence of package.json, package-lock.json, and numerous .tsx components) with components such as Chat, TicketList, and KnowledgeWiki for various UI functionalities.
- This shows a clear separation between presentation (frontend) and core business logic/data management (backend).

##### Additional Clues in the README
- Although the README is minimal, the project title “ResolveIQ” combined with file names suggests a focus on resolving support inquiries and managing employee support interactions.
- You might also notice parallel files in both frontend and backend (e.g., support_tickets.json and knowledge_wiki.md), possibly hinting at shared data structures for representing tickets or knowledge articles.

a. Main Components:
– Frontend: Contains UI components such as Chat, TicketList, TicketDetails, ChatPanel, TicketCanvas, and KnowledgeWiki. This is likely built in React/TypeScript and is responsible for user interaction.
– Backend: Built with Python, comprising main.py, engine.py, and other function scripts. It processes support tickets, interacts with the database, and manages business logic.
– Database/Storage: The employee_support.db (likely a SQLite database) stores persistent data, and JSON files (support_tickets.json) are used to seed or temporarily hold support ticket data.
– External Entities: Optionally include the role of development/exploration elements (Jupyter notebooks) as support documentation or proof-of-concept for experimentation.
– Knowledge Base: Represented by the wiki markdown files, signifying documentation or FAQs integrated within the app.

b. Relationships and Interactions:
– Link the Backend to the Database to show data persistence (read/write operations on employee_support.db and possibly JSON files for support tickets).
– Indicate any two-way communications if the frontend implements live updates (for example, a real-time chat system).

c. Architectural Patterns and Design Principles:
– The project demonstrates a separation of concerns by clearly dividing the user interface (frontend) from business logic and data processing (backend).
– It follows a client-server architecture, where the frontend (client) communicates with the backend (server) over defined endpoints.
– Components like Chat and Ticket management might be using common patterns (e.g., MVC within the frontend) even if implicitly.
– Consider adding any RESTful principles if the backend exposes HTTP endpoints.

d. Relevant Technologies:
– Frontend: React, TypeScript, possibly libraries for state management or real-time communication.
– Backend: Python, and SQLite for the database (given the .db file), with additional libraries specified in requirements.txt.
– Development and Testing: Jupyter notebooks (for experiments) and standard Node.js tooling for the frontend (noted by package.json files).

##### Specific Elements
- Optionally, include the experimental components (Jupyter notebooks) as support/development artifacts on the side, noting that these are not part of the production system.

##### Final Advice for the Principal Software Engineer
- Capturing the essential architectural elements: the clear division between frontend and backend, the data persistency layers, and the integration of knowledge support (wiki).

## Diagram (Mermaid)

```mermaid
flowchart TD

    %% Frontend Subgraph
    subgraph "Frontend (React)"
        FE1["Chat"]:::frontend
        FE2["Chat Panel"]:::frontend
        FE3["Ticket List"]:::frontend
        FE4["Ticket Details"]:::frontend
        FE5["Ticket Canvas"]:::frontend
        FE6["Knowledge Wiki UI"]:::frontend
        FE7["Knowledge Wiki Data"]:::frontend
    end

    %% Backend Subgraph
    subgraph "Backend (Python)"
        BE1["Main Application Script"]:::backend
        BE2["Business Logic (Engine)"]:::backend
        BE3["Utility Functions"]:::backend
        BE4["Employee Support Database"]:::database
        BE5["Support Tickets Data"]:::backend
        BE6["Knowledge Wiki Content"]:::backend
        subgraph "Experimentation"
            EXP1["Experiment Notebook 1"]:::experiment
            EXP2["Experiment Notebook 2"]:::experiment
        end
    end

    %% Frontend to Backend connections
    FE1 -->|"calls_chat_api"| BE1
    FE3 -->|"fetches_tickets"| BE1
    FE4 -->|"views_ticket"| BE1
    FE5 -->|"creates/updates_ticket"| BE1
    FE6 -->|"fetches_wiki_content"| BE6

    %% Backend internal connections
    BE1 -->|"delegates_to"| BE2
    BE2 -->|"utilizes"| BE3
    BE1 -->|"db_operations"| BE4
    BE1 -->|"reads_ticket_data"| BE5
    BE1 -->|"reads_wiki_content"| BE6

    %% Click Events for Frontend components
    click FE1 "https://github.com/sfkunal/resolveiq/blob/main/frontend/src/Chat.tsx"
    click FE2 "https://github.com/sfkunal/resolveiq/blob/main/frontend/src/ChatPanel.tsx"
    click FE3 "https://github.com/sfkunal/resolveiq/blob/main/frontend/src/TicketList.tsx"
    click FE4 "https://github.com/sfkunal/resolveiq/blob/main/frontend/src/TicketDetails.tsx"
    click FE5 "https://github.com/sfkunal/resolveiq/blob/main/frontend/src/TicketCanvas.tsx"
    click FE6 "https://github.com/sfkunal/resolveiq/blob/main/frontend/src/KnowledgeWiki.tsx"
    click FE7 "https://github.com/sfkunal/resolveiq/blob/main/frontend/src/knowledge_wiki.md"

    %% Click Events for Backend components
    click BE1 "https://github.com/sfkunal/resolveiq/blob/main/backend/main.py"
    click BE2 "https://github.com/sfkunal/resolveiq/blob/main/backend/engine.py"
    click BE3 "https://github.com/sfkunal/resolveiq/blob/main/backend/functions.py"
    click BE4 "https://github.com/sfkunal/resolveiq/blob/main/backend/employee_support.db"
    click BE5 "https://github.com/sfkunal/resolveiq/blob/main/backend/support_tickets.json"
    click BE6 "https://github.com/sfkunal/resolveiq/blob/main/backend/knowledge_wiki.md"
    click EXP1 "https://github.com/sfkunal/resolveiq/blob/main/backend/experiment.ipynb"
    click EXP2 "https://github.com/sfkunal/resolveiq/blob/main/backend/experiment2.ipynb"

    %% Styling
    classDef frontend fill:#AED6F1,stroke:#1F618D,stroke-width:2px;
    classDef backend fill:#F9E79F,stroke:#AF601A,stroke-width:2px;
    classDef database fill:#FAD7A0,stroke:#D35400,stroke-width:2px, shape: cylinder;
    classDef experiment fill:#D5F5E3,stroke:#27AE60,stroke-width:2px;
```
