GitHub shows anyone with push access to a repository its traffic from the past two weeks. You want to monitor the traffic beyond that time? Automatically fetch and persist your traffic on a regular basis and plot the data onto a chart.
This app is based on Laravel 5.5 and has the same requirements.
First, clone the application:
git clone https://github.com/M165437/gh-traffic.git
Next, install its dependencies:
composer install
npm install
Finally, compile its assets:
npm run production
Copy the .env.example
to .env
and configure its variables. At the very least, you need to update your database credentials, your GitHub API key and the repository you want to monitor.
GITHUB_API_TOKEN=valid-personal-access-token
REPOSITORY_OWNER=m165437
REPOSITORY_NAME=gh-traffic
Use Artisan to set your application key to a random string:
php artisan key:generate
For the automatic fetching and persistance of traffic data, you need to add the following Cron entry to your server:
* * * * * php /path-to-this-app/artisan schedule:run >> /dev/null 2>&1
Visit this app's root domain /
to see the chart.
Run the tests with:
vendor/bin/phpunit
Thank you for considering contributing to this project! Please see CONTRIBUTING for details.
This app is licensed under the MIT License (MIT). Please see the LICENCE file for more information.