# Vigimétéo - Connected Objects Management 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 of Contents 1. [Description](#description) 2. [Features](#features) 3. [Usage (Docker - Cloud Deployment)](#usage-docker---cloud-deployment) 4. [AI Usage](#ai-usage) --- ## Description 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. The interface allows for both intuitive consultation for the general public and complete management for administrators via a secured dashboard. ## Features - Consult real-time meteorological data (fake data for now, not yet connected with an API) - IoT Device Management with the ability to set alerts for extreme data values - User Management: add, delete, and modify users - Category Management: manage device types - Responsive Interface (Mobile & Desktop) - Secure Authentication with JWT - **Multi-language Support (i18n)**: Interface available in French and English ## Usage (Docker - Cloud Deployment) This application has been containerized to meet the requirements of the Cloud Computing course (Dev Web Ing1). ### Prerequisites - **Required OS:** Linux (Ubuntu/Debian) with `docker` and `docker-compose` configured. - **Required Resources:** Internet connection to download base Docker images (`nginx`, `node`, `maven`, `eclipse-temurin`, `postgres`). ### 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. ### Virtual Networks and Named Volumes - **Network:** `vigimeteo_net` (Bridge) allows frontend, backend, and DB containers to communicate securely in isolation from the rest of the system. - **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. ### Container Configuration - **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. - **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. - **Restart Policy:** All containers include the `restart: always` policy to restart automatically in case of failure. ### 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`. You can also use the `complexe@gmail.com` and password `azertyuiop` to try different role. 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. ## AI Usage (Cloud Computing Course) - **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