# sudeeps234/gw-impactai-hackathon architecture

> Architecture diagram of the GitHub repository sudeeps234/gw-impactai-hackathon, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-10-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sudeeps234/gw-impactai-hackathon
- Repository: https://github.com/sudeeps234/gw-impactai-hackathon

## Overview

##### Project type and purpose
- From the file tree and README, LearnAI is a full-stack web application built in a 24-hour hackathon.
- Purpose: An accessible learning platform providing AI-powered PDF summarization, text-to-speech, and voice navigation for visually, hearing, and cognitively impaired students. There is also a separate flashcard-generation microservice that’s been prototyped.

##### File structure
- Top-level folders:
- client/ – React/Vite frontend
- server/ – Python Flask backend handling summarization, TTS, static audio/tts_chunks
- flashcards/ – Standalone Flask (or script) microservice for generating Q&A/flashcards
- Key files & patterns:
- client/src/components & pages → React component hierarchy (Home, Dashboard, Upload, Summary, Navbar, VoiceAssistant)
- server/app.py → main Flask API entrypoint
- server/summarizer.py, server/tts_model.py → business logic modules
- flashcards/app.py & qna_generator.py → separate service
- static assets under server/static/audio and server/tts_chunks
- No dedicated database folder—likely temporary file storage or in-memory processing.

##### README for additional insights
- Stack: React + Vite + Tailwind CSS on the frontend; Python Flask + AI model wrappers on the backend.
- Features: Notes summarizer, text-to-speech, voice navigation, (future) flashcards & quizzes, user dashboard planned.
- Deployment: Frontend served by Vite dev server; backend via Flask; flashcards service run separately.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Client Side"
        direction TB
        Main["src/main.jsx"]:::frontend
        App["src/App.jsx"]:::frontend
        Home["src/pages/Home.jsx"]:::frontend
        Upload["src/pages/Upload.jsx"]:::frontend
        SummaryPage["src/pages/Summary.jsx"]:::frontend
        Dashboard["src/pages/Dashboard.jsx"]:::frontend
        Navbar["src/components/Navbar.jsx"]:::frontend
        VoiceAssistant["src/components/VoiceAssistant.jsx"]:::frontend
    end

    subgraph "Server Side"
        direction TB
        APIGateway["app.py (Flask API Gateway)"]:::backend
        Summarizer["summarizer.py"]:::backend
        TTSModel["tts_model.py"]:::backend
        AudioDir["server/static/audio/"]:::storage
        TTSChunks["server/tts_chunks/"]:::storage
        ExternalAI["External AI API"]:::external
    end

    subgraph "Flashcards Microservice"
        direction TB
        FlashcardsAPI["flashcards/app.py"]:::microservice
        QnAGenerator["flashcards/qna_generator.py"]:::microservice
        FlashcardsTemplate["flashcards/templates/index.html"]:::microservice
    end

    %% Client internal flow
    Main --> App
    App --> Home
    App --> Upload
    App --> SummaryPage
    App --> Dashboard
    App --> Navbar
    App --> VoiceAssistant

    %% Upload & Summarization flow
    Upload -->|HTTP POST /upload| APIGateway
    SummaryPage -->|HTTP POST /summarize| APIGateway
    APIGateway -->|invoke| Summarizer
    Summarizer -->|API call| ExternalAI
    Summarizer -->|return summary| APIGateway
    APIGateway -->|JSON summary| SummaryPage

    %% TTS flow
    SummaryPage -->|HTTP POST /tts| APIGateway
    APIGateway -->|invoke| TTSModel
    TTSModel --> AudioDir
    TTSModel --> TTSChunks
    APIGateway -->|audio URL| SummaryPage

    %% Voice command flow
    VoiceAssistant -->|Voice Command| APIGateway

    %% Flashcards flow
    App -->|GET /flashcards| FlashcardsAPI
    FlashcardsAPI --> QnAGenerator
    QnAGenerator --> FlashcardsAPI
    FlashcardsAPI -->|Q&A JSON| App

    %% Click Events
    click Main "https://github.com/sudeeps234/gw-impactai-hackathon/blob/master/client/src/main.jsx"
    click App "https://github.com/sudeeps234/gw-impactai-hackathon/blob/master/client/src/App.jsx"
    click Home "https://github.com/sudeeps234/gw-impactai-hackathon/blob/master/client/src/pages/Home.jsx"
    click Upload "https://github.com/sudeeps234/gw-impactai-hackathon/blob/master/client/src/pages/Upload.jsx"
    click SummaryPage "https://github.com/sudeeps234/gw-impactai-hackathon/blob/master/client/src/pages/Summary.jsx"
    click Dashboard "https://github.com/sudeeps234/gw-impactai-hackathon/blob/master/client/src/pages/Dashboard.jsx"
    click Navbar "https://github.com/sudeeps234/gw-impactai-hackathon/blob/master/client/src/components/Navbar.jsx"
    click VoiceAssistant "https://github.com/sudeeps234/gw-impactai-hackathon/blob/master/client/src/components/VoiceAssistant.jsx"
    click APIGateway "https://github.com/sudeeps234/gw-impactai-hackathon/blob/master/server/app.py"
    click Summarizer "https://github.com/sudeeps234/gw-impactai-hackathon/blob/master/server/summarizer.py"
    click TTSModel "https://github.com/sudeeps234/gw-impactai-hackathon/blob/master/server/tts_model.py"
    click AudioDir "https://github.com/sudeeps234/gw-impactai-hackathon/tree/master/server/static/audio/"
    click TTSChunks "https://github.com/sudeeps234/gw-impactai-hackathon/tree/master/server/tts_chunks/"
    click FlashcardsAPI "https://github.com/sudeeps234/gw-impactai-hackathon/blob/master/flashcards/app.py"
    click QnAGenerator "https://github.com/sudeeps234/gw-impactai-hackathon/blob/master/flashcards/qna_generator.py"
    click FlashcardsTemplate "https://github.com/sudeeps234/gw-impactai-hackathon/blob/master/flashcards/templates/index.html"

    %% Styles
    classDef frontend fill:#E8F1FF,stroke:#0066CC
    classDef backend fill:#E8FFE8,stroke:#009900
    classDef microservice fill:#FFF4E5,stroke:#FF6600
    classDef storage fill:#F2F2F2,stroke:#999999
    classDef external fill:#F0E5FF,stroke:#9933CC
```
