# marvelai-org/presentationgenerator architecture

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

- Interactive diagram: https://gitdiagram.com/marvelai-org/presentationgenerator
- Repository: https://github.com/marvelai-org/presentationgenerator

## Overview

##### Project Type & Overall Purpose
- The project is a full-stack web application with a Next.js (React) frontend and a Python-based AI service backend.
- Its purpose is to generate professional presentations using AI, allowing users to create, customize, and export slide decks.
- It also integrates with external services such as Supabase for authentication and database operations (as indicated by the environment variables and Prisma configuration).

##### Main Components of the System
a. Frontend Application:
- Built with Next.js in the “src” directory.
- Contains multiple sub-components divided into features (e.g., AI interactions, presentation editor, dashboard, marketing landing page).
- Uses component-based design to separate areas like authentication, slide editor, feedback, command menus, and layout elements.

b. AI Service:
- A standalone Python service found under the “ai-services” directory.
- Exposes endpoints (including health-check and routes for presentation generation, slide editing, preview generation).
- Runs on a separate port (http://localhost:8000) and uses a RESTful API.

c. Database & External Services:
- The project leverages Supabase (as shown by environment variables) for authentication and probably database operations.
- Prisma in the “prisma” folder suggests there is an ORM layer for database interactions.

d. Infrastructure & Deployment:
- Docker and Docker Compose files (Dockerfile, docker-compose.yml) showcase containerized deployment.
- GitHub Actions workflows in the “.github/workflows” directory for CI/CD.

##### Relationships & Interactions
- The frontend communicates with the AI service over HTTP for generating and editing presentations.
- The frontend also interacts with the database (through Supabase and Prisma) for user authentication and data storage.
- Docker Compose orchestrates multi-container deployment where the frontend (Next.js) and backend services (AI service) run as separate containers.
- CI/CD pipelines automate linting, testing, building, and container creation, ensuring the integrity and smooth deployment of both services.

##### Architectural Patterns and Design Principles
- Component-Based UI: The React/Next.js project is organized into discrete components and pages (e.g., authentication, dashboard, editor, marketing) that enhance modularity.
- Microservices: There’s a clear separation between the UI layer and the AI service backend.
- Containerization: Use of Docker facilitates vendor-agnostic, self-hosted deployment.
- API-First Design: The AI service exposes RESTful endpoints (with Swagger and ReDoc documentation) that the frontend consumes.
- CI/CD practices: Automated workflows ensure code quality and streamlined deployment.

##### Relevant Technologies, Frameworks & Libraries
- Next.js, React, and TypeScript for the frontend.
- Python (with libraries likely listed in “requirements.txt”) for the AI service.
- Supabase for authentication and database support.
- Prisma as an ORM.
- Docker for containerization.
- GitHub Actions for CI/CD.
- Tailwind CSS, ESLint, and Prettier for styling and code quality.

## Diagram (Mermaid)

```mermaid
flowchart TD

    %% External user
    U["User"]:::user

    %% CI/CD Pipeline
    CC["CI/CD Pipeline (.github/workflows)"]:::cicd

    %% Deployment Containerization subgraph
    subgraph "Deployment (Containerization)"
        DC["Docker Compose (Dockerfile, docker-compose.yml, .dockerignore)"]:::container
        F["Frontend Application (Next.js/React) (http://localhost:3000)"]:::frontend
        A["AI Service (Python REST API) (http://localhost:8000)"]:::backend
    end

    %% External Database & Services subgraph
    subgraph "Database & External Services"
        O["ORM (Prisma)"]:::database
        S["Supabase Authentication"]:::database
    end

    %% Connections
    U -->|"access"| F
    CC -->|"build&deploy"| DC
    DC --> F
    DC --> A
    F -->|"REST_API_call"| A
    F -->|"auth_requests"| S
    F -->|"db_queries"| O

    %% Click Events
    click F "https://github.com/marvelai-org/presentationgenerator/tree/main/src"
    click A "https://github.com/marvelai-org/presentationgenerator/blob/main/ai-services/app.py"
    click O "https://github.com/marvelai-org/presentationgenerator/tree/main/prisma"
    click S "https://github.com/marvelai-org/presentationgenerator/blob/main/src/lib/auth/supabase.ts"
    click DC "https://github.com/marvelai-org/presentationgenerator/blob/main/docker-compose.yml"
    click CC "https://github.com/marvelai-org/presentationgenerator/tree/main/.github/workflows"

    %% Styles
    classDef frontend fill:#AED6F1,stroke:#1B4F72,stroke-width:2px;
    classDef backend fill:#F9E79F,stroke:#B7950B,stroke-width:2px;
    classDef database fill:#A9DFBF,stroke:#1E8449,stroke-width:2px;
    classDef container fill:#F5B7B1,stroke:#922B21,stroke-width:2px;
    classDef cicd fill:#D2B4DE,stroke:#6C3483,stroke-width:2px;
    classDef user fill:#FAD7A0,stroke:#CA6F1E,stroke-width:2px;
```
