This project is a full-stack application for managing smart home devices. It allows users to view, add, update, and delete devices, as well as control their specific states (e.g., turning lights on/off, adjusting brightness, managing thermostat temperature, etc.).
The system consists of:
- A Spring Boot backend that provides RESTful APIs for device management.
- An Angular frontend for a responsive and interactive user interface.
- Fully containerized using Docker for seamless deployment.
- Device Management: Add, edit, delete, and view smart devices.
- Device Control: Adjust device states, such as turning lights on/off, controlling brightness, and setting thermostat temperatures.
- Cross-Origin Support: Backend is configured to work seamlessly with the Angular frontend.
- Fully Dockerized: Easy deployment using Docker and Docker Compose.
- Backend: Java Spring Boot
- Frontend: Angular with Angular Material
- Database: mySQL
- Containerization: Docker and Docker Compose
git clone <repository-url>
cd <repository-folder>Make sure the following are installed on your system:
- Java 23+
- Node.js (22 or later)
- Angular CLI
- Docker and Docker Compose
-
Build and deploy the entire stack (backend, frontend, and database) with Docker Compose:
docker-compose up --build
-
Access the application:
- Frontend: http://localhost:4200
- Backend API: http://localhost:8080
-
Navigate to the backend directory:
cd backend -
Build and run the Spring Boot application:
./mvnw clean install java -jar target/shms-0.0.1-SNAPSHOT.jar
-
Verify the backend is running at http://localhost:8080.
-
Navigate to the frontend directory:
cd frontend -
Install dependencies:
npm install
-
Build and serve the Angular application:
ng serve
-
Access the frontend at http://localhost:4200.
Here are some key endpoints:
GET /<model-name>/all: Retrieve all devices of that type. ex.GET /light/all: Retrieve all lights.GET /<model-name>?name={name}: Get a device of that type by name. ex.GET /light/?name={name}: Retrieve all lights.GET /device: Retrieve all devices.