Giter VIP home page Giter VIP logo

cra-claim-tax-benefits's Introduction

La version française suit.

Claim tax benefits / Déclaration de revenus pour un accès aux prestations

This is a demo of a service to make tax filing faster and easier for a preselected group of eligible low-income Canadians. This service was designed and developed by the Canadian Digital Service (CDS) in partnership with the Canada Revenue Agency (CRA).

CRA already has most of the information that tax-filers include in their returns. At the same time, low-confidence tax filers are very worried about making mistakes when submitting a tax return. Using this information, we aimed to design a service that provides a wizard-like tax filing experience: rather than requiring tax-filers to enter their information, the service presents information that the CRA already has, then asks tax-filers to confirm the information is correct.

Demo user 1 Demo user 2
Gabrielle Roy Monique Corriveau
A5G98S4K1 A5G98S4K3
540 739 869 435 073 143
09 09 1977 03 03 1947

While this repository is no longer actively maintained, the code is open and available for demonstration purposes or reuse. In addition to an end-to-end flow, it is an example of best-practice development for an API-driven, cloud-native frontend application.

Table of contents

Technical overview

The Claim Tax Benefits (CTB) application is a server-side express application using Pug templating on the server and schnazzy SCSS stylesheets. The application scaffolding comes from the express generator. It assumes the existence of a backend API (to receive user data) and a cloud database (for storing access codes), although both are stubbed out so the application can run in isolation for development purposes.

There is a record of the decision to go for Express, for posterity.

As mentioned in the introduction, the CTB application implements many recommended practices for a modern web service.

Use of third-party services

We use several third-party services for an improved development workflow and continuous security.

  • GitHub is a cloud-based service that stores our source code, tracks code changes and facilitates code reviews
  • GitHub Actions is a Continuous Integration and Deployment (CI/CD) service that allows us to test and deploy our code right from GitHub
    • CI/CD services abound, but we used GitHub Actions because it was easy to set up, and with its yml-based configuration it would be easy to move away from
  • Heroku is a fully-managed platform as a service. We use Heroku Review Apps to build disposable applications per pull request, facilitating code reviews.
  • Snyk is a software as a service product that scans through our dependencies for packages with known issues. It alerts us when a version of a package we’re using has a known exploit.
  • LGTM is a software as a service product for continuous security analysis. It analyzes each pull request for potential security vulnerabilities.

Automated tests

All new pull requests have a suite of automated tests run against them.

  • Jest: Unit tests to verify correct internal logic for components
  • ESLint: JavaScript linter that ensures uniform JS throughout the app
  • Cypress: End-to-end behaviour-driven tests that run through desired user flows
    • cypress-axe: We run an accessibility scan per page (using axe) to check for violations in the markup

Development workflow

Continuing development

A walkthrough on how to continue development on this project: whether your aim is to rebuild the service in a new technology or to develop and release this codebase specifically.

Getting started (npm)

npm is a javascript package manager. It downloads project dependencies and runs node applications.

npm will complain if you’re not on node version v10.15.0 or higher when you boot up the app.

.env file (optional)

It’s possible to bootstrap this application with no /.env file — but if you want one, go nuts.

Example `.env` file
# environment
NODE_ENV=development
PORT=4300

Build and run

Guess what? There is no build step. Just install the dependencies and run it.

Pretty slick. 😎

# install dependencies
npm install

# run application in 'dev' mode
npm run dev

# run application in 'prod' mode
npm start

The app should be running at http://localhost:3005/. With npm run dev, saving a file will restart the server automatically.

On a Mac, press Control + C to quit the running application.

Run with local postgres DB

The application can be run with a local postgres database (otherwise, it falls back on a JSON file).

To start the app in development mode, alongside the postgres db type docker-compose up

Docker Desktop already has compose included, but just in case, installation instructions for docker-compose can be found here

Run tests

# run unit tests
npm test

# run linting
npm run lint

# run end-to-end tests
npm run cypress
npm run cypress:cli # these don't open a browser

Using Cypress

Cypress is what we use to write our end-to-end tests. It can run in a browser or in headless mode (ie, on the command line) to step through one or more flows. By running our end-to-end tests frequently, we are making sure that new changes to the code don't break existing user journeys.

Using Docker

A docker container allows a developer to package up an application and all of its parts. This means we can build an app in any language, in any stack, and then run it anywhere — whether locally or on a server.

Build and run as a Docker container

# build an image locally
docker build -t claimtaxbenefits.azurecr.io/cra-claim-tax-benefits .

# run the container
docker run -it -p 3005:3005 claimtaxbenefits.azurecr.io/cra-claim-tax-benefits

The container should be running at http://localhost:3005/.

On a Mac, press Control + C to quit the running docker container.

Deploying the app

This application is deployed continuously using Github Actions.

However, it’s still a beta service so it might not be 100% reliable. If anything goes wrong, follow the manual deployment instructions.

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

Réclamation d’avantages fiscaux

L’application Réclamation d’avantages fiscaux n’est pas autonome et nécessite un niveau élevé d’intégration de la part de l’ARC. Ce produit extrait les données sur l’individu à partir de la base de données de l’ARC, puis les affiche au déclarant. La communication entre le produit et la base de données de l’ARC se fait par l’intermédiaire d’une interface de programmation d’application (API). Cette technologie permet à un système de communiquer avec un autre système.

Une fois que le déclarant s’est authentifié, l’API envoie les données à l’application. Celle-ci demande ensuite au déclarant de confirmer que l’information affichée est exacte. La déclaration de revenus est ensuite produite au moyen de l’API IMPÔTNET, c’est-à-dire la même que celle utilisée par les logiciels payants.

Étant donné que l’ARC utilise des technologies héritées, il existe un degré de risque. Ce risque est atténué par le fait que le produit en ligne est hébergé sur une technologie en nuage, de sorte qu’il est séparé de la base de données. Cette séparation nous a permis de réaliser plusieurs prototypes pour différentes versions, sans mettre en péril les données de l’ARC. Si le produit était devenu un service fonctionnel, nous aurions pu continuer à modifier le service en fonction des commentaires des utilisateurs.

Table des matières

Aperçu technique

L’application Réclamation d’avantages fiscaux (RAF) est une application express côté serveur qui utilise les langages Pug pour les gabarits et SCSS pour les feuilles de styles. L’échafaudage de l’application vient du générateur d’applications Express. Il suppose l’existence d’une API backend (qui reçoit les données de l’utilisateur) et d’une base de données infonuagique (qui stocke les codes d’accès), bien que tous deux soient simulés afin que l’application puisse fonctionner de façon isolée pour le développement.

Le compte-rendu de la décision d’opter pour Express (anglais seulement) est conservé pour la postérité.

Comme il est mentionné dans l’introduction, l’application RAF met en œuvre plusieurs pratiques recommandées pour le développement de services Web modernes.

Utilisation de services tiers

Nous utilisons plusieurs services tiers pour améliorer le déroulement du développement et de la sécurité continue.

  • GitHub est un service infonuagique qui stocke notre code source, suit les changements au code et facilite les revues de code.
  • Actions GitHub est un service d’intégration et de déploiement continus (CI/CD) qui nous permet de tester et déployer notre code directement à partir de GitHub
    • Il y a beaucoup de services CI/CD, mais nous avons choisi Actions GitHub car il est très facile à installer, et il serait facile de s’en départir en raison de sa configuration de base yml
  • Heroku est une plateforme comme service (PaaS) complètement gérée. Nous utilisons Review Apps de Heroku pour construire des applications jetables à chaque demande de tirage, ce qui facilite la revue de code.
  • Snyk est un logiciel comme service qui passe à travers nos dépendances pour voir s’il y a des problèmes. Nous recevons des alertes lorsque la version d’un progiciel a des vulnérabilités connues.
  • LGTM est un logiciel comme service qui effectue l’analyse continue de la sécurité. Il fait une analyse à chaque demande de tirage pour trouver les vulnérabilités de sécurité potentielles.

Tests automatisés

Chaque demande de tirage subit une suite de tests automatisés.

  • Jest : Tests unitaires servant à vérifier la logique interne des composants
  • ESLint : Linter JavaScript qui assure une uniformité du code JavaScript dans toute l’application
  • Cypress : Tests basés sur le comportement qui s’exécutent pour vérifier les étapes des parcours utilisateur
    • cypress-axe : Nous effectuons un balayage de chaque page afin de vérifier les violations d’accessibilité dans le code

Continuer le développement

Guide pour continuer le développement du produit : Ce guide est là pour vous aider si vous voulez reconstruire le service avec une nouvelle technologie ou si vous voulez développer et déployer le code.

Construire et exécuter l’application

Veuillez vous référer à la page README afin d’obtenir les instructions détaillées pour construire et exécuter l’application.

cra-claim-tax-benefits's People

Contributors

ayoajila avatar brdunfield avatar caycefischer avatar charlesmorin avatar eliseka avatar katedee avatar nmakuch avatar pcraig3 avatar sboisvert avatar

Stargazers

 avatar  avatar  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

cra-claim-tax-benefits's Issues

Please replace https://claim-tax-benefits.azurewebsites.net/login/code with:

Heading: Enter your personal security code

You can find your personal security code in the CRA letter about this new Claim Tax Benefits service.
For example: A5G98S4K1

Help with personal security code [Your code has 9-characters and you can find it on the CRA letter about the Claim Tax Benefits service. The letter has your name and address at the top. ]

Continue Cancel

https://claim-tax-benefits.azurewebsites.net/deductions/climate-action-incentive

Please replace heading "The Climate Action Incentive" with "Small and rural communities"

Please delete :The Climate Action Incentive (CAI) lowers the amount of tax you pay. And you may get money back from the CAI."

Please move "You live in a small and rural community if you don’t live in:" under the yes/no buttons
Please replace "You live in a small and rural community if you don't live in:" with "Check if you live in a small and rural community"

Then when you that link opens, please put "You live in a small and rural community if you live outside of:" and for the list of places that are not small and rural communities, please make this an alphabetical drop down list without commas, so it looks like this:

Barrie
Belleville
Brantford
Greater Toronto Area
Guelph
Hamilton
Kingston
Kitchener-Cambridge-Waterloo
London
Oshawa
Ottawa
Peterborough
St. Catharines-Niagara
Sudbury
Thunder Bay
Windsor

Thank you!

Please replace https://claim-tax-benefits.azurewebsites.net/confirmation

https://claim-tax-benefits.azurewebsites.net/confirmation

Please replace page with:
Heading: You have filed your 2018 taxes

Your 2018 filing number is 5H3P9IO5816

Give CRA this number if you need help or information. You can contact CRA by:

Phone: 1-800-959-8281
TTY: 1-800-665-0354

You can also get help at a free tax clinic. Visit canada.ca/taxes-help to find your nearest clinic.

Print summary of your 2018 tax return (blue button)

It is important to read your Notice of Assessment which shows:

  • That you filed taxes
  • If you will get benefits or money back
  • If you owe money to CRA

Download your 2018 notice of assessment (blue button)

Please replace https://claim-tax-benefits.azurewebsites.net/financial/income

https://claim-tax-benefits.azurewebsites.net/financial/income
Please replace page with:

Heading: Check your income information for the 2018 tax year

CRA has information about your 2018 income. Please check this information.
Later you will be able to enter more information to claim credits and deduct costs.

[@pcraig3 Please keep current table but change totals to include decimal points]

Is all of this information correct?
Yes
No
Continue Cancel

[@pcraig3 please remove note that pops up beside “No” answer]

Cookie settings don't seem to be being set 🙅‍♀️🍪

Using the Chrome network tab or using mozilla observatory, it keeps saying that the cookie settings aren't sticking.

I'm not really sure why and now I am out of time, let's be honest. I thought I was setting "same site", "secure", and "httponly" but it looks like they're not getting through.

I can't really figure out the issue, but either we should (a) set them, or (b) remove the code that appears to set them but actually doesn't.

Screenshot

Screen Shot 2019-08-09 at 6 30 30 PM

** Note this is for two different pages, page:/ https://claim-tax-benefits.azurewebsites.net/trillium/propertyTax and page/ https://claim-tax-benefits.azurewebsites.net/trillium/propertyTax/amount **

** Note this is for two different pages, page:/ https://claim-tax-benefits.azurewebsites.net/trillium/propertyTax and page/ https://claim-tax-benefits.azurewebsites.net/trillium/propertyTax/amount **

Please replace page with:
Heading: - Apply for OTB: property tax

Did you pay property tax for the place you lived most of 2018?
Continue Cancel

Next page
Heading - Enter your property tax payments to apply for OTB

The government might ask for your property tax receipts.

How much total property tax did you pay for the place you lived most of 2018?

Continue Cancel

https://claim-tax-benefits.azurewebsites.net/login/code

On this place under "Help with . . ." please replace
-Your code has 9-characters and you can find it on the CRA letter about the Claim Tax Benefits service. The letter has your name and address at the top.
with
-Your code has 9-characters and you can find it on the CRA Claim Tax Benefits letter. The letter has your name and address at the top.

  • Please make the example of the personal filing code all lower case

/start - Please replace this page with :

Heading: Claim Tax Benefits
[blue highlight] [The Canada Revenue Agency (CRA) sent you a letter about the new Claim Tax Benefits service. You need information on that letter to use this service.

You may be able to file your 2018 taxes and claim tax benefits with this online service. You can use this service if Ontario was your home province on December 31, 2018. Your income for the 2018 tax year must be under $35,000, and:

  • Come from your salary, pension, Registered Retirement Savings Plan (RRSP), or benefits such as social assistance.
    -May include up to $1,000 of interest income. The interest must come from Canadian sources, such as a bank or savings account.
  • Cannot come from your own business or working for yourself.

You will need your:

  • personal security code. You can find this code in the CRA letter about this new Claim Tax Benefits service.
  • social insurance number (SIN)
  • income information

Start now

https://claim-tax-benefits.azurewebsites.net/deductions/donations

Please replace heading with "Charitable donations"

Please replace "You can enter any donations from the last five that you didn't already deduct from your taxes." with "You can enter any donations from the last five that you didn't already include in your taxes."

Thanks!

Please replace page with https://claim-tax-benefits.azurewebsites.net/deductions/climate-action-incentive

https://claim-tax-benefits.azurewebsites.net/deductions/climate-action-incentive
Please replace page with:
Heading: The Climate Action Incentive
The Climate Action Incentive (CAI) lowers the amount of tax you pay. It could also increase the money you get back from filing taxes.

Your CAI is greater if you live in a small and rural community.[@pcraig3 Please move the blue question and drop down up here, and give the cities in as a list rather than in paragraph form: How do I know if I live in a small and rural community?
You live in a small and rural community if you don’t live in:

Barrie
Belleville
Brantford
Greater Toronto Area
Guelph
Hamilton
Kingston
Kitchener-Cambridge-Waterloo
London
Oshawa
Ottawa
Peterborough
St. Catharines-Niagara
Sudbury
Thunder Bay
Windsor]

Did you live in a small and rural community in 2018?
Yes
No
Continue Cancel

Please replace https://claim-tax-benefits.azurewebsites.net/deductions/medical

Please replace page with

Heading - Claim medical expenses

Your taxes may be lower if your provincial health plan, work or private insurance didn’t cover all your medical costs or expenses.

Examples of medical costs are:

  • Treatment by a medical doctor, nurse or dentist
  • Prescription medicine
  • Prescription glasses, hearing aids, wheelchairs, crutches and similar items
  • Some service animal costs
  • Some travel expenses for medical treatment

You may be able to enter medical costs for yourself and your children. You may also be able to enter costs for your partner by marriage or common-law, and their children.

To include a child’s medical costs, the child must have been under 18 on December 31, 2018, and:

  • Depended on you for support for example, with food, shelter, clothing
  • You or your partner must have had sole custody of the child

You may still be able to claim a child’s medical expenses, even if you or your partner didn’t have sole custody. Contact CRA to learn more. [button to link to CRA contact info]

Were your medical costs over X?
Yes
No

Continue Cancel

@pcraig3 X is a numerical value (X = Net income / 3% calculated on the back-end of the service, based on their net income on file)

Please make the following changes to https://claim-tax-benefits.azurewebsites.net/review

https://claim-tax-benefits.azurewebsites.net/review
Please replace first two paragraphs with:

Based on your information, below are tax benefits, and money you will get back from your 2018 taxes. Please check this information. If something looks wrong, contact CRA before you file at:

  • Phone: 1-800-959-8281

  • TTY: 1-800-665-0354

Please replace “Your annual benefits” with “Your 2018 tax benefits”
Please replace “Your projected refund” with “Your expected refund”

Please replace "I confirm that" with "As far as I know, everything in this tax return is correct:"

Please replace "Submit" with "File my taxes now"

Please replace https://claim-tax-benefits.azurewebsites.net/deductions/medical/amount

Please replace page with
Heading -
Enter medical costs

Enter total medical costs for:

  • Yourself

  • Your marriage or common law partner

  • You or your partner’s children, if you are able to claim their costs [@pcraig3 Please hyperlink "if you are able" to https://claim-tax-benefits.azurewebsites.net/deductions/medical specifically the section that begins with "To include a child's medical costs. . ."]

If you have questions about medical costs, contact CRA:

  • Phone: 1-800-959-8281

  • TTY: 1-800-665-0354

Please replace https://claim-tax-benefits.azurewebsites.net/trillium/longTermCare/amount

Please replace page with:
Heading: Apply for OTB: long-term care home costs

You may live in a long-term care home or facility if costs such as nursing or personal support are combined with your rent. The home must be public or non-profit. This means that a charity, city, First Nations, or similar organization manages the home.

Did you live in a long-term care home in 2018?

Yes
No

Continue Cancel

** Note : this is for two different pages, page:/ https://claim-tax-benefits.azurewebsites.net/trillium/rent and page:/ https://claim-tax-benefits.azurewebsites.net/trillium/rent/**amount

** Note : this is for two different pages, page:/ https://claim-tax-benefits.azurewebsites.net/trillium/rent and page:/ https://claim-tax-benefits.azurewebsites.net/trillium/rent/**amount

Please replace with several new pages:

New Page
Heading: The Ontario Trillium Benefit
The Ontario Trillium Benefit (OTB) is a government payment that helps with energy, sales and property taxes. You can learn about the OTB at https://www.canada.ca/en/revenue-agency/services/child-family-benefits/provincial-territorial-programs/ontario-trillium-benefit-questions-answers.html

Apply for OTB on the pages that follow.

Continue Cancel

New Page

Heading: Apply for OTB:rent payments

Did you pay rent for the place you lived most of 2018?

Yes
No

Continue Cancel

New Page
Heading:
Enter your rent payments to apply for OTB

The government might ask for your rent receipts.

How much total rent did you pay for the place you lived most of 2018?

Continue Cancel

https://claim-tax-benefits.azurewebsites.net/login/sin

Please replace
"Thanks, Gabrielle Roy!" with " Gabrielle, thanks for your filing code."

Please change every instance of "Social Insurance Number" to "Social insurance number"

On this page under "Help" please replace the word "correspondence" with the word "mail"
Thanks!

Purpose of 'Confirm your most recent benefit payment' step is confusing

It is not clear from the title of 'Confirm your most recent benefit payment' what the purpose of this step is in relation to the 'Change your mailing address' request.

Don't rely on users reading the explanatory text below. Clarify purpose of https://claim-tax-benefits.azurewebsites.net/login/auth?redirect=%2Fpersonal%2Faddress%2Fedit step using the H1. For example, 'Confirm your most recent benefit payment to change address' or 'for verification'.

Please replace https://claim-tax-benefits.azurewebsites.net/deductions/donations

https://claim-tax-benefits.azurewebsites.net/deductions/donations

Please replace page with

Heading - Deduct charitable donations

Your taxes may be lower if you gave money to a charity or similar organization. You will need an official tax receipt. The charity or organization must be registered with the government to give the receipt. You can enter any donations from the last five that you didn't already deduct from your taxes.

Do you have tax receipts for charitable donations?
Yes
No

Continue Cancel

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.