Skip to content

hussainweb/drupal-stats

Repository files navigation

DruStats

Software License

DruStats provides visualizations for a variety of data obtained using the drupal.org API. This was built for a developer contest organized by Azri Solutions at DrupalCon Asia 2016. As per the contest rules, only data from drupal.org API is used to build the visualizations.

Usage

See installation section for detailed instructions on installing this application.

Once installed, the website may be used as any other web application directly from the browser. With a clean database, the software will not be able to show any visualizations. PHP CLI (with Laravel Artisan) is used to initiate commands that queue requests for retrieving data.

These are the commands provided by this application to queue requests.

php artisan dsget:nodes {type}
php artisan dsget:cijobs
php artisan dsget:users
php artisan dsget:terms
php artisan dsupdate:nodes {type}
php artisan dsupdate:cijobs

All the dsget commands have the following options.

--page={page} --sort={field} --direction={ASC|DESC}

All dsget commands start at the specified page (defaults to 0) and continue accessing the subsequent pages until it reaches the end. This is only required for initial setup or if you want to reset all data in the database. Normally, you would use dsupdate commands to retrieve fresh content.

Schedule updates

The application adds schedules to run various update commands at daily intervals at different times. A single cron job is required to allow Laravel to run this schedule.

* * * * * php /path/to/artisan schedule:run

See Laravel's documentation for more details.

Requirements

The application needs the following software to run.

  • PHP 5.5.9 (tested only on PHP 7)
  • MongoDB 3.2
  • PHP MongoDB extension
  • Beanstalkd (the application would work without this but would not be able to update the database)
  • Any web server that can work with PHP

To use the application, the following software is needed.

  • Any modern browser (IE9+, Chrome, Firefox)
  • Javascript to view the visualizations

Development Requirements

To develop with this application, the following software is needed in addition to the above requirements.

  • Composer
  • Node.js (with npm)
  • Gulp

Installation

These are the software components and libraries required to use DruStats.

Clone this repository and run the following command in the directory.

$ git clone https://github.com/hussainweb/drupal-stats.git
$ cd drupal-stats/
$ composer install

Once composer installs the framework and other required libraries, run the migrations to setup the database. Currently, only indexes are created and the migrations are not strictily necessary for the working but it is recommended to migrate anyway.

$ php artisan migrate

The application is now ready for use and only needs data. Refer to the usage section to see how to start retrieving data from d.o. It might be a good idea to start with a database dump rather than retrieving the whole data yourself. Contact me for a database dump.

License

This application is open-sourced software licensed under the GPLv2 license.

Third Party Components

This application is built using Laravel and many languages and technologies. It also uses data from various sources and the licenses are mentioned on a best-effort basis. All these licenses permit usage of these libraries or data for the purpose of this application and the license is preserved.