stargraph

command module
v0.0.0-...-20269af Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 16, 2018 License: MIT Imports: 7 Imported by: 0

README

Stargraph

The perfect tool to plot a chart of stars on Github repositories

Build Status Build Status Coverage Status

There is a CLI where you provide your Github API token via -t and the :username/:reponame via the -r parameters. If you don't have a Github API token, you will be restricted by the API to 60 calls per hours.

An example on how to use it:

stargraph -t githubtoken -r evermax/stargraph

To get the project, just do go get github.com/evermax/stargraph

The program will produce 3 files:

  • graph.png which contains the graph plotted with gonum/plot. It currently doesn't support date display so you will end up with Unix timestamp on the X-axis
  • canvasDB.json which contains graph data to be used with CanvasJS
  • jqplotDB.json which contains graph data to be used with jqplot

You can also now use the lib part of the project to get the timestamps of the stars on a repository as a []int64

Disclaimer

This tool only take the current stars on the repository and place them on a graph where their are placed by order of apparences. That is why it will never provide you with a shrinking graph/a graph going down.

It is still a funny way to see it the repo has a good growth. You just need to pay attention to the last star date.

Demo

I made a proof of concept for this project on Stargraph.co. You can there provide a Github API token or log in with Github and try it!

Stargraph structure

The structure of the website should be something like this:

Architecture

Where you have an API and a website talking to that API, asking for the backend to get the data for a Github repo. If the repo does exist it will return a ressource URL where the client should query periodically to know if the data is ready. Service job will then be triggered so that the data is fetched. Structure/behavior of the API

The services are divided in two: Creators and Updators. The creator will create a record in the database and get the data for the first time. The updator will check if there was any change in the stars, if not it will just leave the data as it is, if so it will update the data that are not correct. different services and setup for them

Each service should be a microservice using this very intersting post from codeship.

Contributions

Contributions to that project are more than welcome, especially... for everything! You are welcome to talk to me about it on Golang slack. (If there is a need for it, I might make a channel) Request an invite if you are not already on the channel.

Documentation

Overview

Package stargraph contains a program to get the stars and generate the graphs and data from command line. It is also the root package for the code for the stucture that carries the Stargraph API.

Directories

Path Synopsis
Package api holds the HTTP handler for the API and its configuration.
Package api holds the HTTP handler for the API and its configuration.
lib
mq
Package mq wrap the github.com/streadway/amqp library to be able to mock it.
Package mq wrap the github.com/streadway/amqp library to be able to mock it.
store/gestore
Package gestore contains the implementation of the store.Store interface for the Google Datastore.
Package gestore contains the implementation of the store.Store interface for the Google Datastore.
creator
Package creator contains the creator service that should create a new entry in the database for a github repo that is not already in there.
Package creator contains the creator service that should create a new entry in the database for a github repo that is not already in there.
pic
Package pic contains te code to be able to launch a picture service.
Package pic contains te code to be able to launch a picture service.
user
Package user contains the code to launch a user service The user service is responsible for pulling up user data and serving it to the frontend.
Package user contains the code to launch a user service The user service is responsible for pulling up user data and serving it to the frontend.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL