Skip to content

Joshua-Booth/calculate-tax

Repository files navigation

Calculate Tax

A PWA for calculating New Zealand personal tax.


Visit site · Documentation


Netlify Build Status GitHub package.json version Dependencies GitHub last commit


Developed by Joshua Booth



About | Requirements | Installation | Setup | Usage | Support | License


About

The problem

Existing NZ tax calculators haven't been designed with the user in mind. They often sacrifice UX for more features or have a poor UI design which negatively influences people's perception of the UX.

The solution

The goal of this progressive web app is have a minimal and easy to use interface for calculating tax on your personal income.

Check out the wiki for more information about this project.

Requirements

This project requires the following:

Other useful global dependencies

Installation

> git clone https://github.com/Joshua-Booth/calculate-tax.git   # Clone the repository

> cd calculate-tax     # Change into the 'calculate-tax' directory

> npm install   # Install all the project's dependencies

Ensure the NODE_ENV environment variable is either undefined or set to 'development' before installing dependencies.

Setup

Create three env files (.prod, .dev, .test) in an env directory in config.

> mkdir ./config/env
> cd ./config/env

> touch .prod .dev .test   # Windows: cd > .prod && cd > .dev && cd > .test

Add the following environment variables for development (.dev) and production (.prod):

Variable name Required Description
NODE_VERSION False This app's Node version (should be equal or greater than 14.16)
REACT_APP_ROOT_URL True Your API's URL (e.g. localhost:8000 for dev and https://api.example.com/ for prod)
REACT_APP_PUBLIC_URL True This app's public URL (e.g. localhost:8080/public for dev and https://example.com/public for prod)
REACT_APP_GA_TRACKING_ID False Google Analytics tracking id (e.g. UA-123456789-1)
REACT_APP_HOTJAR_SNIPPET_VERSION False Hotjar snippet version (Also called 'hjsv')
REACT_APP_HOTJAR_TRACKING_ID False Hotjar tracking id (Also called 'hjid')
REACT_APP_SENTRY_DSN False Sentry DSN

Usage

To use the application use the following commands:

Production

Run npm run build to build the static files for production.

Run npm start prod to serve the production files.

✨ Visit the site on the localhost URL.

Development

Run npm start dev to start the webpack dev server for the web app.

✨ Visit the site on the localhost URL.

Testing

> npm t                # Unit tests

> npm start test.it    # Integration tests

> npm start test.e2e   # End-to-end tests

> npm start coverage   # Full test coverage report (unit, integration and e2e combined)

npm t starts the unit tests in watch mode, but you can also set the environment variable CI to run the tests in continuous integration mode (this also works for integration and end-to-end tests).

Other

Run npm start help for a full list of available commands.

Support

Do you need some help? Check the out articles in the wiki.

Check the issues page to see if there is an open issue with a potential workaround.

Additional Support

Reach out to me for support through the following methods:

License

This project is the sole property of Joshua Booth.

Copyright © 2021 Joshua Booth

Please see individual licenses contained in the project where third-party code was used, as this code is owned by it's respective authors.