This application is a combination of a web-based frontend and backend. The frontend is developed using Angular with Bootstrap for a user-friendly interface, while the backend is built using Spring Boot. Its main purpose is to detect and track radar violations in real-time, ensuring efficient traffic management. The system offers various functionalities beyond the standard data querying and modification operations. It allows users to submit speeding violations, which are recorded as offense records. Additionally, vehicle owners can easily access and view their own violation history, providing them with convenient access to their offense records.
- Getting Started
- Technologies Used
- Technical Architecture
- Class Diagram
- Backend Services
- Frontend with Angular
Before running this application, you need to have the following software installed on your system :
- Java Development Kit (JDK) version 11 or later
- Node.js version 14 or later
- Angular CLI version 13 or later
The following technologies and frameworks are used in this application:
- Spring Boot
- Spring Cloud
- Eureka Descovery
- Angular
- Bootstrap
- MySQL
The application allows performing the following operations:
- Submit a speeding violation.
- View violations of a vehicle owner.
- Modify and view radar data.
- Modify and view vehicle and owner data.
- Modify and view infraction data.
The backend contains 5 services :
Registration microservice manages vehicles owned by owners. Each vehicle belongs to a single owner.
An owner is defined by their ID, name, date of birth, email.
A vehicle is defined by its ID, regestration number, brand, fiscal power, and model
- Service Structure
├───src │ ├───main │ │ ├───java │ │ │ └───ma │ │ │ └───example │ │ │ └───registrationservice │ │ │ │ RegistrationServiceApplication.java │ │ │ │ │ │ │ ├───entites │ │ │ │ Owner.java │ │ │ │ OwnerRequest.java │ │ │ │ Vehicle.java │ │ │ │ │ │ │ ├───repositories │ │ │ │ OwnerRepository.java │ │ │ │ VehicleRepository.java │ │ │ │ │ │ │ └───web │ │ │ ├───graphql │ │ │ │ OwnerGraphqlController.java │ │ │ │ VehicleGraphqlController.java │ │ │ │ │ │ │ ├───grpc │ │ │ │ │ GrpcConfig.java │ │ │ │ │ OwnerGrpcService.java │ │ │ │ │ │ │ │ │ └───stub │ │ │ │ OwnerGrpcServiceGrpc.java │ │ │ │ OwnerService.java │ │ │ │ │ │ │ ├───rest │ │ │ │ OwnerRestController.java │ │ │ │ VehicleRestController.java │ │ │ │ │ │ │ └───soap │ │ │ CXFSoapWebServiceConfig.java │ │ │ OwnerSoapController.java │ │ │ OwnerSoapService.java │ │ │ │ │ └───resources │ │ │ application.properties │ │ │ owner-service.proto │ │ │ xsd-schema.xsd │ │ │ │ │ ├───graphql │ │ │ schema.graphqls │ │ │ │ │ ├───static │ │ └───templates
- Registration Service Based on Spring data:
- Web services integration REST, GraphQL, SOAP et GRPC :
a. REST :
Tests with Postman
b. GraphQL :
c. SOAP :
Tests with SoapUI
d. GRPC :
Tests with BloomRPC
Radar microservice responsible for managing radars handles radar entities defined
by their ID, maximum speed limit, and coordinates (longitude and latitude)
- Service Structure
├───src │ ├───main │ │ ├───java │ │ │ └───ma │ │ │ └───example │ │ │ └───radarservice │ │ │ │ RadarServiceApplication.java │ │ │ │ │ │ │ ├───entites │ │ │ │ Radar.java │ │ │ │ │ │ │ ├───feign │ │ │ │ InfractionRestClient.java │ │ │ │ │ │ │ ├───models │ │ │ │ Infraction.java │ │ │ │ NewData.java │ │ │ │ │ │ │ ├───repositories │ │ │ │ RadarRepository.java │ │ │ │ │ │ │ └───web │ │ │ RadarRestController.java │ │ │ │ │ └───resources │ │ │ application.properties │ │ │ radar-service.proto │ │ │ │ │ ├───static │ │ └───templates
Infraction microservice responsible for managing violations handles each violation, which is defined
by its ID, date, the radar number that detected the offense, the vehicle regestration number,
the vehicle's speed, the radar's maximum speed limit, and the fine amount.
- Service Structure
├───src │ ├───main │ │ ├───java │ │ │ └───ma │ │ │ └───example │ │ │ └───infractionservice │ │ │ │ InfractionServiceApplication.java │ │ │ │ │ │ │ ├───entites │ │ │ │ Infraction.java │ │ │ │ │ │ │ ├───feign │ │ │ │ RadarRestClient.java │ │ │ │ VehicleRestClient.java │ │ │ │ │ │ │ ├───models │ │ │ │ NewData.java │ │ │ │ Owner.java │ │ │ │ Radar.java │ │ │ │ Vehicle.java │ │ │ │ │ │ │ ├───repositories │ │ │ │ InfractionRepository.java │ │ │ │ │ │ │ └───web │ │ │ InfractionRestController.java │ │ │ │ │ └───resources │ │ │ application.properties │ │ │ │ │ ├───static │ │ └───templates
server-side component in the Netflix OSS stack that allows services to register
and discover each other in a microservices architecture.
- Service Structure
├───src │ ├───main │ │ ├───java │ │ │ └───ma │ │ │ └───example │ │ │ └───eurekadiscovery │ │ │ EurekaDiscoveryApplication.java │ │ │ │ │ └───resources │ │ application.properties │ │ │ └───test │ └───java │ └───ma │ └───example │ └───eurekadiscovery │ EurekaDiscoveryApplicationTests.java │
Spring Cloud Gateway It provides a centralized entry point for routing and filtering requests
to microservices in a distributed system, enabling dynamic and scalable routing based on various criteria.
- Service Structure
├───src │ ├───main │ │ ├───java │ │ │ └───ma │ │ │ └───example │ │ │ └───gateway │ │ │ GatewayApplication.java │ │ │ │ │ └───resources │ │ application.properties │ │ application.yml