# dhyanshah22/hacknuthon-rapidops architecture

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

- Interactive diagram: https://gitdiagram.com/dhyanshah22/hacknuthon-rapidops
- Repository: https://github.com/dhyanshah22/hacknuthon-rapidops

## Overview

##### Project Type and Purpose
- This project is an AI-powered tool that generates structured test cases from API documentation PDFs.
- It combines several integrations: AI (Google Gemini API) for processing, FAISS for vector search, GitHub for repository updates, and Figma for syncing UI/UX components.
- The tool is built as a full-stack application where a Streamlit front end (app.py) interacts with backend logic to process the API docs, generate test cases, and handle external integrations.

##### File Structure Insights
- Multiple directories (e.g., Chat-Bot, FigmaTestCase, GenerateTestCase) suggest that the project might have modular components addressing different integrations or functionalities.
- Each folder contains an “app.py” file hinting at potentially separate entry points or experimental branches/modules.
- There is a common “data” folder across modules; this folder stores essential files like JSON test cases and API documentation PDFs.
- Presence of CI/CD related files (jenkinsfile, and the README’s reference to the .github/workflows folder) informs us about the automated deployment and testing pipeline.

##### Main Components
a. User Interface Layer:
- Streamlit Application: Represents the primary user interface where users can upload API documentation PDFs.
- Entry point: app.py (from the main directory and possibly the different modules where the UI may handle specific integrations).

b. Backend / Processing Engine:
- PDF Parser & FAISS Integration: Handles PDF parsing for extracting textual content and uses FAISS for vector storage and retrieval.
- AI-based Test Case Generator: Uses Google Gemini API to generate structured test cases from the parsed data.
- Unique Test Data Generator: Creates randomized test inputs (like email, password) for each test case.

c. Integration Components:
- Figma Integration Module: Communicates with the Figma API to fetch UI design elements and synchronizes these with test case definitions.

d. Data Storage:
- Data directory (data/test_cases.json): Acts as a persistence layer where generated test cases are saved.
- Any additional files (PDFs or intermediary JSON files) that are stored in the data folders of the various modules.

e. CI/CD and Automation:
- CI/CD Pipeline Component: Indicated by the Jenkinsfile and GitHub Actions workflow (as described in the README). It triggers processes such as automated testing and deployment upon new commits.

##### Relationships and Interactions
- The UI (Streamlit app) accepts inputs (PDF uploads, Figma updates, etc.) which are passed to the backend.
- The backend uses the PDF Parser (with FAISS) to extract data, then sends the data to the AI-powered module (Google Gemini API) for test case generation.
- Generated test cases are stored locally in the “data” folder as JSON files.
- A GitHub integration module automatically pushes these JSON files to a GitHub repository.
- Separately, Figma integration continuously polls or receives updates from UI/UX designs to adjust test cases accordingly.
- The CI/CD pipeline kicks off upon changes, automates tests, and deploys any updates – these processes are explicitly defined in the GitHub Actions workflow and in the jenkinsfile.

##### Architectural Patterns & Design Principles
- Modularity: Different modules handle distinct functionalities (e.g., PDF parsing, test case generation, integrations).
- Separation of Concerns: Clear division between UI (Streamlit) and backend processing.
- Automation and Continuous Deployment: The CI/CD pipeline illustrates a DevOps approach.
- Integration-centric: The project encapsulates multiple external APIs (Google Gemini, GitHub, Figma) which each are critical to the overall flow.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% User Interface Layer
    subgraph "User Interface Layer"
        UI1("Chat-Bot UI") 
        UI2("FigmaTestCase UI") 
        UI3("GenerateTestCase UI")
    end

    %% Backend Processing
    subgraph "Backend Processing"
        BP1("PDF Parser & FAISS") 
        BP2("AI Test Case Generator") 
        FI("Figma Integration")
    end

    %% Persistence & Automation
    subgraph "Persistence & Automation"
        DS("Data Storage")
        GI("GitHub Integration")
        CICD("CI/CD Pipeline")
    end

    %% Connections between components
    UI1 -->|"triggers"| BP1
    UI3 -->|"triggers"| BP1
    UI2 -->|"sends updates"| FI
    BP1 -->|"processes"| BP2
    FI -->|"updates"| BP2
    BP2 -->|"storesTestCases"| DS
    DS -->|"pushesTestCases"| GI
    DS -->|"triggers"| CICD
    GI -->|"deploys"| CICD

    %% Click Events for mapped components
    click UI1 "https://github.com/dhyanshah22/hacknuthon-rapidops/blob/main/Chat-Bot/app.py"
    click UI2 "https://github.com/dhyanshah22/hacknuthon-rapidops/blob/main/FigmaTestCase/app.py"
    click UI3 "https://github.com/dhyanshah22/hacknuthon-rapidops/blob/main/GenerateTestCase/app.py"
    click BP1 "https://github.com/dhyanshah22/hacknuthon-rapidops/blob/main/GenerateTestCase/app.py"
    click BP2 "https://github.com/dhyanshah22/hacknuthon-rapidops/blob/main/GenerateTestCase/app.py"
    click DS "https://github.com/dhyanshah22/hacknuthon-rapidops/blob/main/FigmaTestCase/data/test_cases.json"
    click DS "https://github.com/dhyanshah22/hacknuthon-rapidops/blob/main/GenerateTestCase/data/test_cases.json"
    click FI "https://github.com/dhyanshah22/hacknuthon-rapidops/blob/main/FigmaTestCase/app.py"
    click GI "https://github.com/dhyanshah22/hacknuthon-rapidops/tree/main/jenkinsfile"
    click CICD "https://github.com/dhyanshah22/hacknuthon-rapidops/tree/main/jenkinsfile"

    %% Styles
    classDef ui fill:#a7d8f2,stroke:#333,stroke-width:2px;
    classDef backend fill:#d2f5b0,stroke:#333,stroke-width:2px;
    classDef integration fill:#f9e79f,stroke:#333,stroke-width:2px;
    classDef storage fill:#d6dbdf,stroke:#333,stroke-width:2px;
    classDef cicd fill:#f5b7b1,stroke:#333,stroke-width:2px;

    class UI1,UI2,UI3 ui;
    class BP1,BP2 backend;
    class FI,GI integration;
    class DS storage;
    class CICD cicd;
```
