This is a secure REST API for managing an IoT sensor infrastructure, developed using Spring Boot. The platform allows for comprehensive management of IoT devices, measurements, and alerts with role-based access control.
- Backend: Spring Boot
- Database: MongoDB
- Security: Spring Security, JWT Authentication
- DevOps: Docker, Jenkins, GitHub Actions
- Testing: JUnit, Mockito
- Documentation: Swagger
- List devices with pagination
- Search devices by zone
- Add new devices (admin-only)
- View zones
- Add new zones (admin-only)
- Record sensor measurements
- View measurements
- Export measurement data
- Pagination support
- Monitor and track sensor alerts
- Severity-based alert classification
- Temperature and humidity alert thresholds
- User registration
- Role-based authentication
- User role management (admin-only)
- Stateless JWT Authentication
- Role-based Access Control
/api/admin/*endpoints require ADMIN role/api/user/*endpoints require USER role
- BCrypt Password Encryption
- Development Profile
- Production Profile
- Automated quick checks:
- Unit testing
- Code syntax validation
- Style and convention checks
- Dependency vulnerability scanning
- Compilation verification
- Complete build and deployment pipeline
- Docker image generation
- Deployment to Docker Hub
- Version Control: Git
- Project Management: JIRA (Scrum)
- Code Quality: SonarLint
- API Testing: Postman
- API Documentation: Swagger
- Devices belong to a Zone
- Zones can contain multiple Devices
- Devices can have multiple Measurements
- Devices can generate multiple Alerts
- CRITICAL: < -10°C or > 40°C
- HIGH: -5°C to -10°C or 35-40°C
- MEDIUM: 0°C to -5°C or 30-35°C
- LOW: 25-30°C
- NORMAL: 20-25°C
- CRITICAL: < 20% or > 90%
- HIGH: 20-30% or 80-90%
- MEDIUM: 30-40% or 70-80%
- LOW: 40-45% or 65-70%
- NORMAL: 45-65%
- Java 8
- Maven
- Docker
- MongoDB
- Clone the repository
- Run
mvn clean packageto generate the jar file - Start the application
docker compose up -d --build- Start interacting with the API at
localhost:8080/api/*
NOTE: run
docker compose downto shutdown the application.
- Run unit tests:
mvn test - Run integration tests:
mvn verify
Access Swagger UI at: http://localhost:8080/swagger-ui.html
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request