# raviteja-5976/learning-helper-assistant architecture

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

- Interactive diagram: https://gitdiagram.com/raviteja-5976/learning-helper-assistant
- Repository: https://github.com/raviteja-5976/learning-helper-assistant

## Overview

##### Project type and purpose
- This is a full-stack web application (“Learning Helper Assistant”) built with Python Flask on the backend and HTML/CSS/JavaScript (Tailwind) on the frontend.
- It provides personalized learning via Retrieval-Augmented Generation (RAG), custom quizzes, podcast generation, and progress tracking.

##### File structure
- Top-level:
- main.py – Flask app entrypoint and route definitions
- models/ – business-logic modules grouped by responsibility
– authentication/auth.py – user signup/login
– db/db_init.py – SQLite schema setup
– my_courses/ – per-course features: chat, embeddings, exams, podcasts, course list
– rapid_learner/rapid_chat.py – standalone rapid-chat feature
– config.py / config01.py – API key and global settings
- templates/ – Jinja2 HTML templates for each page (login, register, courses, chats, exams, popups, etc.)
- requirements.txt – Python dependencies

##### README for additional insights
- Backend uses Flask, SQLite for relational user data, ChromaDB for vector storage
- External AI services: Ollama & Groq APIs
- Frontend: Jinja2 templates + Tailwind CSS + vanilla JS for dynamic interactions
- Key features mapped to modules in models/: authentication, course workflows, rapid learner

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Frontend
    Browser["User Web Browser"]:::frontend

    subgraph "Jinja2 Templates"
        direction TB
        index["index.html"]:::template
        login["login.html"]:::template
        register["register.html"]:::template
        courses_html["courses.html"]:::template
        course_desc["course_desc.html"]:::template
        course_chat_html["course_chat.html"]:::template
        course_exam_html["course_exam.html"]:::template
        courses_popup["courses_popup.html"]:::template
        rapid_chat["rapid_chat.html"]:::template
        rapid_popup["rapid_chat_popup.html"]:::template
    end

    %% Backend
    subgraph "Flask Application Server"
        direction TB
        main["Entrypoint main.py"]:::controller
        subgraph "Controllers"
            direction TB
            main
        end
        subgraph "Services"
            direction TB
            Auth["Authentication Service"]:::service
            Config["Configuration Manager"]:::service
            subgraph "Course Service"
                direction TB
                CourseList["Course Listing"]:::service
                CourseChat["Course Chat"]:::service
                CourseEmbed["Document Embedding"]:::service
                CourseExam["Exam Generation"]:::service
                CoursePodcast["Podcast Generation"]:::service
            end
            Rapid["Rapid Learner Service"]:::service
        end
        subgraph "Data Init"
            direction TB
            DBInit["DB Initialization"]:::service
        end
    end

    %% Data Stores
    SQLite["SQLite Database"]:::db
    Chroma["ChromaDB Vector Store"]:::db

    %% External AI Services
    Ollama["Ollama API"]:::external
    Groq["Groq API"]:::external

    %% Dependencies
    req["requirements.txt"]:::external

    %% Connections
    Browser -->|HTTP| main
    main --> Auth
    main --> Config
    main --> CourseList
    main --> CourseChat
    main --> CourseEmbed
    main --> CourseExam
    main --> CoursePodcast
    main --> Rapid
    main --> DBInit
    main --> index
    main --> login
    main --> register
    main --> courses_html
    main --> course_desc
    main --> course_chat_html
    main --> course_exam_html
    main --> courses_popup
    main --> rapid_chat
    main --> rapid_popup

    Auth -->|SQL queries| SQLite
    DBInit -->|schema setup| SQLite
    CourseEmbed -->|store embeddings| Chroma
    CourseChat -->|vector query| Chroma
    CourseChat -->|LLM call| Ollama
    CourseChat -->|LLM call| Groq
    CourseExam -->|LLM call| Ollama
    CourseExam -->|persist quiz| SQLite
    CourseExam -->|LLM call| Groq
    CoursePodcast -->|LLM call| Ollama
    CoursePodcast -->|LLM call| Groq
    Rapid -->|RAG pipeline| Chroma
    Rapid -->|LLM call| Ollama
    Rapid -->|LLM call| Groq
    Auth -->|load keys| Config
    CourseList -->|load keys| Config
    CourseChat -->|load keys| Config
    CourseEmbed -->|load keys| Config
    CourseExam -->|load keys| Config
    CoursePodcast -->|load keys| Config
    Rapid -->|load keys| Config

    %% Click Events
    click main "https://github.com/raviteja-5976/learning-helper-assistant/blob/main/main.py"
    click Auth "https://github.com/raviteja-5976/learning-helper-assistant/blob/main/models/authentication/auth.py"
    click Config "https://github.com/raviteja-5976/learning-helper-assistant/blob/main/models/config.py"
    click Config "https://github.com/raviteja-5976/learning-helper-assistant/blob/main/models/config01.py"
    click DBInit "https://github.com/raviteja-5976/learning-helper-assistant/blob/main/models/db/db_init.py"
    click CourseList "https://github.com/raviteja-5976/learning-helper-assistant/blob/main/models/my_courses/courses.py"
    click CourseChat "https://github.com/raviteja-5976/learning-helper-assistant/blob/main/models/my_courses/course_chat.py"
    click CourseEmbed "https://github.com/raviteja-5976/learning-helper-assistant/blob/main/models/my_courses/course_embed.py"
    click CourseExam "https://github.com/raviteja-5976/learning-helper-assistant/blob/main/models/my_courses/course_exam.py"
    click CoursePodcast "https://github.com/raviteja-5976/learning-helper-assistant/blob/main/models/my_courses/course_podcast.py"
    click Rapid "https://github.com/raviteja-5976/learning-helper-assistant/blob/main/models/rapid_learner/rapid_chat.py"
    click index "https://github.com/raviteja-5976/learning-helper-assistant/blob/main/templates/index.html"
    click login "https://github.com/raviteja-5976/learning-helper-assistant/blob/main/templates/login.html"
    click register "https://github.com/raviteja-5976/learning-helper-assistant/blob/main/templates/register.html"
    click courses_html "https://github.com/raviteja-5976/learning-helper-assistant/blob/main/templates/courses.html"
    click course_desc "https://github.com/raviteja-5976/learning-helper-assistant/blob/main/templates/course_desc.html"
    click course_chat_html "https://github.com/raviteja-5976/learning-helper-assistant/blob/main/templates/course_chat.html"
    click course_exam_html "https://github.com/raviteja-5976/learning-helper-assistant/blob/main/templates/course_exam.html"
    click courses_popup "https://github.com/raviteja-5976/learning-helper-assistant/blob/main/templates/courses_popup.html"
    click rapid_chat "https://github.com/raviteja-5976/learning-helper-assistant/blob/main/templates/rapid_chat.html"
    click rapid_popup "https://github.com/raviteja-5976/learning-helper-assistant/blob/main/templates/rapid_chat_popup.html"
    click req "https://github.com/raviteja-5976/learning-helper-assistant/blob/main/requirements.txt"

    %% Styles
    classDef frontend fill:#B3E5FC,stroke:#0288D1;
    classDef backend fill:#FFECB3,stroke:#FFB300;
    classDef controller fill:#FFE0B2,stroke:#FB8C00;
    classDef service fill:#C8E6C9,stroke:#388E3C;
    classDef db fill:#D1C4E9,stroke:#7B1FA2,shape:cylinder;
    classDef external fill:#FFCDD2,stroke:#D32F2F,shape:cloud;
    classDef template fill:#E1F5FE,stroke:#0277BD;
```
