Software architecture - rodekruis/IBF-system GitHub Wiki

A high-level representation of the software architecture,

graph LR

    subgraph pipeline
        E[(Exposure)]
        H[(Hazard)]
        M((Trigger Model))

        E -.-> M
        H -.-> M

        style pipeline fill:transparent,stroke:#777777,stroke-width:1px,stroke-dasharray: 10
        style E fill:transparent,stroke:#777777,stroke-width:1px
        style H fill:transparent,stroke:#777777,stroke-width:1px
        style M fill:transparent,stroke:#777777,stroke-width:1px
    end
    subgraph backend
        A{{REST API}}

        subgraph database
            P[(Postgres)]
            G[(Geoserver)]

            click P "https://www.postgresql.org"
            click G "https://geoserver.org"

            style database fill:transparent,stroke:#aaaaaa,stroke-width:1px,stroke-dasharray: 2
            style P fill:transparent,stroke:#777777,stroke-width:1px
            style G fill:transparent,stroke:#777777,stroke-width:1px
        end

        A <--> database

        click A "https://ibf.510.global/docs"

        style backend fill:transparent,stroke:#777777,stroke-width:1px,stroke-dasharray: 10
        style A fill:transparent,stroke:#777777,stroke-width:1px
    end

    I[dashboard]
    MC[Mailchimp]
    TW[Twilio]
    KB[Kobo Toolbox]

    M -- Forecast --> A
    backend -.-> |Email alerts| MC
    backend -.-> |WhatsApp alerts| TW
    KB -.-> |Community notifications / Early actions| A
    backend <--> I

    click KB "https://kobo.ifrc.org"
    click MC "https://mailchimp.com"
    click TW "https://www.twilio.com"
    click I "https://ibf.510.global"

    style I fill:transparent,stroke:#777777,stroke-width:1px
    style MC fill:transparent,stroke:#777777,stroke-width:1px
    style TW fill:transparent,stroke:#777777,stroke-width:1px
    style KB fill:transparent,stroke:#777777,stroke-width:1px

On the left side are input sources,

  1. The pipelines provide forecasts of future hazards.
  2. The Kobo Toolbox provides field data from the end-user.

In the middle is the backend which includes,

  1. The REST API which manages the database.
  2. The Postgres database for relational data.
  3. The Geoserver to store and serve raster data.

On the right are the user interfaces,

  1. Users receive email alerts when a hazard is forecasted.
  2. Users receive WhatsApp alerts when a hazard is forecasted.
  3. Users can view the forecast on the dashboard.

API-service modules

This module dependency graph was generated using nestjs-spelunker. It visualizes the NestJS modules in API-service.

graph LR
  EapActionsModule-->UserModule
  UserModule-->LookupModule
  WaterpointsModule-->UserModule
  WaterpointsModule-->CountryModule
  CountryModule-->UserModule
  AdminAreaModule-->UserModule
  AdminAreaModule-->EventModule
  EventModule-->UserModule
  EventModule-->CountryModule
  EventModule-->EapActionsModule
  EventModule-->TyphoonTrackModule
  TyphoonTrackModule-->UserModule
  EventModule-->DisasterTypeModule
  DisasterTypeModule-->UserModule
  EventModule-->MetadataModule
  MetadataModule-->UserModule
  MetadataModule-->CountryModule
  MetadataModule-->DisasterTypeModule
  AdminAreaModule-->CountryModule
  AdminAreaModule-->DisasterTypeModule
  AdminAreaDynamicDataModule-->UserModule
  AdminAreaDynamicDataModule-->EventModule
  AdminAreaDynamicDataModule-->CountryModule
  AdminAreaDynamicDataModule-->AdminAreaModule
  ProcessEventsModule-->UserModule
  ProcessEventsModule-->EventModule
  ProcessEventsModule-->NotificationModule
  NotificationModule-->UserModule
  NotificationModule-->EventModule
  NotificationModule-->WhatsappModule
  WhatsappModule-->LookupModule
  WhatsappModule-->EventModule
  WhatsappModule-->NotificationContentModule
  NotificationContentModule-->EventModule
  NotificationContentModule-->AdminAreaDataModule
  AdminAreaDataModule-->UserModule
  NotificationContentModule-->AdminAreaModule
  NotificationContentModule-->DisasterTypeModule
  NotificationContentModule-->MetadataModule
  WhatsappModule-->MetadataModule
  NotificationModule-->NotificationContentModule
  NotificationModule-->TyphoonTrackModule
  PointDataModule-->UserModule
  PointDataModule-->WhatsappModule
  LinesDataModule-->UserModule
  CronjobModule-->AdminAreaDynamicDataModule