Skip to content
This repository was archived by the owner on Apr 14, 2024. It is now read-only.
Skoms0Public archive

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Repository files navigation

SAPRET Projet

Static Badge Static Badge

What is SAPRET ?

SAPRET is the name of the project, this comme from the acronym of "Suivi Automotisé du Personnel et des Radios Engagés sur le Terrain". This solution is built to be used in real life, especially by the Association Départementale de Protection Civile de Loire-Atlantique (ADPC44). As a member of this first-aid association, I (Gabin) contribute by managing the hundred radios we have in all the Loire-Atlantique department. These radios also known as walkie-talkies permit to join the rescuers working on field to prevent them of a potential victim in a specific place. This technology is in the core of the intervention management and fast response time.

Optimize the response time is one of the main objectives at each operation. For exemple, when an operator in the control room receives a call from the security of the event saying someone is having a medical issue, the operator has to know who is the closest crew to prevent it of the intervention. Historically, the operator called each crew every 10 minutes to know his current location. This is tedious and not precise because the crews are constantly in move. To avoid this, I had to make this automatic and this is how SAPRET borned.

How does it work ?

The radios we use are compliant with the DMR standard, released by ETSI. DMR (Digital Mobile Radio) is a digital transmission mode, so we can transmit data in addition to voice. In 2022, I have enabled the GPS functionality in all the radios and have set the position upload interval to 60s. Each radio is set to send his location to a specific radio in the network which is set to receive all these GPS information. This radio is connected to a PC and a specific software developped by the manufacturer of the radios (Hytera) stores the GPS location in KML files. One file per radio and per day is created and automatically filled. From this moment, SAPRET runs.

SAPRET is composed of two parts : backend and frontend.

The job of the backend is to scan all KML files, extract informations about each radio (ID, name, last GPS coordinates, last GPS upload time), store the in a NoSQL DB (MongoDB in this case) and supply API's for user authentication and GPS location fetching.

The frontend is the visible part for the user, it contains an authentication system, a map to display the location of each radio, and some tools (checkbox to see a radio on the map or not, checkbox to set the state of the crew, map in full screen, map center chooser, real time clock on the map). AS this app is used in a context of fast response time, whe have to make it simple as possible. Location of the radios are updated automatically and the website is optimised to display dynamicaly new radios turning on during an event.

Project setup

To avoid installing a database on each PC of the dev team, the entire solution has been deployed on a server accessible using a special VPN access provided by Gabin. The server has been set to pull all the modification from the github repo, and a DNS name has been set on the VPN server to make possible the use of the remote backend when running the frontend locally on the dev's PC.

Install the project :

npm install

To start the website type in a console :

npm run dev 

Open an other terminal in the project and type :

cd ./server
node server.js

Let's try to be clear, here is the organisation of the project. (Please keep it updated !)

PROJETWEBINSA/
├── public/
│   └──logo.png
├── server/
│   └── src/
│   │   └──KML_files
│   └── server.js
├── src/
│   ├── assets\styles/
│   │   ├── styles.css
│   ├── Components/
│   │   ├── Form/
│   │   │  └── Checkbox.jsx
│   │   ├── Functions/
│   │   │  └── getRadioList.jsx
│   │   ├── HomePage/
│   │   │  └── HomePage.jsx
│   │   │  └── MapPage.jsx
│   │   │  └── RadioItem.jsx
│   │   │  └── RadioList.jsx
│   │   ├── ResetPage/
│   │   │  └──Reset.jsx
│   │   ├── LoginPage
│   │   │   └── LoginPage.jsx
│   │   │   └── ProtectedRoute.jsx
│   │   ├── CreatUser
│   │   │   └──CreatUser.jsx
│   ├── Utils/
│   │   └── CheckToken.jsx
│   ├── App.js
│   ├── index.css
│   └── main.jsx
└── ....

User access

When the web server is up, go to the web page and use this credential : login : admin@admin mdp : admin

Access to MongoDB

Download MongoDB Compass to have a graphical interface for accessing the given database : https://www.mongodb.com/try/download/compass

Once the installation is complete, make sure you are on the VPN then connect as follows :

image

After connection, several Tables appear in the left banner. The server is connected to the 'react' Table. By clicking on it you access all the collections that exist in our DB.

Exemple : image

If you want to install a mongodb server locally here is the download link

https://www.mongodb.com/download-center/enterprise/releases/archive

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages