Skip to content

Latest commit

Β 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

IoT & AI Platform Logo

IoT & AI Visual Programming Platform

An intuitive, block-based visual programming platform for IoT and AI/ML development

Features β€’ Screenshots β€’ Quick Start β€’ Usage Guide β€’ API Docs β€’ Contributing


🎯 Overview

This platform enables students (school to university level) to design, build, and deploy IoT and AI/ML solutions without deep prior coding knowledgeβ€”while allowing smooth transition to real code as skills grow.

Who is this for?

User Type Use Cases
πŸŽ“ School Students Simple blocks, instant feedback, simulations
🏫 University Students Advanced logic, real hardware, AI models
πŸ‘¨β€πŸ« Educators Curriculum tools, assignments, assessment
πŸ”§ Makers & Beginners Rapid prototyping, learning IoT/AI

✨ Features

🧩 Visual Block Editor

  • Drag-and-drop programming with Google Blockly
  • 50+ custom blocks for IoT and AI
  • Real-time code generation (Python, C++, JavaScript)
  • Event-driven programming support

πŸ”Œ IoT Capabilities

  • Hardware Support: Arduino, ESP32, Raspberry Pi
  • Sensors: Temperature, humidity, distance, light, motion
  • Actuators: LED, servo, buzzer, DC motors, displays
  • Connectivity: WiFi, MQTT, HTTP/REST APIs
  • Device Simulator: Learn without physical hardware

πŸ€– AI/ML Features

  • Computer Vision: Image classification, object detection, face detection
  • Speech: Speech-to-text, text-to-speech, voice commands
  • Prediction: Time-series forecasting, anomaly detection
  • Pre-trained Models: MobileNet, COCO-SSD, and more
  • Custom Models: Train your own with AutoML

πŸ“Š Dashboard & Analytics

  • Project management and organization
  • Device status monitoring
  • Sensor data visualization
  • Learning progress tracking

πŸ“š Learning System

  • Interactive tutorials and courses
  • Difficulty levels (Beginner β†’ Advanced)
  • XP and achievement system
  • Curriculum-aligned content

πŸ“Έ Screenshots

Click to view screenshots

Dashboard

Dashboard

Block Editor

Block Editor

Projects

Projects

Devices

Devices

AI Models

AI Models

Learning

Learning


πŸš€ Quick Start

Prerequisites

Installation

# Clone the repository
git clone https://github.com/yourusername/iot-ai-platform.git
cd iot-ai-platform

# Install all dependencies (frontend + backend)
npm run install:all

# Start development servers
npm run dev

Access the Application

Service URL
🌐 Frontend http://localhost:5173
πŸ”§ Backend API http://localhost:8000
πŸ“– API Documentation http://localhost:8000/docs

πŸ“– Usage Guide

1. Getting Started

  1. Open the application at http://localhost:5173
  2. Explore the Dashboard to see your projects and learning progress
  3. Click "New Project" or navigate to the Block Editor

2. Creating Your First Project

Step 1: Open the Block Editor

Navigate to the Block Editor from the sidebar or click "Start Building" on the dashboard.

Step 2: Drag Blocks

From the toolbox on the left, drag blocks onto the workspace:

  • Events β†’ Start with "when program starts"
  • IoT - Digital β†’ Add "set digital pin" blocks
  • Time β†’ Add "wait" blocks for delays

Step 3: Build a Blink Program

⚑ when program starts
  └── πŸ”„ repeat forever
        └── πŸ’‘ set LED pin 13 ON
        └── ⏰ wait 1000 ms
        └── πŸ’‘ set LED pin 13 OFF
        └── ⏰ wait 1000 ms

Step 4: View Generated Code

The right panel shows the generated Python/C++ code in real-time.

Step 5: Run or Export

  • Click Run to test in the simulator
  • Click Export to download the code
  • Click Save to save your project

3. Working with IoT Blocks

Sensors

🌑️ read temperature DHT11 pin 4     β†’ Returns temperature in Β°C
πŸ’§ read humidity DHT11 pin 4        β†’ Returns humidity %
πŸ“ read distance trig 9 echo 10     β†’ Returns distance in cm
πŸ’‘ read light level pin A0          β†’ Returns 0-1023
πŸƒ motion detected pin 7            β†’ Returns true/false

Actuators

πŸ’‘ set LED pin 13 ON/OFF            β†’ Control LEDs
πŸ”„ set servo pin 9 angle 90         β†’ Control servo motors
πŸ”Š buzzer pin 8 frequency 1000 Hz   β†’ Play tones
πŸš— motor A forward speed 255        β†’ Control DC motors

Connectivity

πŸ“‘ connect WiFi "SSID" "password"   β†’ Connect to WiFi
πŸ”— connect MQTT broker "url" 1883   β†’ Connect to MQTT
πŸ“€ MQTT publish to "topic" message  β†’ Send MQTT message
πŸ“₯ MQTT subscribe to "topic"        β†’ Receive MQTT messages
🌐 HTTP GET "url"                   β†’ Make HTTP requests

4. Working with AI Blocks

Computer Vision

πŸ“· capture image from camera        β†’ Take a photo
🏷️ classify image MobileNet         β†’ Identify objects
πŸ” detect objects COCO-SSD          β†’ Find multiple objects
πŸ‘€ detect faces                      β†’ Find faces in image

Speech

🎀 listen for speech                β†’ Speech to text
πŸ”Š speak "Hello World"              β†’ Text to speech
🎯 wait for command "turn on"       β†’ Voice commands

Prediction

πŸ“ˆ predict from data [...]          β†’ Time series prediction
🏷️ classify data [...]              β†’ Data classification
⚠️ is anomaly value                 β†’ Anomaly detection

5. Managing Devices

  1. Navigate to Devices from the sidebar
  2. Click "Add Device" to register new hardware
  3. Select device type: Arduino, ESP32, Raspberry Pi, or Simulator
  4. Enter device details (name, IP address if applicable)
  5. Use Configure to adjust device settings
  6. Click Reconnect if a device goes offline

6. Learning & Tutorials

  1. Go to Learn from the sidebar
  2. Continue Learning - Resume your current course
  3. Tutorials - Browse by category (IoT/AI) and difficulty
  4. Complete tutorials to earn XP and track progress
  5. Locked tutorials unlock as you progress

πŸ—οΈ Project Structure

iot-ai-platform/
β”œβ”€β”€ frontend/                    # React + TypeScript frontend
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/          # Reusable UI components
β”‚   β”‚   β”‚   β”œβ”€β”€ Layout.tsx       # Main layout wrapper
β”‚   β”‚   β”‚   β”œβ”€β”€ Sidebar.tsx      # Navigation sidebar
β”‚   β”‚   β”‚   β”œβ”€β”€ Header.tsx       # Top header bar
β”‚   β”‚   β”‚   β”œβ”€β”€ CodeView.tsx     # Code display panel
β”‚   β”‚   β”‚   └── SimulatorPanel.tsx
β”‚   β”‚   β”œβ”€β”€ pages/               # Page components
β”‚   β”‚   β”‚   β”œβ”€β”€ Dashboard.tsx    # Home dashboard
β”‚   β”‚   β”‚   β”œβ”€β”€ Editor.tsx       # Block editor
β”‚   β”‚   β”‚   β”œβ”€β”€ Projects.tsx     # Project management
β”‚   β”‚   β”‚   β”œβ”€β”€ Devices.tsx      # Device management
β”‚   β”‚   β”‚   β”œβ”€β”€ AIModels.tsx     # AI model management
β”‚   β”‚   β”‚   β”œβ”€β”€ Learn.tsx        # Tutorials & courses
β”‚   β”‚   β”‚   └── Settings.tsx     # User settings
β”‚   β”‚   β”œβ”€β”€ blocks/              # Custom Blockly blocks
β”‚   β”‚   β”‚   └── index.ts         # IoT & AI block definitions
β”‚   β”‚   β”œβ”€β”€ services/            # API services
β”‚   β”‚   β”‚   └── api.ts           # Axios API client
β”‚   β”‚   β”œβ”€β”€ store/               # Zustand state management
β”‚   β”‚   β”‚   └── index.ts         # Global state store
β”‚   β”‚   β”œβ”€β”€ App.tsx              # Root component
β”‚   β”‚   └── main.tsx             # Entry point
β”‚   β”œβ”€β”€ package.json
β”‚   └── vite.config.ts
β”‚
β”œβ”€β”€ backend/                     # FastAPI Python backend
β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”œβ”€β”€ api/                 # API routes
β”‚   β”‚   β”‚   β”œβ”€β”€ routes/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ auth.py      # Authentication
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ projects.py  # Project CRUD
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ devices.py   # Device management
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ ai_models.py # AI model management
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ code.py      # Code generation
β”‚   β”‚   β”‚   β”‚   └── tutorials.py # Learning system
β”‚   β”‚   β”‚   └── __init__.py      # Router aggregation
β”‚   β”‚   β”œβ”€β”€ core/                # Core utilities
β”‚   β”‚   β”‚   β”œβ”€β”€ config.py        # Settings & configuration
β”‚   β”‚   β”‚   β”œβ”€β”€ database.py      # Database setup
β”‚   β”‚   β”‚   └── security.py      # JWT authentication
β”‚   β”‚   β”œβ”€β”€ models/              # SQLAlchemy models
β”‚   β”‚   β”‚   └── __init__.py      # Database models
β”‚   β”‚   β”œβ”€β”€ schemas/             # Pydantic schemas
β”‚   β”‚   β”‚   └── __init__.py      # Request/Response schemas
β”‚   β”‚   β”œβ”€β”€ services/            # Business logic
β”‚   β”‚   β”‚   └── code_generator.py
β”‚   β”‚   └── main.py              # FastAPI app entry
β”‚   └── requirements.txt
β”‚
β”œβ”€β”€ docs/                        # Documentation
β”‚   └── screenshots/             # Application screenshots
β”œβ”€β”€ package.json                 # Root package.json
└── README.md                    # This file

πŸ”§ Technology Stack

Frontend

Technology Purpose
React 18 UI framework
TypeScript Type safety
Blockly Visual programming
TailwindCSS Styling
Zustand State management
React Router Navigation
Axios HTTP client
Recharts Data visualization

Backend

Technology Purpose
FastAPI Web framework
SQLAlchemy ORM
SQLite/PostgreSQL Database
Pydantic Data validation
JWT Authentication
MQTT IoT messaging

AI/ML

Technology Purpose
TensorFlow.js Browser ML
MobileNet Image classification
COCO-SSD Object detection
Web Speech API Voice features

πŸ“‘ API Documentation

Authentication

POST /api/auth/register
POST /api/auth/login
GET  /api/auth/me

Projects

GET    /api/projects/           # List all projects
POST   /api/projects/           # Create project
GET    /api/projects/{id}       # Get project
PUT    /api/projects/{id}       # Update project
DELETE /api/projects/{id}       # Delete project
POST   /api/projects/{id}/duplicate

Devices

GET    /api/devices/            # List devices
POST   /api/devices/            # Register device
GET    /api/devices/{id}        # Get device
PUT    /api/devices/{id}        # Update device
DELETE /api/devices/{id}        # Remove device
POST   /api/devices/{id}/ping   # Ping device
POST   /api/devices/{id}/upload # Upload code

Code Generation

POST /api/code/generate         # Generate code from blocks
POST /api/code/validate         # Validate generated code
GET  /api/code/templates/{name} # Get code template

Full API documentation available at http://localhost:8000/docs


πŸ› οΈ Development

Running in Development Mode

# Terminal 1: Frontend
cd frontend && npm run dev

# Terminal 2: Backend
cd backend && uvicorn app.main:app --reload --port 8000

Building for Production

# Build frontend
cd frontend && npm run build

# The built files will be in frontend/dist/

Environment Variables

Create a .env file in the backend directory:

SECRET_KEY=your-secret-key-here
DATABASE_URL=sqlite+aiosqlite:///./platform.db
MQTT_BROKER=localhost
MQTT_PORT=1883

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


πŸ™ Acknowledgments


Made with ❀️ for IoT and AI education

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages