A full-stack distributed web application for monitoring and managing energy consumption of user devices.
This application follows a Layered Architecture:
- Presentation Layer: ReactJS frontend, Spring Boot Controllers
- Application Layer: Business logic via Services
- Domain Layer: Entity models and business rules
- Infrastructure Layer: DAO classes and persistence logic
- Backend: Java, Spring Boot
- Frontend: ReactJS
- Database: PostgreSQL
- Messaging: RabbitMQ
- Security: JWT (JSON Web Token)
- Real-Time Updates: WebSocket
- Deployment: Docker, Azure DevOps (Frontend)
JWT tokens are used to secure the REST API.
AuthenticationControllerissues tokensJwtAuthFiltervalidates requestsJwtUtilsgenerates and verifies tokensSecurityConfigmanages CORS, CSRF, and security rulesUserDetailsintegration in the User model- Frontend adds the JWT token in the
Authorizationheader
- Create, read, update, delete users and devices
- Assign devices to users
- View and chat with users in real-time
- View energy usage by device and date
- Receive alerts when consumption exceeds limit
- Chat with admin in real-time
Relationships:
Role↔User: one-to-manyUser↔Device: one-to-manyDevice↔Consumption: one-to-many
-
Producer App:
- Reads a CSV file
- Sends JSON-formatted messages to RabbitMQ
-
Backend Consumer:
- Connects to RabbitMQ
- Parses messages
- Stores data in
Consumptiontable
- Configured using
WebSocketConfigand SockJS - Real-time updates on:
- Energy consumption
- Alerts for max energy exceeded
- Chat typing indicators and message status
Implemented fully via WebSockets.
- Admin sees list of users who sent messages
- Admin and users can chat in real-time
- "Typing" and "seen" notifications included
docker-compose build
docker-compose up- Backend: Java + PostgreSQL
- Frontend: ReactJS
- Backend IDE: IntelliJ IDEA
- Frontend IDE: WebStorm
- Database Management: PGAdmin 4
- API Testing: Postman
Developed by Dunca Denisa-Mihaela, 30643
Faculty of Computer Automation and Computer Science




