# amanmprojects/genai-summerinternship architecture

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

- Interactive diagram: https://gitdiagram.com/amanmprojects/genai-summerinternship
- Repository: https://github.com/amanmprojects/genai-summerinternship

## Overview

##### Project Type and Purpose
- This is a Generative AI project developed by an internship team at VCET. The project brings together multiple components such as data ingestion/creation, AI demos (using CLIP), and a cross-platform frontend built with Flutter. The README highlights usage of CLIP from GitHub and includes a tutorial link, confirming that the project’s focus is on generative AI and multimodal processing.
- The project integrates backend Python scripts (for core functionality, database creation, and search operations) with a Flutter-based frontend interface.

##### File Structure
- Top-Level Scripts and Directories:
- Files such as main.py, prompt_templates.py, and search.py form the core backend, handling AI features and search business logic.
- The folder “demos” contains Python scripts (clipTest.py and clip_demo.py) which seem intended to demonstrate or test CLIP functionalities.
- The “database_creators” directory houses Jupyter notebooks and CSV datasets. These notebooks create databases (e.g., “Amazon Database Creater.ipynb” and “CleanedProducts Database creator.ipynb”) for ingesting product data.
- The “frontend” folder includes a complete Flutter project, clearly separating the user interface from backend logic.
- The docker-compose.yml file suggests container orchestration, likely to run the various components (backend and possibly the frontend) in a coordinated environment.
- This structure indicates a modular architecture where each component stands in its own sub-system (frontend, backend, database tools, demos).

##### Core Components
a. Frontend (User Interface):
- This component handles user interaction, displaying results, and communicating with the backend.

b. Backend Server:
- This component handles AI inference, processing user requests, and integrating the CLIP model (installed via pip using GitHub URL).

c. Database Creation & Management:
- A component for “Database Creators”. It includes the notebooks in “database_creators” and the CSV datasets.
- Even though these scripts are Jupyter notebooks primarily focused on data ingestion, they represent the project’s data preparation aspect.

d. Demos and Testing:

e. Deployment/Container Management:

f. Additional Tools and Utilities:
- Mention Test.ipynb and any supporting tooling that might be for quick validations or auxiliary functionalities.

##### Interactions and Data Flow
- “Backend” interacting with:
- The “Database Creators” when loading or updating product data.
- The “Demos” as a parallel or supportive component for validating the CLIP integration/testing.
- Optionally, illustrate parts where the Docker orchestration ties these components together for deployment.
- Flow: User Input (Flutter UI) → API Gateway/Main.py → CLIP Integration and Search/Prompt Processing → Data fetching from prepared databases.

##### Architectural Patterns and Technologies
- This is a modular full-stack architecture:
- The separation of frontend (Flutter) and backend (Python) implies a clear API boundary.
- The backend includes integration of generative AI using CLIP (an external library acquired from GitHub).
- The database ingestion is decoupled in Jupyter notebooks, indicating a separation between data preparation and data serving.
- Design principles such as separation-of-concerns and modularity.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Frontend Layer"
        FE["Frontend - Flutter Application"]:::frontend
    end

    subgraph "Backend Layer"
        BE["Backend - Generative AI Engine"]:::backend
        main["main.py"]:::backendChild
        pt["prompt_templates.py"]:::backendChild
        sp["search.py"]:::backendChild
        BE --> main
        BE --> pt
        BE --> sp
    end

    subgraph "Database Creation & Management"
        DB["Database Creators"]:::database
        amz["Amazon Database Creater.ipynb"]:::databaseChild
        cp["CleanedProducts Database creator.ipynb"]:::databaseChild
        ds["datasets_csv"]:::databaseChild
        DB --> amz
        DB --> cp
        DB --> ds
    end

    subgraph "Demos & Testing"
        DM["Demos (CLIP Examples)"]:::demo
        ct["clipTest.py"]:::demoChild
        cd["clip_demo.py"]:::demoChild
        DM --> ct
        DM --> cd
    end

    subgraph "Deployment/Container Management"
        DC["Docker Compose - Deployment"]:::deployment
    end

    subgraph "Additional Tools & Utilities"
        AT["Additional Tools & Utilities"]:::tools
        test["Test.ipynb"]:::toolsChild
        AT --> test
    end

    FE -->|"API_call"| BE
    BE -->|"DataIngestion"| DB
    BE -->|"CLIP_Inference"| DM
    DC -->|"Orchestrates"| FE
    DC -->|"Orchestrates"| BE
    AT -->|"Validates"| BE

    click FE "https://github.com/amanmprojects/genai-summerinternship/tree/main/frontend/flutter"
    click main "https://github.com/amanmprojects/genai-summerinternship/blob/main/main.py"
    click pt "https://github.com/amanmprojects/genai-summerinternship/blob/main/prompt_templates.py"
    click sp "https://github.com/amanmprojects/genai-summerinternship/blob/main/search.py"
    click DB "https://github.com/amanmprojects/genai-summerinternship/tree/main/database_creators"
    click amz "https://github.com/amanmprojects/genai-summerinternship/blob/main/database_creators/Amazon Database Creater.ipynb"
    click cp "https://github.com/amanmprojects/genai-summerinternship/blob/main/database_creators/CleanedProducts Database creator.ipynb"
    click ds "https://github.com/amanmprojects/genai-summerinternship/tree/main/database_creators/datasets_csv"
    click DM "https://github.com/amanmprojects/genai-summerinternship/tree/main/demos"
    click ct "https://github.com/amanmprojects/genai-summerinternship/blob/main/demos/clipTest.py"
    click cd "https://github.com/amanmprojects/genai-summerinternship/blob/main/demos/clip_demo.py"
    click DC "https://github.com/amanmprojects/genai-summerinternship/blob/main/docker-compose.yml"
    click test "https://github.com/amanmprojects/genai-summerinternship/blob/main/Test.ipynb"

    classDef frontend fill:#AED6F1,stroke:#1F618D,stroke-width:2px;
    classDef backend fill:#F9E79F,stroke:#B7950B,stroke-width:2px;
    classDef backendChild fill:#FCF3CF,stroke:#B7950B,stroke-width:1px;
    classDef database fill:#A9DFBF,stroke:#27AE60,stroke-width:2px;
    classDef databaseChild fill:#D5F5E3,stroke:#27AE60,stroke-width:1px;
    classDef demo fill:#F5CBA7,stroke:#E67E22,stroke-width:2px;
    classDef demoChild fill:#FAD7A0,stroke:#E67E22,stroke-width:1px;
    classDef deployment fill:#D7BDE2,stroke:#8E44AD,stroke-width:2px;
    classDef tools fill:#D5F5E3,stroke:#28B463,stroke-width:2px;
    classDef toolsChild fill:#E9F7EF,stroke:#28B463,stroke-width:1px;
```
