Coder Social home page Coder Social logo

cds-snc / c19-benefits-node Goto Github PK

View Code? Open in Web Editor NEW
2.0 23.0 4.0 4.8 MB

Answer some questions to find which federal programs can help you https://covid-benefits.alpha.canada.ca/. - Répondez à quelques questions pour trouver quels programmes d’aide financière fédéraux s’offrent à vous https://covid-prestations.alpha.canada.ca/.

License: MIT License

JavaScript 50.09% Dockerfile 0.10% HTML 0.02% HCL 4.92% Shell 0.60% SCSS 9.24% Nunjucks 34.45% Mustache 0.60%
c-19-benefits-finder alpha esdc cppd

c19-benefits-node's Introduction

This repo is archived. Please use https://github.com/DTS-STN/c19-benefits-node instead.

La version française suit.

Find financial help during COVID-19

COVID-19 has had a severe financial impact on people living in Canada. The benefit landscape is hard to navigate and is changing quickly.

This product helps Canadians:

  • Find existing and new individual benefits relevant to COVID-19,
  • Anonymously answer a few simple questions to get a personalized list of benefits that could help them, and,
  • Calculate how much financial assistance may be coming their way, and when, so they can plan accordingly.

Explore it here: https://covid-benefits.alpha.canada.ca.

Benefits and help included:

  • Canada Emergency Response Benefit
  • Canada Emergency Student Benefit (CESB)
  • Work-Sharing
  • Mortgage support
  • Provincial help for renters
  • Suspending repayment and interest on student and apprentice loans
  • Canada Child Benefit
  • One-time payments for OAS and GIS recipients
  • Reduced minimum withdrawals for Registered Retirement Income Funds
  • Financial aid for 2021 school year
  • GST tax credit

This product is updated frequently. Notable updates are captured in the changelog.

Built with

This project is based on the CDS Node Starter and is built with:

  • Node.js >= 10.x
  • Express web framework
  • Nunjucks view templates
  • Sass (Syntactically Awesome Style Sheets) for reusable styles
  • Tailwindcss a utility-first css framework for rapidly building custom designs
  • PostCSS
  • PurgeCSS

Running locally

Clone this repository

git clone https://github.com/cds-snc/c19-benefits-node.git

Install dependencies

cd c19-benefits-node
npm i

Run in development mode:

npm run dev

Browse application on http://localhost:3000

Configuration

There are some environment variables that can optionally be configured. You can see a list in .env.example.

Public vars

There is a .env.public file with a few non-sensitive environment variables. These can be kept in this file, or overridden by passing values through the runtime environment.

DOMAIN_EN=
DOMAIN_FR=
LAST_UPDATED=

DOMAIN_EN and DOMAIN_FR will be used by the language switcher to swap domains when changing languages. If not provided, language switching will only affect the url path.

LAST_UPDATED is used to display the Last Updated string on the Start screen.

Testing

There are Unit (Jest) and e2e (Cypress) tests available.

To run unit tests:

npm run test

To run Cypress tests:

npm run cypress:run:test

Feedback component

The feedback component can be configured to send results to either Notify or Airtable.

Notify integration

To send Feedback to an email address, you should configure the following environment variables:

NOTIFY_ENDPOINT=
NOTIFY_API_KEY=
FEEDBACK_EMAIL_TO=

Airtable integration

To send Feedback to an Airtable base, you should configure the following environment variables:

AIRTABLE_API_KEY=
AIRTABLE_BASE_ID=

Your airtable base should contain a table named Feedback with the following columns:

  • date
  • session
  • version
  • url
  • problems
  • language

Static Asset CDN

When deploying this to a production environment, you can optionally load static assets from a CDN. To do this, configure the CDN_PREFIX env variable. This should be the base url of the CDN where the assets are stored.

When referencing static assets (CSS, JS, images) in nunjucks templates, there is a helper available:

<img src="{{ asset('/img/sig-blk-en.svg') }}" alt="Government of Canada">

The asset() helper will return the path to the asset prefixed by the CDN_PREFIX if available, otherwise it will return a local path.

---------------------------------------------------------------------

Trouver de l’aide financière pendant la COVID-19

La COVID-19 a provoqué de graves répercussions financières sur la population canadienne. Les multiples programmes d’aide disponibles sont difficiles à naviguer et changent souvent et rapidement.

Ce produit permet aux canadiens:

  • De trouver les programmes d’aide récemment annoncés ou déjà existant pour les particuliers en lien à la COVID-19
  • De recevoir une liste pertinente et personnalisé de prestations pouvant les aider et
  • De prévoir le montant des prestations et le moment où ils recevront celles-ci, afin de mieux planifier leurs dépenses et obligations financières.

Consulter l’outil ici: https://covid-prestations.alpha.canada.ca.

Prestations et programmes d’aide compris:

  • Prestation canadienne d’urgence (PCU)
  • Prestation canadienne d'urgence pour les étudiants (PCUE)
  • Travail partagé
  • Soutien hypothécaire
  • Aide provinciale pour les locataires
  • Suspension du remboursement des prêts d'études et aux apprentis et des intérêts applicables
  • Allocation canadienne pour enfants
  • Paiement unique pour les personnes reçevant la pension SV et le SRG
  • Réduction du retrait minimal des FERR
  • Aide financière aux études pour l’année scolaire 2021
  • Crédit pour la TPS

Ce produit est mis-à-jour fréquemment. Les changements majeurs apparaissent dans le journal des modifications (anglais seulement).

Contributions

Ce projet est conçu sur la base CDS Node Starter et utilise les contributions suivantes :

  • Node.js >= 10.x
  • Environnement Web Express
  • Gabarits Nunjucks
  • Feuilles de styles Sass (Syntactically Awesome Style Sheets)
  • Tailwindcss un environnement CSS modulaire accélérant la conception de pages web
  • PostCSS
  • PurgeCSS

Exécuter localement

Cloner ce référentiel

git clone https://github.com/cds-snc/c19-benefits-node.git

Installer les dépendances

cd c19-benefits-node
npm i

Exécuter en mode développement

npm run dev

Accéder à l’application au http://localhost:3000

Configuration

Certaines valeurs d'environnement peuvent être configurés. Cette étape est optionnelle. Consultez la liste des valeurs disponibles dans .env.example.

Variables publiques

Le fichier .env.public contient des variables d’environnement non-confidentielles. Ces valeurs peuvent être laissées telles-qu’elles, ou écrasées par par les variables d'environnement à l’exécution.

DOMAIN_EN=
DOMAIN_FR=
LAST_UPDATED=

DOMAIN_EN et DOMAIN_FR sont employées par le commutateur de langue afin d’échanger les domaines lorsque la langue passe du français à l’anglais, ou vice-versa. Si aucune valeur n’est donnée, le commutateur de langue n’affectera que le chemin de l’URL.

LAST_UPDATED est employée pour afficher la valeur Last Updated sur l’écran du début.

Tests

Des test unitaires (Jest) et bout-à-bout (e2e Cypress) sont disponibles.

Pour exécuter les tests :

npm run test

Pour exécuter les tests Cypress :

npm run cypress:run:test

Composant de rétroaction

Le module de rétroaction peut être configuré pour être envoyé par Notify ou Airtable.

Intégration avec Notify

Pour envoyer la rétroaction à une adresse courriel, vous devez configurer les variables suivantes :

NOTIFY_ENDPOINT=
NOTIFY_API_KEY=
FEEDBACK_EMAIL_TO=

Intégration avec Airtable

Pour envoyer la rétroaction à une base Airtable, vous devez configurer les variables suivantes :

AIRTABLE_API_KEY=
AIRTABLE_BASE_ID=

Votre base Airtable devrait contenir une table nommée Feedback avec les colonnes suivantes :

  • date
  • session
  • version
  • url
  • problems
  • language

Ressource statiques servies par réseau de diffusion de contenu (CDN)

Lors du déploiement vers un environnement de production, vous pouvez optionnellement charger les ressources statiques à partir d’un CDN. Pour ce faire, vous devez configurer la variable d’environnement CDN_PREFIX Celle-ci devrait être l’url de base du CDN où cette ressource est est stockée.

Pour lier des ressources statiques (CSS, JS, images) dans les gabarits nunjucks, vous pouvez utiliser la fonction d’aide suivante :

<img src="{{ asset('/img/sig-blk-en.svg') }}" alt="Government of Canada">

La fonction d’aide asset() renvoie le chemin de ressources statiques définie par CDN_PREFIX,ou le chemin local si cette variable n’est pas définie.

c19-benefits-node's People

Contributors

antoineaugusti avatar ben851 avatar calvinrodo avatar dsamojlenko avatar ericdube avatar jeffmaher avatar jneen avatar katedee avatar khalidelaggan avatar maxneuvians avatar pcraig3 avatar sastels avatar sboisvert avatar smcmurtry avatar snyk-bot avatar timarney avatar var-kyle avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

c19-benefits-node's Issues

WxT it

  • Import WxT? (possible issues with stylesheet collisions - particularly with the css resets)
  • or implement mandatory elements with Tailwind.

Refactor benefit-results.njk macro.

modify the "preamble" (Why did I call it that it's post not pre...), so that we don't have to have css and html in the localization file.

Spruce up the way back link works

As noted in #122 there are a few issues with the way back link is integrated. With out timeline, it works for now, but in the future, would be nice to find a better solution.

  • If they come in in the middle of the app, the link won’t show
  • If the session clears in the middle, it also won’t work
  • It’s not perfect on the first language toggle (but I’m hesitant to put a solution for this in place until #97 is worked out)
  • if a person errors, the referrer will become the same page

Cleanup schemas

All the schemas in our current code aren't relevant/don't apply to our forms + flow. Remove unneeded ones, and add just a simple one for our current questions (which at this time are just required).

Make sure that an appropriate error message is present as well.

Results Includes

Once PR #39 is merged, will need to enter final content for results includes:

  • CERB
  • EI Regular
  • EI Sickness
  • EI Workshare
  • CCB
  • Mortgage deferral
  • Rent help
  • Student loan
  • RRIF

Add Session ID to logs

Would like to be able to track a user through the service. To do that, could add some kind of identifier to the log output.

That identifier could perhaps be a session ID? a GUID? a hashed IP?

Infrastructure work to align with ESDC Requirements

Set default language by domain

We'll have two domains resolving to our service:

  • covid-benefits.alpha.canada.ca
  • covid-prestations.alpha.canada.ca

At minimum, users coming in on the French domain should default to french.

Additionally, we should probably also handle switching the subdomain when switching languages.

For discussion: what to do when the subdomain and url path don't match? ie, what to do if someone arrives at the url: https://covid-benefits.alpha.canada.ca/fr/debut?

  • Do we redirect to https://covid-benefits.alpha.canada.ca/en/start?
  • Do we redirect to https://covid-prestations.alpha.canada.ca/fr/debut?
  • Do we just render based on the uri? (so the domain only matters when entering, but after that just the URI matters)

Also: should we (can we?) remove the /en and /fr prefixes from uri's?

Render a build identifier in the footer

To help identify what build is currently deployed, display some sort of build identifier. We've done this in the past with a git hash.

This can either be displayed in the footer, or in a hidden comment in the page layout.

Add back button to question screens

See updated designs in Figma. There is a new "Back" button above the page title that returns the user to the previous question. (Can this just hook into the browser history?)

Implement Cancel link

See new designs in Figma. The Start Over link on Q pages gets moved down underneath the Next button. This is functionally the same.

Add Heading element to all Questions

See new designs in Figma. The Question is no longer the <h1> element, there is a new heading element on the page.

PR #113 removes the <h1> from the radios macro.

Routing on Question 2 needs to be corrected

Made the wrong assumption that retired folks go straight to RRIF, but it's just that the result is added for them, and so that needs to be amended so they still get asked about mortgage, etc.

Will double check the routing and add the changes while at it

Testing conveniences

Let's setup some conveniences for our testers:

  • Link/button to clear the session (building on #56 which adds a /clear route, let's make that link accessible for test facilitators - do we just tell them about the route? or add a link to the footer?)
  • Save session data at the end (do we just save automatically when they hit the results screen? Do we add a button for the facilitator to save the session? Make sure we save the session id, so we can query the path they took in the logs)

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.