# adimogli2/ezscore architecture

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

- Interactive diagram: https://gitdiagram.com/adimogli2/ezscore
- Repository: https://github.com/adimogli2/ezscore

## Overview

##### Main Components

A. Client-Side (Frontend):
- Web Browser Interface (HTML/CSS/JavaScript)
- Real-time Score Display Component
- Essay Input Component
- Rubric Input Component

B. Server-Side (Backend):
- Flask Web Server
- AI Grading Service (OpenAI Integration)
- Dropbox Storage Service

C. External Services:
- OpenAI ChatGPT API
- Dropbox API

**[Frontend Layer]**
- ↕
**[Backend Layer]**
- ↕
**[External Services Layer]**

##### Component Relationships

- Frontend → Backend: HTTP/REST API calls
- Backend → OpenAI: API calls for essay grading
- Backend → Dropbox: Storage API calls
- Backend → Frontend: Response data

##### Detailed Component Breakdown

Frontend (index.html, style.css, script.js):
**[Web Interface]**
- ↓
**[Essay Input] → [Rubric Input]**
- ↓
**[Real-time Display]**

Backend (main.py):
**[Flask Server]**
- ↓
**[Request Handler]**
- ↓
**[AI Processing Service] → [Storage Service]**

##### Key Interactions to Highlight

- Essay Submission Flow:
Browser → Flask Server → OpenAI API → Flask Server → Browser

- Storage Flow:
Flask Server → Dropbox API → Confirmation → Flask Server

##### Additional Elements

Supporting components:
- API Gateway/Endpoints
- Data transformation layers
- Error handling paths
- Authentication flows (if any)

##### Notes for Implementation

- The simplicity of the architecture (single server, clear separation of concerns)
- The real-time nature of the scoring system
- The integration points with external services
- The data flow from essay submission to feedback storage

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles
    classDef frontend fill:#3498db,stroke:#2980b9,color:white
    classDef backend fill:#2ecc71,stroke:#27ae60,color:white
    classDef external fill:#f1c40f,stroke:#f39c12,color:black
    classDef storage fill:#95a5a6,stroke:#7f8c8d,color:white
    classDef api fill:#e74c3c,stroke:#c0392b,color:white

    %% Frontend Layer
    subgraph Frontend
        WI[Web Browser Interface]
        EI[Essay Input Component]
        RI[Rubric Input Component]
        RD[Real-time Score Display]
    end

    %% Backend Layer
    subgraph Backend
        FS[Flask Web Server]
        RH[Request Handler]
        AI[AI Grading Service]
        SS[Storage Service]
    end

    %% External Services Layer
    subgraph External
        OAI[OpenAI ChatGPT API]
        DBS[Dropbox Storage API]
    end

    %% Relationships
    WI --> EI
    WI --> RI
    EI --> RH
    RI --> RH
    RH --> AI
    AI --> OAI
    AI --> SS
    SS --> DBS
    AI --> RD
    
    %% Component Styling
    class WI,EI,RI,RD frontend
    class FS,RH,AI,SS backend
    class OAI,DBS external

    %% Legend
    subgraph Legend
        F[Frontend Component]:::frontend
        B[Backend Service]:::backend
        E[External Service]:::external
        A["API Endpoint"]:::api
    end

    %% Click Events
    click WI "https://github.com/adimogli2/EZScore/blob/main/index.html"
    click FS "https://github.com/adimogli2/EZScore/blob/main/main.py"
    click SS "https://github.com/adimogli2/EZScore/blob/main/main.py"
    click AI "https://github.com/adimogli2/EZScore/blob/main/main.py"
    click RH "https://github.com/adimogli2/EZScore/blob/main/main.py"
```
