# adam-a-i/aiexamify architecture

> Architecture diagram of the GitHub repository adam-a-i/aiexamify, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/adam-a-i/aiexamify
- Repository: https://github.com/adam-a-i/aiexamify

## Overview

##### Main Components Identification

a) Frontend Layer (React.js)
- Main components:
- Quiz Generation Interface
- Performance Analytics Dashboard
- Recommendation Display
- Video Resource Integration

b) Backend Layer (Node.js/Express)
- This in the middle
- API handling components:
- Quiz Generation Service
- Recommendation Engine
- Performance Analytics Service

c) External Services Layer
- At the bottom
- Include:
- Groq AI (LLama LLM API)
- YouTube Data API

##### Component Relationships

a) User Flow (Top to Bottom):
- User Input → Frontend → Backend → External APIs
- Response Flow: External APIs → Backend → Frontend → User Display

b) Data Flow:
- Text Input → Quiz Generation
- User Responses → Analytics Processing
- Performance Data → Recommendation Generation
- Topic Keywords → YouTube Video Fetching

##### Specific Implementation Details

Frontend Components (React):
**src/components/main/**
- Dropzone.jsx (File Input)
- Modal.jsx (UI Overlays)
- quiz/
- QuizPage.jsx (Quiz Interface)
- Result.jsx (Performance Display)
- Circle.jsx (UI Elements)

Backend Services:
**src/backend/**
- apiPrompt.js (API Integration)

##### Key Processes to Highlight

a) Quiz Generation Flow:
**Text Input → LLM Processing → Quiz Structure → Frontend Rendering**

b) Recommendation Flow:
**User Performance → Analysis → Topic Identification → YouTube API → Video Suggestions**

##### Technical Integration Points

Specific integration points:
- Vite build process
- Environment variable configuration
- API key management
- Response caching mechanisms

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Frontend
        QGI["Quiz Generation Interface"]
        PAD["Performance Analytics Dashboard"]
        RD["Recommendation Display"]
        FI["File Input Interface"]
        MO["Modal Overlay System"]
        PC["Progress Circle"]
        TM["Timer"]
    end

    subgraph Backend
        API["Backend API Integration"]
        QGS["Quiz Generation Service"]
        RE["Recommendation Engine"]
        PAS["Performance Analytics Service"]
    end

    subgraph "External Services"
        GAPI["Groq AI (LLama LLM)"]
        YTAPI["YouTube Data API"]
    end

    %% Frontend to Backend Connections
    QGI --> API
    FI --> API
    API --> QGS
    QGS --> RE
    RE --> PAS
    PAS --> PAD
    RE --> RD

    %% Backend to External Services
    QGS --> GAPI
    RE --> YTAPI

    %% Frontend Component Interactions
    FI --> QGI
    QGI --> PAD
    PAD --> RD
    PC --> QGI
    TM --> QGI
    MO --> QGI

    %% Styling
    classDef frontend fill:#a8d1ff,stroke:#333,stroke-width:2px
    classDef backend fill:#90EE90,stroke:#333,stroke-width:2px
    classDef external fill:#DDA0DD,stroke:#333,stroke-width:2px

    class QGI,PAD,RD,FI,MO,PC,TM frontend
    class API,QGS,RE,PAS backend
    class GAPI,YTAPI external

    %% Click Events
    click QGI "https://github.com/adam-a-i/aiexamify/blob/main/src/components/main/quiz/QuizPage.jsx"
    click PAD "https://github.com/adam-a-i/aiexamify/blob/main/src/components/main/quiz/Result.jsx"
    click RD "https://github.com/adam-a-i/aiexamify/blob/main/src/components/main/quiz/recs.js"
    click FI "https://github.com/adam-a-i/aiexamify/blob/main/src/components/main/Dropzone.jsx"
    click MO "https://github.com/adam-a-i/aiexamify/blob/main/src/components/main/Modal.jsx"
    click API "https://github.com/adam-a-i/aiexamify/blob/main/src/backend/apiPrompt.js"
    click PC "https://github.com/adam-a-i/aiexamify/blob/main/src/components/main/quiz/Circle.jsx"
    click TM "https://github.com/adam-a-i/aiexamify/blob/main/src/assets/Timer.jsx"

    %% Legend
    subgraph Legend
        F[Frontend Component]:::frontend
        B[Backend Service]:::backend
        E[External API]:::external
    end
```
