Skip to content

Automatically fetch and persist GitHub repository traffic data

License

Notifications You must be signed in to change notification settings

M165437/gh-traffic

Repository files navigation

GitHub Traffic - beyond 14 days

GitHub release Unstable License Twitter

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.

Installation

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

Configuration

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

Chart

Visit this app's root domain / to see the chart.

GitHubTraffic

Testing

Run the tests with:

vendor/bin/phpunit

Contributing

Thank you for considering contributing to this project! Please see CONTRIBUTING for details.

License

This app is licensed under the MIT License (MIT). Please see the LICENCE file for more information.

About

Automatically fetch and persist GitHub repository traffic data

Resources

License

Stars

Watchers

Forks

Packages

No packages published