Skip to content

IFRC Alert Hub provides global emergency alerts, empowering communities to protect lives and livelihoods.

License

Notifications You must be signed in to change notification settings

IFRCGo/alert-hub-web-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IFRC ALERT HUB

Web client for the Alert Hub platform

Getting started

Prerequisites

You can either use docker or pnpm to locally run or build this application.

Local setup

1. Clone the repo

git clone [email protected]:IFRCGo/alert-hub-web-app.git
cd alert-hub-web-app

2. Install the dependencies

# Skip if running through docker
pnpm install

3. Setup environment variables:

Create a .env file with following variables

APP_TITLE=
APP_MAPBOX_ACCESS_TOKEN=
APP_GRAPHQL_API_ENDPOINT=
APP_GRAPHQL_CODEGEN_ENDPOINT=

You can contact IFRC team to get appropriate values for these variables

4. Run dev instance

pnpm start
# or
docker-compose up

Directory Structure

.
├── patches/ (Patches to any of the external dependencies)
├── public/ (Content that needs to be copied during build)
├── generated/ (Generated files: eg. Typescript Definitions)
├── index.html (Base html file)
└── src/
    ├── App/
    │   ├── index.tsx (Defines providers: eg. Auth, Route, Request, Alert)
    │   └── routes.tsx
            ├── index.tsx (Defines routes for the pages)    
    ├── assets/ (images, icons)
    ├── components/ (Commonly used components)
    │   ├── domain/ (Components that are specific to a domain)
    ├── config.ts (Defines configurations read from environment variables)
    ├── declarations/ (Type declarations for external libraries)
    ├── hooks (React Hooks)
    ├── index.tsx (Initializes React)
    ├── utils (Utility functions)
    └── views/ (Pages that we can navigate on the platform)
        └── RootLayout/
            └── index.tsx (Defines root layout and requests fetched for DomainContext)

IFRC Alert Hub backend

The backend that serves the frontend application is maintained in a separate repository.

External facing API

Here is the documentation for Alert Hub GraphQL Client Usage Guide