Improve README documentation

This commit is contained in:
Charles Mendiburu 2026-03-28 15:46:12 +01:00
parent cc3c7001d9
commit 0023603b90

109
README.md
View File

@ -1,83 +1,64 @@
# Gestion des Objets Connectés # Vigimétéo - Connected Objects Management
Vigimétéo est une plateforme web innovante dédiée à la visualisation en temps réel des données météorologiques issues de capteurs connectés. Ce projet permet à tout utilisateur de consulter des informations météo actualisées tout en offrant un espace dadministration complet pour gérer capteurs, utilisateurs et catégories. Vigimétéo is an innovative web platform dedicated to real-time visualization of meteorological data from connected sensors. This project allows any user to consult updated weather information while providing a complete administration area to manage sensors, users, and categories.
## Table des matières ## Table of Contents
1. [Description](#description) 1. [Description](#description)
2. [Fonctionnalités](#fonctionnalités) 2. [Features](#features)
3. [Installation](#installation) 3. [Usage (Docker - Cloud Deployment)](#usage-docker---cloud-deployment)
4. [Base de données](#base-de-données) 4. [AI Usage](#ai-usage)
5. [Utilisation](#utilisation)
--- ---
## Description ## Description
Vigimétéo est un outil à la fois utile et accessible face aux enjeux climatiques actuels. Grâce à une architecture mêlant React pour le front-end et Vert.x pour le back-end, le système repose sur une base de données PostgreSQL centralisant les mesures collectées par les stations. Vigimétéo is a tool that is both useful and accessible in the face of current climate challenges. Using an architecture combining React for the front-end and Vert.x for the back-end, the system relies on a PostgreSQL database centralizing measurements collected by weather stations.
Linterface permet à la fois une consultation intuitive pour le grand public, et une gestion complète pour les administrateurs via un tableau de bord sécurisé. The interface allows for both intuitive consultation for the general public and complete management for administrators via a secured dashboard.
## Fonctionnalités ## Features
- Consultation des données météorologiques - Consult real-time meteorological data (fake data for now, not yet connected with an API)
- Gestion d'IoT météorologique avec possibilité d'ajouter des alertes si les données sont deviennent trop extremes - IoT Device Management with the ability to set alerts for extreme data values
- Gestion des utilisateurs : ajout, suppression, modification - User Management: add, delete, and modify users
- Gestion des catégories d'objets - Category Management: manage device types
- Interface responsive - Responsive Interface (Mobile & Desktop)
- Authentification sécurisée avec JWT - Secure Authentication with JWT
- **Multi-language Support (i18n)**: Interface available in French and English
## Installation ## Usage (Docker - Cloud Deployment)
1. Front-end : This application has been containerized to meet the requirements of the Cloud Computing course (Dev Web Ing1).
Ouvrez un terminal, déplacez vous dans le dossier Front-end du projet et executez la commande 'npm install'
2. Back-end :
Assurez-vous que toutes ces étapes soient faites avant de lancer le projet
Installer java
Installer le starter Vert.x depuis le site (https://vertx.io/docs/)
Installer JDK
Configurer java.home = « PATH/FOR/JDK »
Installer mvn : choco install mvn
**Dans le dossier Back-end du projet**
Mettre à jour les dépendances : mvn clean install
3. Lancez l'application : ### Prerequisites
**Dans le dossier Back-end du projet** - **Required OS:** Linux (Ubuntu/Debian) with `docker` and `docker-compose` configured.
mvn exec:java - **Required Resources:** Internet connection to download base Docker images (`nginx`, `node`, `maven`, `eclipse-temurin`, `postgres`).
**Dans le dossier Front-end du projet**
npm run dev
## Base de données ### Services / Containers
The architecture is split into 3 distinct services via `docker-compose.yaml`:
1. **vigimeteo_frontend**: Image built via a multi-stage `Dockerfile` (Node.js to compile the Vite application, then Alpine Nginx to serve static files). This service listens on public port `5000`.
2. **vigimeteo_backend**: Image built via a multi-stage `Dockerfile` (Maven to compile the JAR, then JRE 17 for execution). Runs the Vert.x API and communicates on public port `8888`.
3. **vigimeteo_db**: Official `postgres:15-alpine` image.
1. Assurez vous que PostgreSQL soit installé: ### Virtual Networks and Named Volumes
sudo apt update - **Network:** `vigimeteo_net` (Bridge) allows frontend, backend, and DB containers to communicate securely in isolation from the rest of the system.
sudo apt install postgresql postgresql-contrib - **Volume:** The persistent volume `vigimeteo_data` is mounted on the `/var/lib/postgresql/data` directory of the DB container. It ensures data persistence, guaranteeing that weather data and user accounts are not lost when restarting or rebuilding the containers.
2. Démarez le service:
sudo service postgresql start
3. Lancer pgAdmin 4:
-Connectez-vous à votre serveur PostgreSQL avec le mot de passe administrateur.
-Faites un clic droit sur Databases > Create > Database....
-Appelez la "postgres" et cliquez sur Save.
4. Importer la base de données via pgAdmin :
-Faites un clic droit sur votre nouvelle base de données et selectionez "Restore"
-Entrez le chemin du fichier export.sql situé dans le repertoire sql à la racine du projet
-Cliquez sur Restore
----------------- Ou en ligne de commande ----------------------
5. Importer la base de données:
psql -U postgres -d postgres -f ./export.sql
---------------- Ou avec execution de commande sql ------------
6. Importer la base de données:
-creer la base de donnée "postgres" puis executer le fichier export1.sql
---
5. Verifiez que vos informations correspondent au fichier '.\Back-end\src\main\java\com\example\starter\DatabaseService.java' ### Container Configuration
-Nom de la base - **Environment Variables:** The Vert.x backend dynamically reads PostgreSQL credentials (e.g., `DB_HOST`, `DB_PASSWORD`) provided via environment variables in the `docker-compose.yaml` file.
-Nom dutilisateur - **DB Initialization:** The PostgreSQL container automatically synchronizes the `sql/init_db.sql` file in its `/docker-entrypoint-initdb.d/init.sql` directory for automatic population upon first initialization.
-Mot de passe - **Restart Policy:** All containers include the `restart: always` policy to restart automatically in case of failure.
-Port
## Utilisation ### How to Run the Application
1. **Prepare the application**: Run `./prepare-app.sh`. This script initiates `docker-compose build` to create/download the images.
2. **Launch the application**: Run `./start-app.sh`. Access the web application via your browser at `http://localhost:5000`. You can log into the administration interface using the email `admin.a@gmail.com` and password `azertyuiop`.
3. **Pause the application**: Run `./stop-app.sh`. This script stops the containers gracefully without resetting their state or destroying the virtual network.
4. **Remove the application**: Run `./remove-app.sh`. This removes all containers, networks, local images, and **named volumes**, erasing all traces of the deployed application.
- Une fois l'application lancée, accédez à `http://localhost:5173`. ## AI Usage (Cloud Computing Course)
- Connectez vous au compte admin avec le mail:"admin.a@gmail.com" et mdp:"azertyuiop"
- Vous pouvez aussi vous connecter à un compte complexe avec le mail "complexe@gmail.com" et mdp:"azertyuiop" - **AI Agent used:** Google Gemini
- **AI's Role:**
- Verification and optimization of the DockerCompose file
- Implementation of the English/French internationalization (i18n) system.
- Upgrade of the README for technical and overall the project structure