{"id":21193070,"url":"https://github.com/govau/performance-dashboard","last_synced_at":"2025-07-10T03:32:16.515Z","repository":{"id":46873859,"uuid":"94490623","full_name":"govau/performance-dashboard","owner":"govau","description":"Performance Dashboard for Australian Government https://dashboard.gov.au","archived":false,"fork":false,"pushed_at":"2021-09-22T04:02:11.000Z","size":2194,"stargazers_count":14,"open_issues_count":7,"forks_count":4,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-04-14T07:47:07.669Z","etag":null,"topics":["australia","dashboard","dataviz","government","performance-dashboard","reporting"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/govau.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-06-16T00:52:22.000Z","updated_at":"2023-10-13T08:12:54.000Z","dependencies_parsed_at":"2022-09-13T20:01:39.080Z","dependency_job_id":null,"html_url":"https://github.com/govau/performance-dashboard","commit_stats":null,"previous_names":[],"tags_count":34,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/govau%2Fperformance-dashboard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/govau%2Fperformance-dashboard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/govau%2Fperformance-dashboard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/govau%2Fperformance-dashboard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/govau","download_url":"https://codeload.github.com/govau/performance-dashboard/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225615196,"owners_count":17496946,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["australia","dashboard","dataviz","government","performance-dashboard","reporting"],"created_at":"2024-11-20T19:13:03.960Z","updated_at":"2024-11-20T19:13:04.750Z","avatar_url":"https://github.com/govau.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dashboard\n\n\n[![CircleCI](https://circleci.com/gh/govau/performance-dashboard/tree/master.svg?style=svg)](https://circleci.com/gh/govau/performance-dashboard/tree/master)\n\n[![Code Climate](https://codeclimate.com/github/govau/performance-dashboard/badges/gpa.svg)](https://codeclimate.com/github/govau/performance-dashboard)\n\n[![Issue Count](https://codeclimate.com/github/govau/performance-dashboard/badges/issue_count.svg)](https://codeclimate.com/github/govau/performance-dashboard)\n\n[![Test Coverage](https://codeclimate.com/github/govau/performance-dashboard/badges/coverage.svg)](https://codeclimate.com/github/govau/performance-dashboard/coverage)\n\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\n\nVersion 3.0 of the Performance Dashboard.\n\nCurrently WIP.\n\n\n## Requirements\n\n - Ruby: see `.ruby-version`\n - Postgres 9.4\n - Node: see `package.json` \u003e `engines.node`\n - Yarn ^0.16.1\n - ImageMagick\n\n## Getting Started\n\n### Database\n\nThe default database config assumes you have installed Postgres via Homebrew.\nYou should need no further config.\n\nOtherwise, create a `.env` file in the Rails directory and populate with the relevant credentials.\n\n```\nDB_HOST = '127.0.0.1'\nDB_USER_NAME = 'dashboard'\nDB_PWD = 'password'\nGA_UA_CODE = 'UA-61222473-3'\n```\n\nIf you don't have Bundler installed\n```\ngem install bundler\n```\n\nInstall project gems, run\n```\nbundle install\n```\n\nTo create the database and load the schema\n```\nrake db:setup\n```\n\nMigrate the database\n\n```\nrake db:migrate\n```\n\nImport the dashboard data\n\n```\nrake import:data\n```\n\n(Optional) If you need to hard reset the database\n\n```\nrake db:drop db:create db:migrate import:data\n```\n\nCreate seed data for accessing the portal\n\n```\nrails db:seed\n```\n\nYou will now be able to login to the portal in the development environment with\n\n```\n:email =\u003e 'dev@localhost'\n:password =\u003e 'password'\n```\n\n### Run the App\n\nBefore running for the first time, run `yarn build` to generate the front end assets\n\nTo run on the default port (3000)\n```\nrails server\n```\n\nThe site can now be viewed at `http://localhost:3000/`\n\nAdministration is available at `http://localhost:3000/admin`\n\nThe editor is available at `http://localhost:3000/editor`\n\n### Mail\n\nTo test mail in development, we're using mailcatcher.\n\nOnce installed, mail can be viewed at\n[http://localhost:1080/](http://localhost:1080/)\n\n\n### Commiting to Git\n\nBefore hand:\n\nCommit messages follow commitizen standards: http://commitizen.github.io/cz-cli/\nAlthough this is optional, normal committing will still work.\n\n```\nyarn run commit\n```\n\nIf you want to shorthand this, you could install Commitizen globally following instructions here http://commitizen.github.io/cz-cli/ and ensure that your global \"path\" value matches \"config.commitizen.path\" in package.json.\n\n\n### Front end\n\n#### TLDR\n\n```\nyarn install\nyarn build\n```\n\n#### Getting started\n\nMake sure you have Yarn installed globally.  Refer to\nhttps://yarnpkg.com/en/docs/install.\n\nInstall the pipeline and all the project dependencies:\n\n```\nyarn install\n```\n\nBuild the assets\n\n```\nyarn build\n```\n\nThat's it.\n\n\n#### Need Develop mode?\n\nTo develop on assets, instead of just building them, toggle `DEV_SERVER = true`\ninside `/.env` and restart Rails. Then run the development server:\n\n```\nyarn run start\n```\n\nIt might be useful to also install these Chrome Extensions to help you work:\n\n* Redux Dev Tools:\nhttps://chrome.google.com/webstore/detail/redux-devtools/lmhkpmbekcpmknklioeibfkpmmfibljd?hl=en\n\nMore information here: http://zalmoxisus.github.io/redux-devtools-extension/\n\n\n* React Developer Tools:\nhttps://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi\n\n\n#### Run Frontend Test?\n\n```\nyarn run test\n```\n\nor singular like:\n\n```\nyarn run test:react -- datapointsReducer\n```\n\nset a debugger in test\n\n```\nNODE_ENV=test node --debug-brk --inspect ./node_modules/.bin/jest -i --runInBand --verbose --env=jsdom --watch\n```\n\n#### Issues with npm\n\n```\nrm -rf node_modules\nnpm cache clean\nyarn install\n```\n\n#### Point an npm module to a local directory like datavizkit\n\nDuring development, use a local copy of required dependencies rather than the npm dependency.\n\n\n1. Fork and clone the repository outside of performance-dashboard. like this:\n\n```\nSites\n├── datavizkit\n├── performance-dashboard\n└── react-uikit\n```\n\n2. Install [linklocal](https://github.com/timoxley/linklocal) as a global module\n`npm install -g linklocal`\n\n3. Navigate back to root of this project\n`$ cd performance-dashboard`\n\n3. Use linklocal to create sym links to the local directory\n`linklocal --named -r @gov.au/datavizkit datavizkit ../`\n\n4. Prove that it worked:\n`$ ls -al node_modules/@gov.au`\n\nshould see:\n`datavizkit -\u003e ../../../datavizkit`\n\n4. Unlink at any time\n`linklocal unlink -- datavizkit node_modules/@gov.au/datavizkit`\n`yarn add @gov.au/datavizkit`\n\n5. Update the linked package main file so it reads from dev source rather than from lib:\n\n`@gov.au/datavizkit/package.json`\n\nchange:\n\n```\n\"main\": \"lib/Datavizkit.js\"\n```\n\nto\n\n```\n\"main\": \"src/Datavizkit.js\"\n```\n\n(if you had been running build tasks, you will need to restart those).\n\n(be careful not to commit it :) )\n\n\n## Tests\n\n```\nbundle exec rspec\n```\n\nRun specs without the features (features use a browser and Capybara so can be much slower)\n\n```\nbundle exec rspec --exclude-pattern \"features/**\"\n```\n\nhttps://dashboard.gov.au/api/1/dashboards/1-mygov-dashboard\n\nYou can also use guard to run specs automatically on save with\n\n```\nbundle exec guard\n```\n\nWhen running under guard, it can be useful to isolate a specific test.\nThis can be achieved by using `:focus =\u003e true` on the desired spec.\n\n```\nit 'authenticates', :focus =\u003e true do\nend\n```\n\nRemember to NOT commit this as it will mean the test suite no longer runs all the tests.\n\nFor advice for writing specs check [betterspecs](http://betterspecs.org/).\n\n\n## Api documentation\n\nhttps://swaggerhub.com/api/dto/dto-dashboard/v1\n\n\n## High-level Development Process\n\n## TL;DR​\n\n1. Branch\n\n2. PR\n\n3. Review\n\n4. Merge\n\n\n\n### Branch Often.\n\n All work should be on a branch.\n\n Rebase long-living branches often (on master).\n\n\n ### Branch Naming Conventions\n\n For extra points name the branch to annotate the type of work and ticket number being resolved.\n ​\n Examples;\n ​\n\n - `fix/477-broken-redirects-for-guests`\n\n - `feature/502-new-cart-logo`\n\n - `ops/808-cloud-66-postgres-tweaks`\n\n ​\n\n #### Types of branches\n\n ​\n ```\n\n feature -\u003e feature\n\n fix     -\u003e fix\n\n ops     -\u003e infrastructure / ops related changes\n\n test    -\u003e adding missing tests\n\n tweak   -\u003e small changes, refactors\n\n doc     -\u003e documentation\n\n ```\n\n ## PR\n\n - Merges should be managed using a Pull Request\n\n - Before finishing a PR, rebase on master\n\n - Create the PR early and label as `WIP`\n\n### Feature flags\n\nWe use the [Flipper](https://github.com/jnunemaker/flipper) feature flags\nsystem to turn features on and off. Currently the features that can be toggled\nare `auth` (authentication) and `two_factor` (two-factor authentication).\n\nTo manage features, log in as an admin user and visit the `/flipper` path.\n\nNote that it is possible for an admin user to lock out all users (including\nhim/herself) by switching off the `auth` feature. To escape from this scenario,\nsimply add an environment variable `FORCE_AUTH_FEATURE` with any truthy\nvalue and restart the server. This will automatically switch the `auth` flag\nback on. (You then should remove the environment variable.)\n\n### Two Factor Authentication\n\nBy default, this is disabled in the development environment.\n\nTo enable, first ensure that an encryption key is present in your `.env` file\n(To generate an appropriately random string, you can use `rails secret`).\n\n```\nOTP_SECRET_ENCRYPTION_KEY={RANDOM_STRING}\n```\n\nThen enable the `two_factor` flag (for everyone) using Flipper (see the\n'Feature flags' section above).\n\nYou can also Flipper to disable two-factor authentication.\n\n### Rebasing\n\nRebasing before merging a PR ensures a clean commit history, please see [Merging vs Rebasing](https://www.atlassian.com/git/tutorials/merging-vs-rebasing/) for more details.\n\nIf rebasing often, its a good idea to use `rerere`, see:\n[Fix conflicts only once with git rerere](https://medium.com/@porteneuve/fix-conflicts-only-once-with-git-rerere-7d116b2cec67)\n\nIf your branch is long-lived (longer than a day on an active codebase), its a good idea to periodically rebase so you are actively tracking changes in master. This makes merge conflicts 1) less likely and 2) smaller and easier to deal with.\n\nMerge conflicts need to be carefully resolved as part of the rebase process. A tool like git-tower can be useful.\n\n\n\n### Review\n\n\n - At least one other person should review the PR before merge.\n\n - A review should ideally involve actually checking out and running the code, and sanity checking it before merge.\n\n - Close any related issues​ in Jira\n\n\n### Coding Standard/s\n\n[Ruby Style Guide](https://github.com/bbatsov/ruby-style-guide)\n\n\n## Environments\n- [Sandbox](https://dashboard-sandbox.apps.y.cld.gov.au/)\n- [Staging](https://dashboard-staging.apps.y.cld.gov.au/)\n- [Production](https://dashboard.gov.au/)\n- [Style Guide](http://performance-dashboard-ui.surge.sh/)\n\n\n## Deployment\n\nCircle CI will deploy automatically once tests have passed:\n\n  - Staging tracks the `master` branch\n  - Production tracks tags in the form `rel-{timestamp}`\n\nNote: for non-production servers, there is a bunch of JSON data\n(see `lib/data/*.json`) that is used to populate the dashboards on every\ndeployment. On production, use the editor to add new data to dashboards, or\nuse the import function in the admin section to create new dashboards via JSON.\n\n## CloudFoundry\n\nThe environment variables for our CloudFoundry instances are managed using a\nUser Provided Service. If you want to add, remove or change an environment\nvariable, use the `cf update-service` command. For production, you will want to\nmanage the `dashboard-ups` service; for non-prod servers, use the\n`dashboard-staging` service. See the CloudFoundry CLI documentation for more\ndetails: http://docs.cloudfoundry.org/cf-cli/\n\nNote that if you want to deploy your own instances manually, you will need to\nspecify the `manifest-staging.yml` manifest, e.g.:\n\n```\ncf push dashboard-ad-hoc -f manifest-staging.yml\n```\n\n### Production\n\nTo tag a release for deployment to production:\n\n```\ngit tag `date \"+release-%Y%m%d%H%M%S\"` \u0026\u0026 git push --tags\n```\n\n#### Rollback\n\nIf an error occurs or the release needs to be rolled back for any reason, the simplest way is to tag a new release from the last release.\n\nFor example, given two releases `release-20160101` and `release-20160102`.\n\nIf we decide to roll back to the earlier release, we would simply:\n\n```\ngit checkout -b release-20160101\ngit tag `date \"+release-%Y%m%d%H%M%S\"` \u0026\u0026 git push --tags\n```\n\nThe checkout will create a new branch from the tag, which can be useful for diagnosing regression errors.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgovau%2Fperformance-dashboard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgovau%2Fperformance-dashboard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgovau%2Fperformance-dashboard/lists"}