How muhammadahmadsaaim/learnlytics works
Project Type and Purpose
• This is a full-stack, web-based student grade prediction system.
• The core use case is: take academic and behavioral inputs via a React frontend → send them to a Python backend → run a trained ML model → return a grade prediction.
File Structure
Top-Level
• backend/ – REST API server & model-serving logic.
• frontend/ – React single-page application.
• data/ – Dataset (CSV) and data-creation script.
• LearnLytics.ipynb – Jupyter notebook for EDA, preprocessing, training, evaluation.
Backend Subtree
• app.py – Flask (or FastAPI) server entrypoint.
• model/student_grade_predictor.zip – packaged trained model.
• requirements.txt – Python dependencies.
Frontend Subtree
• src/ – React components (App.js, LearnLyticsForm.jsx).
• public/ – Static assets (index.html, manifest.json).
• package.json & tailwind.config.js – JS dependencies & styling config.
README for Additional Insights
• Backend serves on localhost:8000, optionally exposed via ngrok.
• Frontend is configured to call that backend URL.
• The notebook drives all data science work but is not part of the runtime system.
Main Components & Their Relationships
a. Data Layer
• Student CSV & data.py → used offline in the notebook.
• Trained model artifacts stored under backend/model/.
b. Model-Serving Layer
• Python API (Flask/FastAPI) in backend/app.py loads the unzipped model and exposes prediction endpoints.
c. Web Layer
• React app in frontend/src collects user inputs (academic + behavioral) and calls the backend’s REST endpoint.
d. External/Tooling
• ngrok (optional) – exposes backend to the internet.
• Jupyter Notebook – development artifact for EDA and retraining.
Data Flow
1. User enters features in the browser.
2. Frontend issues HTTP POST to /predict on the backend.
3. Backend loads model → returns JSON with predicted grade.
4. Frontend displays the result.
Architectural Patterns & Design Principles
• Layered separation: Presentation (React), Application (Flask/FastAPI), Data/Model (persisted ML artifact).
• API-driven communication over HTTP/JSON.
• Single responsibility: backend only serves ML predictions; frontend only handles UI/UX.
• Configurability: backend URL is injected at build/time into the React app (environment variable or hard-coded).