How capstone-bau-2025/smart-home-system works
Main Components
• Mobile Application: Built with React Native (found under the mobileapp directory), this is the front-end interface through which users interact with the system.
• Cloud Server: A Spring Boot application (located in the cloudserver directory) providing a Web API, handling real-time communications with WebSockets, managing authentication/role management, and interfacing with an Oracle database to store user and hub data.
• Central Hub: Also a Spring Boot application (in the centralhub directory) running on a Raspberry Pi. It handles local device communications using Mosquitto MQTT, local database (SQLite), device control logic, automation rules, and connectivity with IoT devices.
• IoT Devices / Device Templates: Represented by the device-template folder. This component serves as a blueprint for integrating and managing various smart devices within the home.
• Supporting Documentation: The docs folder provides protocol and setup details, which can also be referenced to understand integration patterns (e.g., the devices-hub-comm-protocol and mosquitto setup).
Relationships and Interactions
• The Mobile App communicates with the Cloud Server for user authentication, sending control commands, retrieving notifications, etc.
• The Cloud Server provides remote access by relaying commands and receiving data. It utilizes WebSocket for real-time communication back to the Mobile App.
• The Cloud Server also interacts with the Central Hub through secure API endpoints (and possibly via token-based authentication mechanisms). This allows the hub to register and exchange status updates.
• The Central Hub communicates with individual IoT devices using MQTT (via Mosquitto) to control devices, process local automation, monitor states, and send notifications.
• In addition, both the Cloud Server and Central Hub contain separate security configurations (via JWT auth filters and security configs) as shown in the file structure.
Architectural Patterns & Design Principles
• Layered / MVC Architecture in both Central Hub and Cloud Server (visible through the controllers, services, repositories, and DTOs).
• Use of Microservice-like separation: while each component is a monolith in its own right, the clear separation of responsibilities (local vs. remote, UI vs. backend) advocates a service-oriented architecture.
• Integration using MQTT for IoT device communication and WebSocket/HTTP-based interactions for real-time updates.
• Clear separation of concerns: the mobile app for front-end, Cloud Server for remote access and central coordination, and Central Hub for local device management.
Relevant Technologies & Their Roles
• Java Spring Boot: Used for building the Cloud Server and Central Hub.
• Mosquitto MQTT: Enables IoT communications on the Central Hub.
• SQLite & Oracle DB: Represent local (hub) and enterprise (cloud) data storage, respectively.
• React Native & Expo: Underpin the mobile application.
• WebSocket: Handles real-time message exchange in the Cloud Server.
• Gradle (via build files): Indicates build and dependency management setups.
• JWT Authentication: Present in both the hub and cloud, enforcing security.
• Mobile App (with a note about React Native and push notifications)
• Cloud Server (highlight Spring Boot, WebSocket, Oracle DB)
• Central Hub (emphasize Spring Boot, MQTT, SQLite)
• IoT Devices/Device Template (indicate that these follow a standardized protocol that integrates via MQTT)
• Rectangles for application/service components
Additional Details
• Mention any intricacies visible in the file tree such as the organization of REST controllers, DTOs, and service layers that imply a clean separation of concerns.