# srijantrpth/slidedrip architecture

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

- Interactive diagram: https://gitdiagram.com/srijantrpth/slidedrip
- Repository: https://github.com/srijantrpth/slidedrip

## Overview

##### Main Components
- Frontend: A client-side application that manages the user interface, file uploads, and interaction for browsing flashcards and PPT content.
- Express Backend: Handles API requests, user management, authentication, and orchestrates interactions with other internal services. It contains controllers, routes, middleware, and utilities.
- FastAPI Service: A dedicated microservice specifically tasked with text extraction from PPT files. It exposes endpoints to extract and process text.
- Database/Cache: Although not explicitly a relational database, you have Redis integration which should be represented as a caching layer or session management component.
- Docker & Orchestration: Represented by Dockerfiles (for both backend services) and a docker-compose.yml file that shows how these containers are built, deployed, and networked together.

##### Relationships and Interactions
- The Frontend communicates with the Express backend via RESTful API calls (e.g., for user authentication, slide management, etc.).
- When a user uploads a PPT file via the Frontend, the Express backend processes this request and, where necessary, forwards the file or a reference to the FastAPI service to extract text and convert it into flashcards and notes.
- The Express service uses database utilities (and Redis caching) to persist user data and possibly processed content.

##### Architectural Patterns and Design Principles
- Microservices style: The fact that there are independent backend services (Express and FastAPI) is a key architectural decision that should be shown.

##### Technologies and Frameworks
- Frontend: React (or similar, as suggested by the file extensions) running on Vite.
- Backend (Express): Node.js with various middleware, controllers, and routes; includes utilities for handling errors, formatting responses, and potentially interfacing with Redis.
- Backend (FastAPI): Python-based API service managing text extraction.
- Redis: Used within the Express backend for caching or session handling.
- Docker & Docker Compose: For containerization and orchestration of the multi-service deployment.

## Diagram (Mermaid)

```mermaid
graph TD
    subgraph "Client Layer"
        F1["Frontend (React & Vite)"]:::frontend
    end

    subgraph "Backend Layer"
        E1["Express Backend (Express API)"]:::backend
        FAPI["FastAPI Service (PPT Text Extraction)"]:::microservice
    end

    subgraph "Data Layer"
        R1["Redis Cache"]:::db
    end

    subgraph "Deployment"
        E_DOCK["Express Docker Container"]:::container
        F_DOCK["FastAPI Docker Container"]:::container
        DCO["Docker Compose Orchestration"]:::container
    end

    %% Interactions
    F1 -->|"HTTPRequests"| E1
    E1 -->|"ForwardPPT"| FAPI
    FAPI -->|"ReturnText"| E1
    E1 -->|"CacheOps"| R1

    DCO -->|"Manages"| E_DOCK
    DCO -->|"Manages"| F_DOCK
    E_DOCK -->|"Runs"| E1
    F_DOCK -->|"Runs"| FAPI

    %% Click Events
    click F1 "https://github.com/srijantrpth/slidedrip/tree/main/frontend/"
    click E1 "https://github.com/srijantrpth/slidedrip/tree/main/backend/express-backend/"
    click FAPI "https://github.com/srijantrpth/slidedrip/tree/main/backend/fastapi-text-service/app/"
    click R1 "https://github.com/srijantrpth/slidedrip/blob/main/backend/express-backend/src/db/redisClient.js"
    click E_DOCK "https://github.com/srijantrpth/slidedrip/tree/main/backend/express-backend/Dockerfile"
    click F_DOCK "https://github.com/srijantrpth/slidedrip/tree/main/backend/fastapi-text-service/Dockerfile"
    click DCO "https://github.com/srijantrpth/slidedrip/blob/main/docker-compose.yml"

    %% Styles
    classDef frontend fill:#FFCC00,stroke:#333,stroke-width:2px;
    classDef backend fill:#AED6F1,stroke:#333,stroke-width:2px;
    classDef microservice fill:#A9DFBF,stroke:#333,stroke-width:2px;
    classDef db fill:#F5B7B1,stroke:#333,stroke-width:2px;
    classDef container fill:#D2B4DE,stroke:#333,stroke-width:2px;
```
