# isayanpal/gistiq architecture

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

- Interactive diagram: https://gitdiagram.com/isayanpal/gistiq
- Repository: https://github.com/isayanpal/gistiq

## Overview

##### Project Type & Purpose
- GistIQ is a full-stack web application designed to allow users to upload PDF files, have them summarized using Gemini AI, and then view/download the summarized version.
- The project splits clearly into two parts: a frontend (React/TypeScript) and a backend (Node.js with Express).

##### Main Components
a. Client (Frontend)
- Built using React (TypeScript) and styled with Tailwind CSS, using pre-built components from ShadCN UI and animations via Framer Motion.
- Contains directories for assets, components (both custom and UI specific), pages (like Home and Summarize), and utility libraries.
- Responsible for the user interface: rendering the upload form, displaying summary content, and integrating Axios for API calls.

b. Server (Backend)
- Built using Node.js and Express.
- Provides API endpoints that handle PDF uploads and integration with the Gemini AI service (via @google/generative-ai) to perform summarization.
- Acts as the intermediary between the client and external services.

c. External Services & Integrations
- Gemini AI: Used through the @google/generative-ai package to process and summarize PDFs.
- Hosting/Deployment Platforms: Frontend is deployed on Vercel while the backend is hosted on Render.

##### Architectural Patterns & Design Principles
- A clear separation between client and server to reflect a modern full-stack architecture.
- That the client is modular, with separate directories for pages, UI components, and assets, which aligns with a component-based design (similar to MVC or Flux if considering React patterns).
- For the backend, note the RESTful API design, where each endpoint corresponds to specific functionalities (e.g., file upload, summary generation, file downloading).
- Resiliency, scalability (by suggesting that additional services may be integrated in the future), and ease of maintenance.

## Diagram (Mermaid)

```mermaid
graph TD
    %% Frontend Subgraph
    subgraph "Frontend (Vercel-hosted)"
        FE1["Client UI"]
        subgraph "Entry Points"
            FE2["main.tsx"]
            FE3["App.tsx"]
        end
        subgraph "Pages"
            FE4["Home.tsx"]
            FE5["Summarize.tsx"]
        end
        subgraph "UI Components"
            FE6["alert, button, card, input, skeleton"]
        end
        subgraph "Custom Components"
            FE7["Footer, Layout, Navbar"]
        end
        FE8["Utility Library (utils.ts)"]
        FE9["Assets (gist-video.mp4 etc.)"]
    end

    %% Backend Subgraph
    subgraph "Backend (Render-hosted)"
        BE1["Express Server (index.js)"]
        BE2["API Routes (Upload, Summarization, Download)"]
        BE3["Gemini AI Integration (@google/generative-ai)"]
    end

    %% Connections
    FE1 -->|"Axios_API_Calls"| BE2
    BE2 -->|"Invoke_AI"| BE3
    BE3 -->|"Return_Summarization"| BE2
    BE2 -->|"Send_Response"| FE1

    %% Click Events for Frontend Components
    click FE1 "https://github.com/isayanpal/gistiq/tree/master/client/src"
    click FE2 "https://github.com/isayanpal/gistiq/blob/master/client/src/main.tsx"
    click FE3 "https://github.com/isayanpal/gistiq/blob/master/client/src/App.tsx"
    click FE4 "https://github.com/isayanpal/gistiq/blob/master/client/src/pages/Home.tsx"
    click FE5 "https://github.com/isayanpal/gistiq/blob/master/client/src/pages/Summarize.tsx"
    click FE6 "https://github.com/isayanpal/gistiq/tree/master/client/src/components/ui"
    click FE7 "https://github.com/isayanpal/gistiq/tree/master/client/src/components/custom"
    click FE8 "https://github.com/isayanpal/gistiq/blob/master/client/src/lib/utils.ts"
    click FE9 "https://github.com/isayanpal/gistiq/tree/master/client/src/assets"
    
    %% Click Event for Backend Component
    click BE1 "https://github.com/isayanpal/gistiq/blob/master/server/index.js"

    %% Styles
    classDef frontend fill:#cce5ff,stroke:#004085,stroke-width:2px;
    classDef backend fill:#d4edda,stroke:#155724,stroke-width:2px;
    classDef external fill:#fff3cd,stroke:#856404,stroke-width:2px;
    
    %% Apply Styles
    class FE1,FE2,FE3,FE4,FE5,FE6,FE7,FE8,FE9 frontend;
    class BE1,BE2 backend;
    class BE3 external;
```
