Skip to content

Server-side data pipeline for the PluvIA mobile app.

Notifications You must be signed in to change notification settings

Agents4Good/PluvIA-Server

Repository files navigation

PluvIA Server

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.


Overview

The server performs the following key steps:

  1. Scheduled Scraping
    Periodically fetches precipitation data from:
    https://sigrh.aesa.pb.gov.br (AESA rainfall stations)

  2. Preprocessing and Transformation
    Cleans and parses the raw data into a structured format (JSON), filtering only relevant fields like time, location, and precipitation volume.

  3. AI-based Forecasting
    Uses an offline LLM model (via Ollama) to assist in processing and enriching precipitation forecasts.

  4. Location Enrichment
    Matches rainfall data with geographic metadata (e.g., street names, locations).

  5. 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.


Deployment

  1. Docker compose

    • The server is containerized with Docker and can be deployed with a single command: docker compose up -d
  2. Create a new Workflow:

    • At the menu bar click at "..." > Import from File
  3. Select the workflow file:

    • Locate n8n's workflow JSON file at the path: ./n8n-data/pipeline.json
  4. 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).


Integration with Mobile App

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.


Technologies

  • 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.

About

Server-side data pipeline for the PluvIA mobile app.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •