# alpererdogan8/generative-prompts architecture

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

- Interactive diagram: https://gitdiagram.com/alpererdogan8/generative-prompts
- Repository: https://github.com/alpererdogan8/generative-prompts

## Overview

##### Main Components Identification
The project is a Chrome Extension with the following key components:

a. Extension Components:
- Background Script
- Content Scripts (React-based UI)
- Chrome Storage Integration
- External API Integration

##### Extension Layer
**[Background Script] ←→ [Content Script] ←→ [Chrome Storage]**
- ↕                     ↕
**[Chrome API Interface]  [React Components]**

##### UI Layer (React Components Hierarchy)
**App.jsx**
- Modal
- Generate Prompts Components
- GenerateView
- Examples
- Bookmark
- Tags
- Awesome Prompts Components
- NotFoundPrompt
- TopScroll
- Loading

##### Important Technical Details

a. Technology Stack (Add as labels):
- Vite (Build Tool)
- React (UI Framework)
- Tailwind CSS (Styling)
- Chrome Extension APIs

b. Storage Layer:
- Chrome Extension Storage (for bookmarks/preferences)
- Context API (for state management)

##### Specific Implementation Notes

Annotations for:
- Custom hooks (useChromeExtensionStorage)
- API integration points
- Content script injection points
- Background script event listeners

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Chrome["Chrome Extension Infrastructure"]
        BG["Background Script"]
        CS["Content Scripts"]
        CI["Chrome API Interface"]
    end

    subgraph React["React Components Layer"]
        APP["App.jsx"]
        MOD["Modal"]
        subgraph GPC["Generate Prompts Components"]
            GV["GenerateView"]
            EX["Examples"]
            BM["Bookmark"]
            TG["Tags"]
        end
        subgraph APC["Awesome Prompts Components"]
            NF["NotFoundPrompt"]
            TS["TopScroll"]
        end
        LD["Loading"]
    end

    subgraph Storage["Storage Layer"]
        CES[("Chrome Storage")]
        CAP["Context API"]
    end

    subgraph External["External Services"]
        API["Awesome Prompts API"]
        CGP["ChatGPT Integration"]
    end

    BG <--> CS
    CS <--> CI
    CS <--> APP
    APP --> MOD
    MOD --> GPC
    MOD --> APC
    APP --> LD
    CS <--> CES
    CS <--> CAP
    CS <-.-> API
    CS <-.-> CGP

    classDef infrastructure fill:#4a9eff,stroke:#333,stroke-width:2px
    classDef react fill:#48c78e,stroke:#333,stroke-width:2px
    classDef storage fill:#9d4edd,stroke:#333,stroke-width:2px
    classDef external fill:#ff922b,stroke:#333,stroke-width:2px

    class Chrome,BG,CS,CI infrastructure
    class React,APP,MOD,GPC,APC,LD,GV,EX,BM,TG,NF,TS react
    class Storage,CES,CAP storage
    class External,API,CGP external

    click BG "https://github.com/alpererdogan8/generative-prompts/blob/main/src/background/background.js"
    click CS "https://github.com/alpererdogan8/generative-prompts/blob/main/src/content_scripts/App.jsx"
    click APP "https://github.com/alpererdogan8/generative-prompts/blob/main/src/content_scripts/App.jsx"
    click MOD "https://github.com/alpererdogan8/generative-prompts/blob/main/src/content_scripts/components/Modal.jsx"
    click GPC "https://github.com/alpererdogan8/generative-prompts/tree/main/src/content_scripts/components/modal_components/generate_prompts_components/"
    click APC "https://github.com/alpererdogan8/generative-prompts/tree/main/src/content_scripts/components/modal_components/awesome_prompts_components/"
    click LD "https://github.com/alpererdogan8/generative-prompts/blob/main/src/content_scripts/components/Loading.jsx"
    click GV "https://github.com/alpererdogan8/generative-prompts/blob/main/src/content_scripts/components/modal_components/generate_prompts_components/GenerateView.jsx"
    click BM "https://github.com/alpererdogan8/generative-prompts/blob/main/src/content_scripts/components/modal_components/generate_prompts_components/Bookmark.jsx"
    click TG "https://github.com/alpererdogan8/generative-prompts/blob/main/src/content_scripts/components/modal_components/generate_prompts_components/Tag.jsx"
    click CAP "https://github.com/alpererdogan8/generative-prompts/blob/main/src/content_scripts/context/Context_Api.jsx"
    click API "https://github.com/alpererdogan8/generative-prompts/blob/main/src/content_scripts/service/API/AwesomePromptsAPI.js"
    click CES "https://github.com/alpererdogan8/generative-prompts/blob/main/src/content_scripts/hooks/useChromeExtensionStorage.jsx"
```
