The PluvIA Server is a lightweight automation pipeline built with n8n and deployed using Docker.
It periodically scrapes rainfall data from the AESA-PB (Water Management Agency of Paraíba, Brazil) and prepares this data for offline use in the PluvIA mobile app.
The server performs the following key steps:
-
Scheduled Scraping
Periodically fetches precipitation data from:
https://sigrh.aesa.pb.gov.br(AESA rainfall stations) -
Preprocessing and Transformation
Cleans and parses the raw data into a structured format (JSON), filtering only relevant fields like time, location, and precipitation volume. -
AI-based Forecasting
Uses an offline LLM model (via Ollama) to assist in processing and enriching precipitation forecasts. -
Location Enrichment
Matches rainfall data with geographic metadata (e.g., street names, locations). -
Database Storage
Final output is saved to a MongoDB database, which is accessed by the PluvIA mobile app for offline forecasts and flood-risk analysis.
-
Docker compose
- The server is containerized with Docker and can be deployed with a single command:
docker compose up -d
- The server is containerized with Docker and can be deployed with a single command:
-
Create a new Workflow:
- At the menu bar click at "..." > Import from File
-
Select the workflow file:
- Locate n8n's workflow JSON file at the path:
./n8n-data/pipeline.json
- Locate n8n's workflow JSON file at the path:
-
Run the Schedule node:
- Run the Schedule node for to run the routine on schedule
Then the service should be available at http://localhost:5678
This will spin up the n8n workflow automation service along with any necessary dependencies (e.g., MongoDB, Ollama).
The PluvIA app periodically syncs with this server to retrieve the latest precipitation and flood forecast data. Once synced, all processing continues offline on the user's mobile device.
- n8n – workflow automation
- Docker – container orchestration
- MongoDB – data storage
- Ollama – offline LLM inference
Note: This server only requires internet access to fetch data and provide sync endpoints. All other logic (prediction, chat, alerts) happens inside the mobile app, offline.