An intelligent web-based home automation platform for centralized smart device management, sensor monitoring, energy optimization, and AI-driven automation.
| Layer | Technology |
|---|---|
| Frontend | Vue.js 3, Vite, Pinia, Vue Router, Axios, Tailwind CSS |
| Backend | Java 21, Spring Boot 3, Spring Security, Spring Data JPA, JWT |
| Database | MySQL 8.x |
| Tools | Maven, Swagger OpenAPI, Lombok |
AI-Smart-Home-System/
├── backend/ # Spring Boot backend
│ ├── src/main/java/com/paradox/aismarthome/
│ │ ├── controller/ # REST API controllers
│ │ │ ├── AuthController.java
│ │ │ ├── UserController.java
│ │ │ ├── DeviceController.java
│ │ │ ├── SensorController.java
│ │ │ ├── AlertController.java
│ │ │ ├── EnergyUsageController.java
│ │ │ └── AIController.java
│ │ ├── service/ # Business logic
│ │ │ ├── AuthService.java
│ │ │ ├── UserService.java
│ │ │ ├── DeviceService.java
│ │ │ ├── SensorService.java
│ │ │ ├── AlertService.java
│ │ │ ├── EnergyUsageService.java
│ │ │ └── AIService.java
│ │ ├── repository/ # JPA repositories
│ │ ├── entity/ # JPA entities (User, Device, Sensor, Alert, EnergyUsage)
│ │ ├── dto/ # Data transfer objects
│ │ ├── security/ # JWT & Spring Security
│ │ ├── config/ # App configuration
│ │ └── exception/ # Global exception handling
│ └── src/main/resources/
│ └── application.properties
├── frontend/ # Vue.js frontend
│ ├── src/
│ │ ├── views/ # Page components
│ │ ├── components/ # Reusable UI components
│ │ ├── stores/ # Pinia state stores
│ │ ├── services/ # Axios API services
│ │ ├── layouts/ # Main & Auth layouts
│ │ └── router/ # Vue Router config
│ ├── index.html
│ ├── vite.config.js
│ └── tailwind.config.js
├── database/
│ └── schema.sql # MySQL schema
└── docs/ # Design documentation
- Authentication - JWT-based login/register with role-based access control
- Device Management - Add, update, delete, and toggle smart devices
- Sensor Monitoring - Real-time temperature, humidity, motion, light monitoring
- Alert System - Automatic alerts with severity classification (LOW/MEDIUM/HIGH)
- Energy Monitoring - Daily, weekly, monthly consumption tracking & reports
- AI Automation - Security Mode, Comfort Mode, and Energy Saving Mode
- USER - Manage devices, view sensors, receive alerts, track energy
- ADMIN - User management, system statistics, full access
- Java 21+
- Node.js 18+
- MySQL 8.x
- Maven 3.9+
mysql -u root -p < database/schema.sqlcd backend
mvn clean install
mvn spring-boot:runBackend runs on: http://localhost:8080 Swagger UI: http://localhost:8080/swagger-ui.html
cd frontend
npm install
npm run devFrontend runs on: http://localhost:5173
Register a new account at http://localhost:5173/register
- First registered user should be manually set to ADMIN role in the database if needed.
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/auth/register |
Register new user |
| POST | /api/auth/login |
Login, returns JWT |
| GET | /api/users/profile |
Get user profile |
| PUT | /api/users/profile |
Update profile |
| GET | /api/devices |
List user devices |
| POST | /api/devices |
Add new device |
| PUT | /api/devices/{id} |
Update device status |
| DELETE | /api/devices/{id} |
Remove device |
| GET | /api/sensors |
List all sensors |
| GET | /api/alerts |
List user alerts |
| POST | /api/alerts |
Create alert |
| DELETE | /api/alerts/{id} |
Remove alert |
| GET | /api/energy |
List energy records |
| GET | /api/energy/daily |
Daily report |
| GET | /api/energy/monthly |
Monthly report |
| POST | /api/ai/security |
Run Security Mode |
| POST | /api/ai/comfort |
Run Comfort Mode |
| POST | /api/ai/energy-saving |
Run Energy Saving Mode |
Vue.js 3 Frontend → REST API → Spring Boot MVC
↓ Controller Layer
↓ Service Layer (Business Logic)
↓ Repository Layer (JPA)
↓ MySQL Database
Security: Spring Security + JWT + BCrypt + Role-Based Access Control