{"id":20115559,"url":"https://github.com/mutualmobile/clover-reporting","last_synced_at":"2026-02-06T05:31:02.538Z","repository":{"id":11723313,"uuid":"14245148","full_name":"mutualmobile/clover-reporting","owner":"mutualmobile","description":"A reporting tool using the Clover REST API","archived":false,"fork":false,"pushed_at":"2016-07-27T16:10:43.000Z","size":14930,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":25,"default_branch":"master","last_synced_at":"2025-07-20T12:24:48.548Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HTML","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/mutualmobile.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":"2013-11-08T21:46:11.000Z","updated_at":"2017-09-25T03:40:03.000Z","dependencies_parsed_at":"2022-09-23T01:20:43.575Z","dependency_job_id":null,"html_url":"https://github.com/mutualmobile/clover-reporting","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mutualmobile/clover-reporting","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mutualmobile%2Fclover-reporting","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mutualmobile%2Fclover-reporting/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mutualmobile%2Fclover-reporting/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mutualmobile%2Fclover-reporting/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mutualmobile","download_url":"https://codeload.github.com/mutualmobile/clover-reporting/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mutualmobile%2Fclover-reporting/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29152426,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-06T02:39:25.012Z","status":"ssl_error","status_checked_at":"2026-02-06T02:37:22.784Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2024-11-13T18:35:39.543Z","updated_at":"2026-02-06T05:31:02.518Z","avatar_url":"https://github.com/mutualmobile.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [Dashboard App](http://mutualmobile.github.io/clover-reporting)\n\nProviding real time performance information about your business, the Dashboard App for Clover POS gives you the metrics to manage your business from anywhere using your phone, tablet or computer.\n\n- Understand where your daily sales are hour by hour, throughout the week, or over the course of a month.\n\n- Review key sales metrics.\n\n- Drill into detail about how individual products are performing.\n\n- Use the employee leader board to have some friendly competition.\n\n\n## Application Overview\n\nThe Dashboard App is a responsive web app built using [Lavaca](http://getlavaca.com/#/#@0). For graphs and charts, it uses [nvd3](http://nvd3.org/). To facilitate development and manage third-party client-side dependencies, it leverages [Grunt](http://gruntjs.com/) and [Bower](https://github.com/bower/bower).\n\n### Clover API Integration\n\nAuthenticating with the Clover API is handled via OAuth. The returned `access_token` is stored in localStorage.\n\nAll of the metrics in the app are calculated via data obtained from the [GET /orders](https://www.clover.com/rest-api#GET /v2/merchant/{mId}/orders) API endpoint.\n\nWhen supported, all of the API requests and metric calculations are done in a Web Worker to reduce the work done on the main thread and keep the UI as responsive as possible. However, a fallback (using setTimeout to ensure consistent asynchronous behavior) is provided for browsers which do not support Web Workers.\n\nModules which wish to use the data obtained via the API endpoint can create a `DataHandle` via the global `DataHub` object. The returned `DataHandle` provides an interface allowing the module to register various operations such as `map`, `reduce`, `sort`, etc which will be executed in the Worker. A `DataHandle` also exposes a `done` method which can register a function that will be called (on the main thread) with the end result after processing all of the other registered operations.\n\nThe `/orders` endpoint is polled at regular intervals, and when the data changes, all active `DataHandle` instances will automatically re-run whatever operations they have registered, and then any `done` handles will be called.\n\n### Model Layer\n\n__Using Clover API Data__\n\nAll models which rely on data from the Clover API extend from `BaseDataModel` or `BaseDataCollection`. These classes encapsulate the creating of a `DataHandle` and disposing of it when the model is disposed. By default, whenever all of the registered dataOperations are finished, `BaseDataModel` sets the returned data to its `data` property and `BaseDataCollection`, which expects an array as the returned data, will apply the returned data to its models, performing any necessary `addItem`, `removeItem`, `moveItem`, and `changeItem` operations.\n\n__Handling the user-selected time range__\n\nBecause the app relies on one global interface element for selecting the current time range, there is always only one active time range. As such, the global `TimeRangeModel` instance is responsible for all handling of the current time range data. Any other module which needs to be aware of the current time range can obtain that information from the `TimeRangeModel`.\n\nWhenever the user changes the current time range, the `DataHub` is notified via an event triggered on the `TimeRangeModel` and it then notifies the worker to request new data. Whenever the new data is returned, all active `DataHandles` will process the new data and any models which extend from `BaseDataModel` or `BaseDataCollection` will be updated automatically.\n\n### View Layer\n\n__Views with a `BaseDataModel`-derived model__\n\nViews which rely on data from the Clover API (and thus rely on a model which extends from `BaseDataModel`) all extend from `BaseDataView`. `BaseDataView` calls it's `onDataChange` method whenever the `data` property on its model changes. Subclasses should overwrite the `onDataChange` method to perform any necessary operations, such as redrawing.\n\n__Handling charts/graphs__\n\nViews that use nvd3 to show a chart extend from `BaseChartView` (also a descendant of `BaseDataView`). `BaseChartView` exposes and calls certain methods which subclasses can override to create and update their charts as appropriate.\n\n - `createChart`- Called once when the view is created and should return an nvd3 chart object, which will be assigned to the `chart` property on the view\n - `updateChart`- Called whenever the data changes, or on window resize. Should apply the necessary data and any relevant style changes to the view's chart (accessed via `this.chart`).\n\n__Collection Views__\n\nThe Employees and Products pages display a ranked list of objects and share much of the same functionality via the `BaseCollectionView` class. This class is used with a `BaseDataCollection`-derived model and  automatically creates/removes/arranges child views for each item in its collection.\n\n\n## Getting Started\n\n### Installing Dependencies\n\n1. __Install NodeJS \u0026 NPM__\n\n    Installation instructions are available from [nodejs.org](http://nodejs.org/).\n\n1. __Install grunt-cli and Bower globally__\n\n    Note: this may require sudo\n\n        $ npm install -g grunt-cli\n        $ npm install -g bower\n\n1. __Install development dependencies and and external libraries__\n\n        $ cd [path/to/project/root]\n        $ npm install\n        $ bower install\n\n\n### Running Locally\n\nDuring development, you can run the default grunt task which will watch for any changes to `.less` files and\nrecompile the css as well as run a local server on port `8080`.\n\n    $ grunt\n\n\nYour application should now be running on `localhost:8080`.\n\n\n### Packaging for deployment\n\nTo package your app for deployment to a server, you can use the `build:[environment]` grunt command on the `master` branch. This task will:\n\n  - Compile and concatenate `less` files,\n  - Run the require.js optimizer and outputs a single javascript file, and\n  - Process the `index.html` file to make sure all `css/javascript/config` file references are updated.\n\n\nFor example, to build the app using the \"production.json\" config file, run:\n\n    $ grunt build:production\n\nAfter building, switch to the `gh-pages` branch, and copy `/build/www/js/app.min.js` to `/js/app.min.js` (overwrite). Changes pushed to the `gh-pages` branch are deployed to production.\n\n### Generating Documentation\n\nTo generate JavaScript documentation using [yuidoc](https://github.com/gruntjs/grunt-contrib-yuidoc), use the `yuidoc` grunt command. The resulting documentation is output to the `doc` folder.\n\n    $ grunt yuidoc\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmutualmobile%2Fclover-reporting","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmutualmobile%2Fclover-reporting","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmutualmobile%2Fclover-reporting/lists"}