An application to manage a Smart Building
Deployed Backend on Clever-Cloud
- Author : Tareq Md Rabiul Hossain Chy
- Based on Guillaume Ehret's course
- Backend of the 2022 Web & Mobile Programing project for MSc CPS2 Web & Mobile programming course
- The management of the users' health (Pollution), comfort, and energy consumption, require conflicting management of windows and heaters in public buildings. It is necessary to ventilate as much as possible, but the weather is cold, and the heaters need to be turned on. So the building has a window opener device, a heater remote controler and some teamperature sensors.
- This applications allows the user to visualize the temperature of each room, the status of the windows and heaters. Also, it allows to control both the heaters and the windows of each room and also room in building and building.
The goal of the 2022 Web & Mobile Programing project is to implement a fully functional Smart Building management system(especially building, rooms, windows and heaters controllers). The project is composed of a Java SpringBoot Backend server, an Android Kotlin Application and a VueJS Frontend server interacting together.
Clone the repo. The Login credential is given below. See the Login credential & run.
- Username: user.
- Password: password.
./gradlew bootRun
Anyone can now access the backend on localhost:8080 or on the Deployed server
Anyone can experiment with the API on localhost:8080/swagger-ui/ or on the Deployed server
For getting the jar files of the application run the given command in the terminal:
./gradlew build
After running the command JAR Files will be available in build/libs directory.
Build the image with docker build command in the terminal:
docker build -t faircorpdockerimage .
Run Docker image using given command:
docker run -p 8080:8080 faircorpdockerimage
- Request Type: GET
- Endpoint: /api/windows
- Request Type: POST
- Endpoint: /api/windows
- Body:
{ "id": 0, "name": "string", "roomId": 0, "roomName": "string", "windowStatus": "CLOSED" }
- Request Type: GET
- Endpoint: /api/windows/{windowId}
- {windowId}: A Long Integer
- Request Type: DELETE
- Endpoint: /api/windows/{windowId}
- {windowId}: A Long Integer
- Request Type: PUT
- Endpoint: /api/windows/{windowId}/switch
- {windowId}: A Long Integer
- Request Type: GET
- Endpoint: /api/windows/room/{roomId}
- {roomId}: A Long Integer
- Request Type: GET
- Endpoint: /api/heaters
- Request Type: POST
- Endpoint: /api/heaters
- Body:
{ "heaterStatus": "OFF", "id": 0, "name": "string", "power": 0, "roomId": 0, "roomName": "string" }
- Request Type: GET
- Endpoint: /api/heaters/{heaterId}
- {heaterId}: A Long Integer
- Request Type: DELETE
- Endpoint: /api/heaters/{heaterId}
- {heaterId}: A Long Integer
- Request Type: PUT
- Endpoint: /api/heaters/{heaterId}/switch
- {heaterId}: A Long Integer
- Request Type: GET
- Endpoint: /api/heaters/room/{roomId}
- {roomId}: A Long Integer
- Request Type: GET
- Endpoint: /api/rooms
- Request Type: POST
- Endpoint: /api/rooms
- Body:
{ "buildingId": 0, "currentTemperature": 0, "floor": 0, "id": 0, "name": "string", "targetTemperature": 0 }
- Request Type: GET
- Endpoint: /api/rooms/{roomId}
- {roomId}: A Long Integer
- Request Type: DELETE
- Endpoint: /api/rooms/{roomId}
- {roomId}: A Long Integer
- Request Type: GET
- Endpoint: /api/rooms/buildings/{buildingId}
- {buildingId}: A long Integer
- Request Type: PUT
- Endpoint: /api/rooms/{roomId}/switchHeaters
- {roomId}: A Long Integer
- Request Type: PUT
- Endpoint: /api/rooms/{roomId}/switchWindows
- {roomId}: A Long Integer
- Request Type: GET
- Endpoint: /api/rooms/building/{buildingId}
- {roomId}: A Long Integer
- Request Type: GET
- Endpoint: /api/buildings
- Request Type: POST
- Endpoint: /api/buildings
- Body:
{ "id": 0, "name": "string", "outsideTemperature": 0 }
- Request Type: GET
- Endpoint: /api/buildings/{buildingId}
- {buildingId}: A Long Integer
- Request Type: DELETE
- Endpoint: /api/buildings/{buildingId}
- {buildingId}: A Long Integer
- If anyone delete a room all windows and heaters inside this room will be deleted.
- If anyone delete a building all rooms inside the building will be deleted.
- For reporting uses you can do it in the issues section of this repository.
- For contacting the developer for any other reason please email me at [email protected] or [email protected]