Code Monkey home page Code Monkey logo

helpful-information's Introduction

Helpful Information

A web-app People Affected can use to lookup useful organizations and information.

⚠️
To quickly create a new instance, follow the Guide: How to set up an instance (quickly)


Status

Latest releases and notable changes are in the CHANGELOG.

  • Tests
  • Workflows

How it works

The Helpful Information App (HIA) is a web-app that can show a list of 1 or more "regions", each of which is a separate dataset of structured content. This consists of "Offers", sorted in "Categories" and (optional) "Sub-Categories".

The web-app is a pre-build, static web-app that lists links to "regions", which are all separate data-sources contained in Google Sheets 'files'.

The different sheets within these 'files' each have a different data-model. So that their content can be used to display in the web-app.

The contents of these sheets is loaded at runtime by the visitor's browser from the "Google Sheets API".

How to use

Once the web-app is configured (See Configuration) and deployed (See Deployment) its content can be managed via the Google Sheets interface.

Security

⚠️ All content of the web-app can be controlled by the contents of the Google Sheet in use.

So take appropriate precautions regarding file-ownership and "edit"-permissions of these files and the related Google Accounts.

  • Limit the amount of users/Google Accounts that have "edit"-permissions to the 'least possible'
  • Don't share the credentials/passwords of these accounts with multiple people
  • Use a strong password on these Google Accounts
  • Use all possible extra security-features on these Google Accounts, like 2-factor-authentication etc.

Working with Google Sheets 'files'

⚠️ Everything is visible on the website on every 'save' (so, immediately, most of the times).

  • Don't change the name of any sheet.
  • Don't change the #tags in the columns-headers in any sheet, the name/label/heading can be changed/translated.
  • Don't use formatting-tools in Google Sheets (bold/italic/underline/fonts/colors); It will not be used.
  • Don't use the "insert link"-feature.
    The plain text in a cell should be the full URL.

Optional:

  • All columns can be reordered, as long as their #tags remain in their header-cell.
  • You can use the toggle in the "Visible?"-column to prepare a 'draft' of a row and finally 'publish' by setting it to "Show".
  • You can use background-colors to mark/highlight any changes or 'flag issues'; These styles will not be used in the web-app.

Text formatting

To support (some) formatting and structuring in some (multi-line) fields, the Markdown-syntax can be used.

An explanation of (a lot of) the features of this syntax can be found in the Markdown Guide Cheat Sheet. Not everything beyond the "Basic Syntax" is supported in all fields.


Getting Started

  • Install environment requirements:

    Install the Node.js version specified in the .node-version-file.
    To prevent conflicts it is recommended to use a 'version manager'.

    • fnm (for Windows/macOS/Linux) After installing, run in this directory:

      fnm use
      
  • Install dependencies (from this directory):

    npm install
    
  • To finish you local set-up, run (required only once):

    npm run setup
    
  • Start in development-mode:

    npm start
    
  • Start in production-mode:

    npm run start:production
    

Configuration

Some specific information needs to be configured before use:

  • For use in development:
    Set these different properties in the environment.ts-file.

  • For use in production:
    These values need to be set in the .env-file. Or as ENV-variables via other means.

  • For deployments:
    The ENV-variables defined in the .env.example-file need to be defined in the build-environment according to the specific deployment-tool/service.
    See for example the GitHub Action workflow (production).

Using the Google Sheets API

Local development

As part of the installed dev-dependencies, we use Prettier to format our code.
To use these settings without a local setup, use the Prettier Playground in your browser.

When installing locally, we use husky to automate the formatting and testing (when not already handled by your editor).

Local API

To use a local API, without the need for any Google account/credentials:

  1. Update the local environment.ts-file with:

        regions: 'test-local-1',
        regionsLabels: 'Test Local 1',
        regionsSheetIds: 'test-sheet-id-1',
    
        google_sheets_api_key: '<can be anything, will be ignored>';
        google_sheets_api_url: 'http://localhost:3001',
  2. Run (in a separate process/terminal):

    npm run serve:local-data

  3. Adjust the JSON-files in the data-directory to try out different content.

Testing

Automated tests are configured and can be run (once) with:

npm test

During development, an automated watch-process can be run with:

npm run test:watch

Recommended tools

Libraries/frameworks in use

  • Ionic v7

    ⚠️ The Ionicons icon-set is NOT included in the final build, so cannot be used 'by default'. Icons can be added manually.

  • Angular v17
  • ngx-markdown is used to process Markdown-content into HTML. No optional dependencies are included/used.

Updating dependencies

Most (development-)dependencies in this repository are monitored by the GitHub Dependabot service, to keep them up-to-date.
Unfortunately most individual dependencies are 'linked' to related dependencies that need to stay 'in sync'.

To update all Angular and ESLint related dependencies, run:

npm run upgrade:angular

Data Model

Based on the data fetched from the Google Sheets, an internal data-structure is build. This is used to render the interface.

The following are illustrations only, to help get an overview, it might not be up-to-date with the actual code.

Data Model (internal)

The code below can be easily edited/previewed using the Mermaid.live editor.

%%{ init:{ 'theme':'base', 'themeVariables':{'lineColor':'blue'} }}%%

classDiagram
  class App {
    ENV
    regions
    regionLabels
    regionSheetIds
  }

  class Region {
    slug
    label
    googleSheetId
  }

  class Category {
    int categoryID
    slug
    bool isVisible
    icon
    description
  }

  class SubCategory {
    int subCategoryID
    slug
    bool isVisible
    icon
    description
  }

  class Offer {
    int offerId
    slug
    int subCategoryID
    int categoryID
    bool isVisible
    offerName
    icon
    + ...many more properties
  }

  class QASet {
    int id
    int subCategoryID
    int categoryID
    bool isVisible
    slug
    parentSlug
    question
    answer
    Date updated
    bool isHighlight
    array~QASet~ children
  }

  direction LR
    App -- "1..*" Region
    Region -- "1..*" Category
    Category -- "0..*" SubCategory
    SubCategory -- "0..*" Offer
    SubCategory -- "0..*" QASet
    QASet -- "0..*" QASet : children

Data Model (external)

The code below can be easily edited/previewed using the Mermaid.live editor.

%%{ init:{ 'theme':'base', 'themeVariables':{'lineColor':'blue'} }}%%

classDiagram
  class GoogleSheet {
    string id
  }
  class ReferralPage {
    Key-Value rows [];
  }

  class Help {
    Documentation only
  }
  class Options {
    Only for uses in the Sheet itself
  }

  direction TB
    GoogleSheet -- "1" ReferralPage
    GoogleSheet .. "1" Help
    GoogleSheet .. "1" Options

    GoogleSheet -- "1" Categories
    GoogleSheet -- "1" SubCategories
    GoogleSheet -- "1" Offers
    GoogleSheet -- "1" Q_As

    Categories : rows []
    SubCategories : rows []
    Offers : rows []
    Q_As : rows []

Features

Build level configuration

See the options in the .env.example-file.

Each Instance:

  • can have 1 or multiple Sheet(s), each:
    • has a unique URL-slug ([a-z0-9._-])
    • has a human-readable (short) label (can contain capitals, spaces, numbers, emoji, etc.)
    • has a Google Spreadsheet ID, a 44-character string (from: https://docs.google.com/spreadsheets/d/___SPREADSHEET_ID___/edit?usp=sharing)

Sheet level configuration

See the options in the "Referral Page"-sheet:

  • it has a #KEY-column with all available properties(Using #tag.sub-tags, from RegionDataKey) and #VALUE-column with their current value.

(Sub-)Category features

Each (Sub-)Category:

  • can have a (single line) name
  • can have a URL-slug ([a-z0-9._-]);
    This needs to be unique within all Categories; For each Sub-Category it needs to be unique within its parent Category only.
  • can have a multi-line description, Markdown syntax can be used for structure/formatting.
  • can have an (absolute/relative/data-) URL for an icon
  • can be hidden by setting the "Visible?"-column to Hide.

Offer features

Each Offer

  • needs to have a Category ID and a Sub-Category ID set.
  • can have a URL-slug ([a-z0-9._-]);
    This needs to be unique within its parent Sub-Category only.
  • can be hidden by setting the "Visible?"-column to Hide.
  • can have some multi-line fields, Markdown syntax can be used for structure/formatting in those.

Q&A features

Each Q&A-set

  • needs to have a Category ID and a Sub-Category ID set.
  • needs to have an Answer value
  • can have a URL-slug ([a-z0-9._-]);
    This needs to be unique within all Q&A-sets.
  • can be hidden by setting the "Visible?"-column to Hide.
  • can be shown as a Sub-Question by setting the Parent-column to the Slug of another Question.
  • can have a "(last) updated"-date set, to indicate its 'freshness'
  • can have a multi-line Answer, Markdown syntax can be used for structure/formatting.

Highlighted-overview ("Recent changes")

  • Each Q&A-set can be shown in the Highlighted-overview by setting the "Highlighted?"-column to Yes.
  • All these sets will be shown with their Category/Sub-Category-context (with links).
  • Their "(last) updated"-date is shown prominently, for easy scanning/spotting "what's new?"
  • The sets with a "(last) updated"-date will be shown with the "most recent"-date first, those without a date are shown after, in the order they appear in the sheet.

Search

Using the search-input Q&A-sets can be filtered to match 1 or more keywords to the Question OR the Answer values of a Q&A-set.

  • Keywords are case-insensitive, so Help will match help, HELP or HeLp
  • Some special characters will be ignored, like +, *, [, ], (, ), etc. Periods (.) can be included in keywords to match URLs
  • Each keyword needs to be separated by spaces (not , or ;, etc.)
  • To include spaces in a keyword, surround with: " (double quotes)
    For example: help "Red Cross" will match help or Red Cross

Deployment

The web-app can be deployed as a static single-page-app or PWA.

  • Make sure the .env-configuration is prepared. See: .env.example

  • To generate a directory(www) with all HTML, JS, JSON and SVG assets, run:

    npm run build:production
    
  • This directory can be deployed to any hosting-solution (supporting HTTPS), using the recommended server configuration.

Using Azure Static Web Apps

To deploy the web-app using Azure Static Web App service:

Using static file hosting (i.e. Surge.sh, GitHub/GitLab Pages or similar)

To deploy the web-app using or a static-files web-host, see options at: https://www.jamstackdeploy.com/

Configure and build a 'production'-build of the web-app following the steps defined at "Deployment".

Follow one of these 'guides' from Surge.


License

Released under the Apache 2.0 License. See LICENSE.

helpful-information's People

Contributors

arsforza avatar dependabot[bot] avatar elwinschmitz avatar github-actions[bot] avatar gulfaraz avatar jlijftogt avatar jmargutt avatar msftgits avatar nadiyemeral avatar orcanlrc avatar rjager-rodekruis avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

helpful-information's Issues

START PAGE RESPONSIVENESS

As an PA end-user I would like to have no more than 3 columns of buttons when opening the web app on my phone.

Problem: On Huawei android interface the 6 buttons are not in 3 columns high and 2 across can we always have only 6 buttons visible and stacked simply.

WhatsApp Image 2021-02-23 at 12 16 08

Adding static map to HIA?

Question that came up during the User Test insights presentation:

Is it possible to add a (static) map to show the location of an organisation?
We also see that a lot of organisations hand out A4 papers with relevant information (usually address & contact details) that also includes a screenshot of a map.

Important to consider: loading time with slow/low internet connectivity when using HIA on shared WiFi network.

Show current environment(i.e. staging/development) prominently

So that we/clients/aid-workers know wheb they are looking at the staging-server/data and not live/production.

Possible solutions

  • The window/tab title of the page could append a label i.e. Helpful Information - Amsterdam [ staging ]
  • The page (fav)icon could be different per environment
  • A 'floating' label/bar on the top of the window with the text " staging "
    Only when there is vertical space, so not to overlap fully with the back-button/logo-link
  • Or place this bar at the bottom?
  • Or ...?

To Do

  • Add configurable ENV_NAME-property to build-step
  • Show banner with envName (only when defined!)
  • Set ENV_NAME in deployment-scripts/secrets

Logo worldhouse is not loading

To Reproduce

  1. Go to 'Shelter > Day Shelter'

Expected behaviour
Logo should show

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS:
  • Browser Google Chrome
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.
Screenshot 2021-04-08 at 12 17 27

Engagement plan (together with Carry)

Online:

  • NLRC socials
  • FB groups partner organisations

Offline:

  • Business cards
  • ...

One communication/outreach plan with all options & process.
Adding MEAL to measure impact

To become part of (updated) MEAL plan.

Discuss adding languages

Now there are 6 languages for the vaccination information.
How do we do this in the future?
I.e. will we add Dutch?

Offline availability

Goal is to know if this is possible or not.
If yes: how?
If not: why not?
To document.

If not possible, what are alternative solutions?
I.e. create free WiFi points.

Add additional category: "Terugkeer"

Title is TBD.

Button would contain information about terugkeer/returning:

There are 3 potential options:

  • Returning to country of origin
  • Returing to country of arrival in Europe
  • Migration to third country

Suggested by aid workers & 1 PA.
Reasoning: responsibility of Red Cross to clearly communicate all options.

COVID SHEET TO BE ADDED TEST IN STAGING SERVER TO TEST

Gulfaraz Rahman can you add the google sheet link & the link to the staging sever FOR Berkel van, Anne HERE so that she can play around with the content before ti goes live.

Berkel van, Anne please inform Nadiye Çakir which UN ICON need to be added to GIT hub so you can link them into your google sheet.

All pages have a staging sheet & every staging sheet is exactly the same as the production sheet

Is your feature request related to a problem? Please describe.
Not everyone is using the staging sheet correctly for the daily work.
For the training, the staging sheet for Covid-vaccinations couldn't be used because it wasn't the same.

Describe the solution you would like
All production sheets should have a staging sheet that is exactly the same.

Describe alternatives you have considered
None.

Additional context
n/a

ICON CONSISTENT SIZING AND PLACING

The sizes of the icons and the placement of the text and icon in the square buttons should stay as consistent as possible. In the image the CEA text is very high whereas the RCCE text is very low. Also the RCCE logo is very large in comparison to the RCC icon.

WhatsApp Image 2021-02-23 at 12 23 45 (1)

NOT ABLE TO COPY TEXT

ANNE SAYS: it is not possible to copy text out of helphulinformation on the computer and on the phone. This is not helpful because a lot of aid workers and PA want to copy the information to for example google maps or want to share information easily with others. Some weeks ago we where able to copy text. Can you please find out what happened and make copying able again?

ARABIC ALIGNMENT IN

user story need
As an end user who reads Arabic I need to read form right to left

Solution:
Align Arabic text to the rights in webapp. We tested it in google sheets by aligning to rights but it does not reflect in the webapp

GOOGLE SHEET
HIA APP ARABIC MISALIGNMENT

Add a button for feedback & link a Kobo form to it

Can we add a poll to helpfulinformation for MEAL? With the quesions:

  1. How helpful was the information on this website? [Can we work with smilys? Or numbers?]
  2. Was the information you needed correct? Please let us know and send a message to our [link to whatsapp] WhatsApp helpdesk.
  3. Was the information you needed missing? Yes/no, if yes, which organization?
  4. Do you have any other feedback for us?

High(er) search result in Google

What are the possibilities (without paying a lot of money) to have HIA come up higher as a Google search result?

Why?
We know from co-design sessions & User Tests that a lot of undocumented migrants use Google to find information.
Can the key words that they use (i.e. undocumented, without papers, health, asylum procedure, lawyer) be used more in HIA and would this help?

Remove the column offer name from all sheets

We have to fill in 'click here' in the column 'name' in 'offers'. For new colluagues of volunteers this is confusing. Can we change this?

Reason:
Offer name is always click here, so removing it to avoid having to keep filling it in.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.