Skip to content

lam843/Infraction-Violation-Detection-System-in-radars

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 

Repository files navigation

Infraction Violation Detection System in Radars (SD project)

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.

Table of Contents

Getting Started

Prerequisites

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

Technologies Used

The following technologies and frameworks are used in this application:

  • Spring Boot
  • Spring Cloud
  • Eureka Descovery
  • Angular
  • Bootstrap
  • MySQL

Functionalities

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.

Technical Architecture

Gateway

Class Diagram

DiagClass

Backend Services

The backend contains 5 services :

Regestration Service

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:
All Vehicles

project example

Find Vehicle By Id

project example

  • Web services integration REST, GraphQL, SOAP et GRPC :

a. REST :

Tests with Postman

All Vehicles

project example

Find Vehicle By Id

project example

Find Vehicle Owner

project example

Delete Vehicle

project example

Update Vehicle

project example

b. GraphQL :

All Vehicles with specific attributs

project example

Find Vehicle By Id with specific attributs

project example

All owners

project example

c. SOAP :

Tests with SoapUI

project example

Specific Owner information

project example

d. GRPC :

Tests with BloomRPC

All Owners

project example

Find Owner By Id

project example

Radar Service

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 Service

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
update using postman

project example

Database view

project example

Eureka Discovery Service

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
│

Gateway Service

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

Frontend with Angular

Secure your system with an OAuth2 authentication system like Keycloak :

image

Lanching the server:

image

Authentification to the webstie using a created user :

image

How the website look like:

image

Demo video:
screen-capture.5.webm

About

Radar Violation Detection System (Distributed Systems Project)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published