Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

55 Commits

Folders and files

Repository files navigation

AIoT Smart Learning Platform

Overview

The AIoT Smart Learning Platform is a multidisciplinary educational application that combines gamified e-learning methodologies with Artificial Intelligence (AI) and Internet of Things (IoT) integrations. The system is designed to provide highly personalized learning paths, context-aware AI tutoring, and real-time physical health monitoring using external hardware sensors (YoloBit).

Key Features

Gamified Learning Experience

  • Hierarchical Progression: Structured learning paths divided into Skill Trees, Skills, Levels, Lessons, and Exercises.
  • Engagement Mechanics: Experience points (XP), daily streaks, achievements, leaderboards, and a health (hearts) system.
  • Spaced Repetition Flashcards: Automated flashcard generation utilizing the SM-2 algorithm for optimized memory retention.

Artificial Intelligence Integration

  • AI Tutor: A context-aware chatbot capable of assisting students with specific lessons and generating dynamic coding or conceptual exercises.
  • AI Arena: Dynamically generated challenges that adapt to the user's proficiency level.
  • Personalized Paths: AI-driven analytics that suggest subsequent skills based on the user's weak and strong areas.

IoT Health Monitoring

  • Sensor Integration: Real-time data ingestion from YoloBit hardware (Temperature, Humidity, Light, Motion).
  • Dynamic Alerting: Configurable thresholds for health warnings, such as prolonged sitting duration, poor lighting, or suboptimal room temperature.
  • AI Health Suggestions: Contextual recommendations to improve the user's physical learning environment based on sensor data.

Administrative Capabilities

  • Role-Based Access Control: Secure access for administrators versus standard users.
  • Content Management: Full CRUD capabilities for the hierarchical curriculum structure.
  • Student Analytics: Detailed views of individual student progress, XP history, and health alerts.
  • System Configuration: Dynamic configuration of IoT sensor thresholds via the database, avoiding hardcoded application restarts.

The report could be access here

Technology Stack

Frontend

  • Framework: React 19, TypeScript, Vite
  • State Management: Zustand
  • Styling & UI: Tailwind CSS, shadcn/ui, framer-motion
  • Data Visualization: Recharts
  • Routing: React Router DOM

Backend

  • Framework: FastAPI (Python)
  • Database: PostgreSQL with SQLAlchemy ORM
  • Authentication: JWT (JSON Web Tokens)
  • AI Services: Groq/Gemini API integration

IoT Middleware

  • Protocol: MQTT
  • Scripts: Python-based bridges (mqtt_bridge.py, sensor_simulator.py) connecting hardware endpoints to the FastAPI backend.

Prerequisites

  • Node.js (v18 or higher)
  • Python (v3.10 or higher)
  • PostgreSQL
  • MQTT Broker (e.g., Mosquitto or Adafruit IO)

Installation and Setup

1. Database Configuration

Ensure PostgreSQL is running. Create a database for the project and configure the connection string in the backend environment variables.

2. Backend Setup

Navigate to the backend directory, install dependencies, and seed the database.

cd backend
pip install -r requirements.txt

# Reset and seed the database with initial configurations and curriculum
python seed_data.py

# Start the FastAPI server
uvicorn main:app --reload

3. Frontend Setup

Navigate to the frontend directory, install dependencies, and start the development server.

cd frontend
npm install

# Start the Vite development server
npm run dev

4. IoT Middleware Setup

To simulate or connect real IoT data, run the middleware scripts in separate terminal instances.

cd iot_middleware

# Terminal A: Start the MQTT Bridge
python mqtt_bridge.py

# Terminal B: Start the Sensor Simulator (if hardware is unavailable)
python sensor_simulator.py

Project Structure

.
├── backend/               # FastAPI application
│   ├── main.py            # Application entry point
│   ├── models.py          # SQLAlchemy database schemas
│   ├── schemas.py         # Pydantic validation models
│   ├── routers/           # API endpoints (auth, learning, admin, health, etc.)
│   ├── services/          # Business logic (AI processing, health monitoring)
│   └── seed_data.py       # Database initialization script
├── frontend/              # React application
│   ├── src/
│   │   ├── components/    # Reusable UI components
│   │   ├── layouts/       # Structural layouts (Sidebar, Header)
│   │   ├── pages/         # View components (Dashboard, Admin, LessonPlayer)
│   │   ├── store/         # Zustand global state
│   │   └── lib/           # Utility functions and API configuration
├── iot_middleware/        # IoT connection layer
│   ├── mqtt_bridge.py     # Subscribes to MQTT and POSTs to backend
│   └── sensor_simulator.py# Generates mock sensor data
└── README.md

API Documentation

Once the backend server is running, the interactive API documentation is automatically generated by FastAPI.

  • Swagger UI: http://localhost:8000/docs
  • ReDoc: http://localhost:8000/redoc

Development Guidelines

  • Ensure all new endpoints are strongly typed using Pydantic schemas.
  • Maintain the English localization standard across all user-facing interfaces and backend responses.
  • When modifying the database schema (models.py), update the seed_data.py script accordingly to maintain a reproducible development environment.

Docker Deployment

This project is fully containerized and can be deployed using Docker Compose.

Quick Start

  1. Build and start all services (first-time setup):

    docker-compose up --build
  2. Run in detached mode (subsequent runs):

    docker-compose up -d
  3. Stop the project:

    docker-compose down

Important Configuration

The IoT Simulator (sensor_simulator.py) requires a non-interactive mode when running in Docker. This is managed via the SIMULATOR_MODE environment variable in docker-compose.yml.

  • Value 1: Auto mode (default).
  • Value 2: Manual mode (not recommended for Docker as it lacks interaction).

Note: Ensure SIMULATOR_MODE is set to 1 or 2 in docker-compose.yml before building to avoid interactive input errors.

Monitoring Logs

View logs for all services:

docker-compose logs -f

View logs for specific services:

  • Database (PostgreSQL): docker-compose logs -f db
  • MQTT Broker (Mosquitto): docker-compose logs -f mqtt
  • Backend (FastAPI): docker-compose logs -f backend
  • Frontend (React Vite): docker-compose logs -f frontend
  • IoT Middleware (Bridge & Simulator): docker-compose logs -f iot_middleware

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages