{"id":31044824,"url":"https://github.com/nimadorostkar/iot_smart_system","last_synced_at":"2026-04-09T11:01:32.754Z","repository":{"id":309535182,"uuid":"1036630804","full_name":"nimadorostkar/IoT_Smart_System","owner":"nimadorostkar","description":"IoT Smart System — End‑to‑end, production‑ready platform for real‑time sensing, control, and video","archived":false,"fork":false,"pushed_at":"2025-08-12T11:22:50.000Z","size":91,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-12T13:30:45.598Z","etag":null,"topics":["esp32","iot","iot-platform","js","mqtt","python","react","real-time","zigbee"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nimadorostkar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-08-12T11:04:34.000Z","updated_at":"2025-08-12T11:22:53.000Z","dependencies_parsed_at":"2025-08-12T13:40:58.191Z","dependency_job_id":null,"html_url":"https://github.com/nimadorostkar/IoT_Smart_System","commit_stats":null,"previous_names":["nimadorostkar/iot_smart_system"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/nimadorostkar/IoT_Smart_System","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nimadorostkar%2FIoT_Smart_System","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nimadorostkar%2FIoT_Smart_System/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nimadorostkar%2FIoT_Smart_System/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nimadorostkar%2FIoT_Smart_System/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nimadorostkar","download_url":"https://codeload.github.com/nimadorostkar/IoT_Smart_System/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nimadorostkar%2FIoT_Smart_System/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275136699,"owners_count":25411709,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-14T02:00:10.474Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["esp32","iot","iot-platform","js","mqtt","python","react","real-time","zigbee"],"created_at":"2025-09-14T16:51:53.265Z","updated_at":"2025-12-30T21:23:20.488Z","avatar_url":"https://github.com/nimadorostkar.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🏠 سیستم IoT هوشمند – راهنمای کامل پروژه\n\nیک سیستم کامل IoT برای مانیتورینگ و کنترل بلادرنگ سنسورها و دستگاه‌ها با قابلیت‌های ویدیو، امنیت سطح سازمانی، و مقیاس‌پذیری بالا.\n\n## 🎯 ویژگی‌های کلیدی\n- 📊 مانیتورینگ Real-time سنسورها (دما، رطوبت، حرکت، کیفیت هوا و…)\n- 🎮 کنترل از راه دور دستگاه‌ها و خروجی‌ها (رله، دیمر و ...)\n- 📹 پخش زنده ویدیو (WebRTC/RTSP)\n- 🔐 امنیت: TLS/mTLS، احراز هویت، OTA امن\n- 📈 ذخیره‌سازی Time-series و تحلیل داده\n- ⚙️ مقیاس‌پذیر: از چند دستگاه تا هزاران دستگاه\n\n## 🏗️ معماری لایه‌ای\n1) Device Layer: سنسورها/اکچویتورها (ESP32، Zigbee، LoRa)\n2) Gateway Layer: Raspberry Pi (Bridge, Video, Local DB/Cache)\n3) Cloud Layer: API Server, MQTT Broker, Databases\n4) Application Layer: Web Dashboard, Mobile App\n\nبرای دیاگرام‌ها و فلوها: به سند تصویری مراجعه کنید: `docs/IoT_System_Blueprint.md`\n\n## 📁 ساختار پروژه\n```\nIoT_Smart_System/\n├── hardware/\n│   ├── esp32_firmware/          # Firmware ESP32 (PlatformIO)\n│   ├── raspberry_pi/            # Gateway (Python)\n│   └── pcb_designs/             # طراحی PCB (در صورت نیاز)\n├── backend/                     # Backend API و سرویس‌ها\n│   ├── package.json\n│   └── src/\n├── frontend/\n│   ├── web_dashboard/           # داشبورد React\n│   ├── mobile_app/              # اپ موبایل (Expo/React Native)\n│   └── desktop_app/             # اپ دسکتاپ (در صورت استفاده)\n├── docs/\n│   ├── IoT_System_Blueprint.md  # داکیومنت تصویری کامل\n│   ├── hardware_guide/\n│   │   ├── component_selection.md\n│   │   └── firmware_guide.md\n│   ├── software_guide/README.md\n│   └── deployment/\n│       ├── deployment_guide.md\n│       └── testing_guide.md\n├── docs/business/\n│   ├── production_business_guide.md\n│   ├── templates/               # SLA, RMA, QC, Label\n│   ├── gtm/                     # Launch plan, Messaging, ICP\n│   └── costing/                 # Cost model\n├── tools/\n│   ├── testing/\n│   └── monitoring/\n└── scripts/\n```\n\n## 🚀 شروع سریع (Quickstart)\nپیش‌نیازها: Node.js 18+، Python 3.9+، Docker \u0026 Docker Compose، PlatformIO\n\n```bash\n# 1) Backend\ncd backend\nnpm install\nnpm run dev  # یا npm start در تولید\n\n# 2) Web Dashboard\ncd ../frontend/web_dashboard\nnpm install\nnpm start\n\n# 3) Mobile App (Expo)\ncd ../mobile_app\nnpm install\nnpm run start  # expo start\n\n# 4) Firmware (ESP32)\ncd ../../hardware/esp32_firmware\npio run --target upload\npio device monitor -b 115200\n```\n\nبرای استقرار تولید با Docker Compose و راه‌اندازی کامل سرویس‌ها به `docs/deployment/deployment_guide.md` مراجعه کنید.\n\n## 🔌 ارتباطات و پروتکل‌ها\n- بین دستگاه و سرور: MQTT/TLS (QoS 1/2)\n- ویدیو: WebRTC (کم‌تاخیر) یا RTSP→WebRTC\n- سنسور تا برد: Zigbee 3.0 (Mesh)، LoRaWAN برای فاصلۀ طولانی\n- API: HTTPS + WebSocket برای Real-time UI\n\n## 🛡️ امنیت\n- mTLS/X.509 برای دستگاه‌ها (اختیاری)\n- TLS 1.3 برای API/MQTT، ACL برای Topics\n- OTA امن با امضای دیجیتال\n- جداسازی شبکه (VLAN) برای IoT\n\n## 📚 مستندات مهم\n- نقشه و دیاگرام‌های کامل: `docs/IoT_System_Blueprint.md`\n- انتخاب قطعات: `docs/hardware_guide/component_selection.md`\n- راهنمای Firmware/Hardware: `docs/hardware_guide/firmware_guide.md`\n- راهنمای نرم‌افزار: `docs/software_guide/README.md`\n- راهنمای تست کامل: `docs/deployment/testing_guide.md`\n- راهنمای استقرار: `docs/deployment/deployment_guide.md`\n- تولید انبوه و بازاریابی: `docs/business/production_business_guide.md`\n\n## ��️ تکنولوژی‌ها\n- Hardware: ESP32-S3/C6، Zigbee 3.0، LoRa (SX1276)، Raspberry Pi\n- Software: Node.js/Express، React/React Native، WebRTC، MQTT\n- Databases: MongoDB، InfluxDB، Redis\n- Observability: Grafana/Prometheus، ELK/EFK (اختیاری)\n\n## 🧪 تست و کیفیت\n- Unit/Integration/E2E/Performance/Security\n- اسکریپت‌ها و نمونه‌ها: `docs/deployment/testing_guide.md`\n\n## 💰 هزینه نمونه (تقریبی)\n- ESP32-S3 ~ $15، Raspberry Pi ~ $75، سنسورها $30–50، PCB+مونتاژ ~$25\n- جمع تقریبی واحد: ~$145–165 (متغیر)\n\n## 📄 لایسنس\nMIT (در صورت نیاز تغییر دهید)\n\n## 👥 مشارکت\n- Fork → Branch → Commit → PR\n\n## 📞 پشتیبانی\n- ایمیل: iot.support@yourcompany.com\n- اسناد: `docs/`\n\n\n\u003chr\u003e\n\nIoT Smart System is a full-stack solution for building and operating robust IoT products across smart homes, smart agriculture, and remote surveillance. It combines low-latency data ingestion (MQTT/TLS), reliable device control, secure OTA, and live video streaming (WebRTC/RTSP) with a modern web dashboard and mobile app. The system is designed to be scalable, secure, and maintainable from prototype to mass production.\n\n### Core capabilities\n- • Real-time telemetry: temperature, humidity, motion, air quality, light, sound, battery, RSSI.\n- • Device control: relays, dimmers, motors, valves, scenes, schedules.\n- • Live video: sub-150 ms WebRTC (browser/mobile) with RTSP→WebRTC gateway.\n- • Automations: threshold rules, presence/motion triggers, schedules, scenes.\n- • Alerts \u0026 notifications: MQTT events → backend rules → push/email/WS updates.\n- • OTA updates: signed images, staged rollouts, automatic rollback on failure.\n- • Multi-tenant, role-based: secure access to sites, rooms, devices.\n- • Observability: metrics, logs, traces; dashboards for system health and usage.\n\n### Architecture at a glance\n- • Device layer: ESP32 S3/C6 nodes (Wi‑Fi, Zigbee 3.0, LoRa) with deep‑sleep for battery devices.\n- • Edge/Gateway: Raspberry Pi (optional Jetson) bridges Zigbee/LoRa/Wi‑Fi, buffers data offline, and converts RTSP to WebRTC.\n- • Cloud/Core:\n  - Backend API (Node.js/Express) with JWT auth, REST, WebSocket.\n  - MQTT broker (Mosquitto/HiveMQ) with ACLs and QoS 1/2.\n  - Databases: MongoDB (entities, config, events), InfluxDB (time‑series), Redis (cache).\n- • Apps: React web dashboard and Expo/React‑Native mobile app.\n\n### Data and control planes\n- • Telemetry: MQTT/TLS topics `devices/{id}/data|heartbeat|events` (QoS 1).\n- • Commands: `devices/{id}/commands` (QoS 2, idempotent, deduplicated via message IDs).\n- • Responses: `devices/{id}/response` for execution results and timing.\n- • Video: RTSP from IP/ESP32‑CAM → WebRTC to browser/app via STUN/TURN; adaptive bitrate.\n\n### Protocol and hardware choices\n- • Sensors → MCU: Zigbee 3.0 mesh for low power and resilience; LoRaWAN for long range; Wi‑Fi for high bandwidth nodes.\n- • MCU → Cloud: MQTT over TLS 1.3; optional mTLS per device.\n- • Reference hardware:\n  - ESP32‑S3 (Wi‑Fi/BT; optional Zigbee/Thread with C6), SHT31, BMP280, BME680, BH1750, PIR/mmWave.\n  - Gateway: Raspberry Pi 4 (bridge + AI/video), optional Jetson for heavy CV.\n  - Cameras: IP cams (RTSP/PoE) and ESP32‑CAM.\n\n### Security model\n- • Device identity: per‑device X.509 (mTLS) or scoped MQTT credentials with ACLs.\n- • Transport: TLS 1.3 for MQTT/HTTPS; modern ciphers; strict certificate pinning where applicable.\n- • OTA security: signed firmware; integrity checks; staged rollout; rollback on failed health.\n- • Backend: JWT with short‑lived tokens, rate limiting, input validation, audit logging.\n- • Network: VLAN segmentation for IoT, least‑privilege firewall rules.\n- • Secrets: separate KMS or vault where available; rotated credentials and keys.\n\n### Reliability and scale\n- • Broker HA: clustered MQTT or active/standby with persistence; retained LWT topics for presence.\n- • Backpressure/resilience: gateway store‑and‑forward, bounded queues, exponential backoff, jitter.\n- • SLOs: end‑to‑end telemetry ≤ 200 ms (LAN), ≤ 500 ms (WAN); command execution ≤ 1 s; WebRTC latency ≤ 150 ms.\n- • Throughput: 10k+ devices and 10k msg/s supported with horizontal scaling (API/broker/db sharding).\n\n### Data model and topics\n- • Canonical payload fields: `device_id`, `timestamp`, `temperature`, `humidity`, `pressure`, `gas_resistance`, `light_level`, `sound_level`, `motion`, `battery`, `rssi`, `free_heap`.\n- • Namespacing and conventions: kebab‑case topic suffixes, versioned schemas where needed, server‑side validation.\n\n### Automations and rules\n- • Thresholds: fire alerts when values cross configured bounds (with cooldowns).\n- • Schedules: cron‑style or calendar‑based device control.\n- • Scenes: orchestrate multiple actuators atomically.\n- • Presence/motion: instant event → action mapping via gateway or backend rules engine.\n\n### Developer experience\n- • Repos and structure: devices/gateway/backend/frontend under `IoT_Smart_System/`.\n- • Quickstart: npm scripts for API/UI, PlatformIO for firmware, Docker Compose for infra.\n- • API docs: Swagger at `/api-docs`; WS event contracts documented.\n- • Code style: typed models, explicit error handling, early returns, and readable naming.\n\n### Testing and CI/CD\n- • Unit/integration/E2E/security tests; realistic MQTT and WS integration harnesses.\n- • Performance/load: Artillery for API, custom MQTT stress tools.\n- • Hardware‑in‑loop: serial/MQTT test scripts for ESP32 and gateway.\n- • CI pipelines: build, test, coverage, container builds, and deploy gates.\n\n### Observability and operations\n- • Metrics: Prometheus exporters for API, broker, and node; Grafana dashboards (uptime, msg rate, latencies).\n- • Logs: ELK/EFK stack integration; correlation IDs across services.\n- • Backups and DR: automated Mongo/Influx backups, restore scripts, periodic recovery drills.\n- • Health checks: HTTP and broker probes; alerting on error budgets and SLA breaches.\n\n### Deployment options\n- • Single node: Docker Compose (quick production or pilot).\n- • Cluster: Kubernetes (HA API/broker/db), Nginx ingress with TLS, horizontal autoscaling.\n- • On‑prem/edge: gateway‑only with intermittent sync to cloud; local control keeps functioning offline.\n\n### Business and GTM (optional)\n- • SKU kits and costing models; CE/FCC/RoHS readiness; QC (IQC/IPQC/FQC), AOI/ICT/FCT, burn‑in workflows.\n- • Launch plan, messaging, ICP personas; SLA and RMA templates.\n- • See `docs/business/` for production and marketing materials.\n\n### Primary use cases\n- • Smart home/buildings: environmental comfort, safety, energy, presence‑aware automations.\n- • Smart agriculture: long‑range sensing (LoRa), irrigation control, solar power, offline‑friendly.\n- • Remote surveillance: low‑latency video, motion alerts, video analytics (optional Jetson).\n\n### Roadmap highlights\n- • Matter/Thread integration; multi‑region clusters; fine‑grained policy engine.\n- • Edge analytics on gateway (TinyML/TFLite) for anomaly detection.\n- • Plug‑in marketplace for device drivers and automations.\n\nWhere to start:\n- • Architecture and diagrams: `docs/IoT_System_Blueprint.md`\n- • Hardware/firmware: `docs/hardware_guide/firmware_guide.md` and `hardware/esp32_firmware/`\n- • Backend/API: `backend/` (Swagger docs at `/api-docs`)\n- • Web/Mobile apps: `frontend/web_dashboard/`, `frontend/mobile_app/`\n- • Deployment/testing: `docs/deployment/`\n\n- I added a comprehensive English overview you can paste into `README.md` or use on your website and collateral.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnimadorostkar%2Fiot_smart_system","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnimadorostkar%2Fiot_smart_system","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnimadorostkar%2Fiot_smart_system/lists"}