Skip to content

textbook/salary-stats

Repository files navigation

Salary Statistics

Analyse and compare salaries by cohort.

Build Status Coverage Status License Codacy Grade Docker Image

Usage

This tool is very simple to use. You can add as many people, in as many different cohorts, as you like. Each person can be added by entering their details in the inputs in the table footer and either clicking the Add button or hitting Enter. The cohort is simply a string identifying the cohort, for example by job title or year of starting.

You can delete a single person at a time or everyone at once. In the former case, if the inputs are empty when you choose to delete a person, they are filled in with that person's details. This makes it harder to accidentally lose data and means you can easily "edit" someone by deleting them, modifying the inputs and submitting them again. In the latter case a warning appears asking for confirmation, as this cannot be undone.

As you add and remove people, the comparison chart is automatically updated. The box plot shows five values: the central box is the upper and lower quartiles and the median; and the outer "fences" are set at the quartiles plus or minus 1.5 times the interquartile range. Any value outside the fences is considered an outlier and is shown separately.

Deployment

If you're using this to look at real salary data, you don't want to be sharing it. All analysis happens in your local browser, nothing gets sent to any backend. If you'd prefer to run your own instance, though, you can easily do so either:

  1. Without downloading the code:

    • Heroku - click the button below:

      Deploy

    • Any web server - download the build output from the latest release and serve it

    • Docker - deploy the image textbook/salary-stats

  2. By downloading the code (e.g. clone the repository) you can deploy to:

    • Cloud Foundry - install the CF CLI and run cf push

    • Heroku - install the Heroku CLI and git push heroku main, but you will need to manually set up the buildpacks on the app:

      heroku buildpacks:clear
      heroku buildpacks:add heroku/nodejs
      heroku buildpacks:add https://github.com/heroku/heroku-buildpack-static
    • Any web server - build locally and serve the content of dist/

Development

You will need to clone the repository. It uses the Angular CLI, so start off by running:

npm install -g @angular/cli
cd [repo directory]
npm install  # or npm ci

From there you can run it for local testing/development with:

npm run start

and visit the site at http://localhost:4200. The following commands are also available:

  • npm run lint - run ESLint on the *.ts files
  • npm run test - run the Karma unit tests (use test:watch to re-run every time something changes)
  • npm run e2e - run the Protractor end-to-end tests
  • npm run build - create the production build in dist/

Both sets of tests are configured to run using the Chrome browser headlessly, so you won't see anything pop up on your screen.