# srikanth284/ai-presentia architecture

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

- Interactive diagram: https://gitdiagram.com/srikanth284/ai-presentia
- Repository: https://github.com/srikanth284/ai-presentia

## Overview

##### Main Components

a) Client Layer:
- Web Browser Interface
- Static Assets (CSS, JS, Images)
- HTML Templates

b) Application Layer:
- Flask Web Server
- Authentication System (evident from login/register templates)
- Form Processing
- Template Engine (Jinja2)

c) Service Layer:
- Presentation Generation Service
- GPT Integration Service (utils/gpt_generate.py)
- Text Processing Service (utils/text_pp.py)

d) Data Layer:
- SQLite Database (instance/site.db)
- File Storage (for presentations)
- External Services:
- OpenAI GPT-3.5 API
- Pexels API

##### Component Relationships

- Client → Flask Server (HTTP/HTTPS)
- Flask Server → Authentication System (internal)
- Flask Server → Presentation Generation Service (internal)
- Presentation Generation Service → GPT Service (API calls)
- Presentation Generation Service → Pexels API (external API)
- Flask Server → Database (SQLite connections)

##### Specific Implementation Details

- Blue rectangles: Core application components (Flask, Templates)
- Green rectangles: External services (OpenAI, Pexels)
- Yellow diamonds: Data stores (SQLite, File storage)
- Orange ovals: Processing services (Text processing, GPT integration)

##### Key Technical Elements to Highlight

- Environment Configuration (.env file)
- Static Asset Management (static folder structure)
- Template System (templates folder)
- Database Models (models.py)
- Form Handling (forms.py)
- Utility Services (utils folder)

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Client
        Browser["Web Browser Interface"]
        Static["Static Assets"]:::static
        Templates["HTML Templates"]:::templates
    end

    subgraph AppLayer
        Flask["Flask Web Server"]:::flask
        Auth["Authentication System"]:::auth
        Forms["Form Processing"]:::forms
        TemplateEngine["Template Engine (Jinja2)"]
    end

    subgraph ServiceLayer
        PresentationGen["Presentation Generation Service"]
        GPTService["GPT Integration Service"]:::gpt
        TextProcess["Text Processing Service"]:::text
    end

    subgraph DataLayer
        DB[(SQLite Database)]:::db
        FileStore[(File Storage)]:::files
        subgraph ExternalServices
            OpenAI["OpenAI GPT-3.5 API"]
            Pexels["Pexels API"]
        end
    end

    %% Connections
    Browser --> Flask
    Static --> Browser
    Templates --> Browser
    
    Flask --> Auth
    Flask --> Forms
    Flask --> TemplateEngine
    
    Flask --> PresentationGen
    PresentationGen --> GPTService
    GPTService --> OpenAI
    PresentationGen --> Pexels
    GPTService --> TextProcess
    
    Flask --> DB
    PresentationGen --> FileStore

    %% Styling
    classDef flask fill:#a8d5e5
    classDef auth fill:#d1c4e9
    classDef forms fill:#c8e6c9
    classDef static fill:#ffecb3
    classDef templates fill:#ffe0b2
    classDef gpt fill:#b39ddb
    classDef text fill:#90caf9
    classDef db fill:#fff59d
    classDef files fill:#ffcc80

    %% Click Events
    click Flask "https://github.com/SRIKANTH284/AI-Presentia/blob/master/myapp/flaskapp.py"
    click Auth "https://github.com/SRIKANTH284/AI-Presentia/blob/master/myapp/templates/login.html"
    click Forms "https://github.com/SRIKANTH284/AI-Presentia/blob/master/myapp/forms.py"
    click GPTService "https://github.com/SRIKANTH284/AI-Presentia/blob/master/myapp/utils/gpt_generate.py"
    click TextProcess "https://github.com/SRIKANTH284/AI-Presentia/blob/master/myapp/utils/text_pp.py"
    click DB "https://github.com/SRIKANTH284/AI-Presentia/blob/master/instance/site.db"
    click FileStore "https://github.com/SRIKANTH284/AI-Presentia/tree/master/myapp/static/presentations"
    click Static "https://github.com/SRIKANTH284/AI-Presentia/tree/master/myapp/static"
    click Templates "https://github.com/SRIKANTH284/AI-Presentia/tree/master/myapp/templates"

    %% Legend
    subgraph Legend
        L1[Flask Components]:::flask
        L2[Auth Components]:::auth
        L3[Form Processing]:::forms
        L4[Static Assets]:::static
        L5[Templates]:::templates
        L6[GPT Services]:::gpt
        L7[Text Processing]:::text
        L8[Database]:::db
        L9[File Storage]:::files
    end
```
