# amaannaseh/edushala architecture

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

- Interactive diagram: https://gitdiagram.com/amaannaseh/edushala
- Repository: https://github.com/amaannaseh/edushala

## Overview

##### Flask-based Python services
- flask_adaptive_quiz – Handles adaptive quizzes and ML-based score analysis (uses CSV for quiz data, joblib for ML models, a Flask app to serve pages).
- flask_attendance_system – Provides AI-powered, face recognition based attendance tracking. It uses a dataset structure, model files (deploy.prototxt, caffemodel, etc.), and CSV-based attendance records.
- flask_sign_language – Offers AI special education content through sign language recognition. It has separate training pipelines for alphabets and numbers, along with related static resources and templates.

##### A modern full-stack LMS (modern_lms)
- Backend (Node.js Express-based application): Defined by controllers, models, routes, and middleware that handle functionalities like courses, quizzes, and user management.
- Frontend/client: Likely a React/Vite based web app with pages for different aspects of the system such as dashboards, digital library, quiz pages, and interactive components (keyboard, magnify, etc.). This forms the primary public-facing website.

##### A question generator (q_generator)
- A Node/TypeScript project that seems responsible for generating questions using AI (likely integrating an openAI API or similar) through components such as file processors and OpenAI libraries.

##### Hardware integration
- Includes Arduino code, Python scripts (joystick.py, keypad.py), and zipped hardware_code – all indicating integration with physical devices (for example, the EduTypeVision and Digital Orbit Writer features for accessibility).

A. Identify and Label Main Components:
1. User Interface (Modern LMS Client):
– Represented by the modern_lms/client. This is the front-end user interface accessed through browsers.
– Label with “LMS Frontend” and include key pages/features such as Adaptive Quizzes, Digital Library, Live Classes, etc.
2. API/Microservices:
a. Flask Adaptive Quiz Service:
- Shows endpoints for serving adaptive quizzes and interfacing with the ML model (quiz_model_rf.joblib).
b. Flask Attendance System:
- Handles real-time or offline attendance via face recognition. Include components like dataset input, model inference, and CSV update.
c. Flask Sign Language Service:
- Provides educational tools on sign language with separate pipelines for alphabets and numbers.
d. Full-Stack LMS Backend:
- Node.js based API server that manages courses, quizzes, user accounts, and other LMS functionalities.
e. Q_Generator Service:
- A microservice (Node/TS application) that acts as an AI question generator.
3. Hardware/Peripheral Integration:
– Represent the hardware module as a separate block that interacts with the LMS or accessibility features (e.g., EduTypeVision, Digital Orbit Writer).

B. Determine the Interactions and Data Flow:
- Students and educators interact with the LMS Frontend, which sends requests (via API calls) to the Full-Stack LMS Backend.
- For specialized functions like adaptive quizzes, attendance tracking, or sign language tutorials, the backend or the LMS UI may call their respective Flask microservices.
- The Q_Generator service can be invoked either from the LMS backend or directly through its own UI to generate questions using AI.
- Hardware devices (Arduino-based or Python-driven scripts) connect (possibly via dedicated endpoints or local device integrations) to enhance accessibility and physical interactions.

C. Highlight Architectural Patterns and Technologies:
- Microservices Architecture: The platform splits functionalities into separate services (Flask and Node.js services) for modularity and scalability.
- API Communication: Emphasize the usage of RESTful APIs or similar protocols for communication among the LMS frontend, backend, and microservices.
- Separation of Concerns: Frontend (modern_lms/client) is clearly separated from backend logic (modern_lms/backend) and additional domain-specific services (quiz, attendance, sign language).
- Data Persistence: Some services use CSV files (e.g., quiz_data.csv, attendance.csv) while the LMS backend might connect to a database. Mark data stores accordingly.
- Hardware Integration: Differentiate the abstraction layer for hardware devices, showing that these scripts/devices act as peripheral input/output systems.

– Data flow from the LMS client UI to the full-stack backend, and from the backend to other microservices.
– Inbound/outbound communication between AI services (adaptive quiz, attendance, sign language) and external data inputs/ML models.
– Interaction lines from the hardware block to the main LMS system (if data is being captured from physical devices).
– Example: “Flask Adaptive Quiz Service”, “Flask Attendance System (Face Recognition)”, “Flask Sign Language Service”, “Modern LMS Backend (Node.js)”, “Modern LMS Frontend (React/Vite)”, “AI Question Generator (Node/TS)”, and “Hardware Integration Module”.
4. For each component, attach small notes or annotations:
– List key libraries or frameworks (e.g., Flask, Node.js/Express, React, OpenCV, joblib, Arduino/C++).
– Mention data storage details for parts that use CSV or external models.
5. Overall system workflow:
– A user connects via web browser to the LMS frontend.
– The UI then communicates with the LMS backend, which orchestrates calls to the microservices where required.
– Microservices perform their specialized tasks (e.g., assessing quizzes, processing attendance, etc.) and return results for the user dashboard.
– The Q_Generator service is optionally invoked to auto-generate content, while hardware devices provide an additional layer of accessibility.

E. Final Tips:
- Microservice is recognizable and its communication paths are clearly indicated.
- If possible, sketch separate layers (e.g., a “Service Layer” and a “Presentation Layer”) to highlight separation of concerns.
- Review the provided file locations and README instructions to make sure every element is represented appropriately.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Presentation Layer
    subgraph "Presentation Layer"
        UB["User Browser"]:::browser
        FE["LMS Frontend (Client UI)"]:::ui
        UB -->|"access"| FE
    end

    %% Service Layer
    subgraph "Service Layer"
        BE["Modern LMS Backend (Node.js API Server)"]:::backend
        FE -->|"API_calls"| BE

        subgraph "Python Microservices"
            FA["Flask Adaptive Quiz Service"]:::flask
            FAt["Flask Attendance System (Face Recognition)"]:::flask
            FS["Flask Sign Language Service"]:::flask
        end
        BE -->|"Quiz_API"| FA
        BE -->|"Attendance_API"| FAt
        BE -->|"SignLang_API"| FS

        QG["AI Question Generator (Node/TS)"]:::qgen
        BE -->|"QuestionGen"| QG
    end

    %% Hardware Integration
    HI["Hardware Integration Module"]:::hardware
    HI -->|"Peripheral_Data"| BE

    %% Legend
    subgraph "Legend"
        LB1["User Browser"]:::browser
        LB2["LMS Frontend (Client UI)"]:::ui
        LB3["Modern LMS Backend (Node.js)"]:::backend
        LB4["Flask Services (Python)"]:::flask
        LB5["Q_Generator Service (Node/TS)"]:::qgen
        LB6["Hardware Integration Module"]:::hardware
    end

    %% Click Events
    click FA "https://github.com/amaannaseh/edushala/tree/master/flask_adaptive_quiz"
    click FAt "https://github.com/amaannaseh/edushala/tree/master/flask_attendance_system"
    click FS "https://github.com/amaannaseh/edushala/tree/master/flask_sign_language"
    click BE "https://github.com/amaannaseh/edushala/tree/master/modern_lms/backend"
    click FE "https://github.com/amaannaseh/edushala/tree/master/modern_lms/client"
    click QG "https://github.com/amaannaseh/edushala/tree/master/q_generator"
    click HI "https://github.com/amaannaseh/edushala/tree/master/hardware"

    %% Styles
    classDef browser fill:#e6e6fa,stroke:#333,stroke-width:2px;
    classDef ui fill:#cce5ff,stroke:#333,stroke-width:2px;
    classDef backend fill:#d9edf7,stroke:#333,stroke-width:2px;
    classDef flask fill:#f7c6c7,stroke:#333,stroke-width:2px;
    classDef qgen fill:#fff3cd,stroke:#333,stroke-width:2px;
    classDef hardware fill:#d1d1d1,stroke:#333,stroke-width:2px;
```
