Ok, this is a big pull request so I'll do a long explanation
The Routes
This work intends to improve UI of our URLs. Before we just had /graph/network and /organisation endpoints, which were hacky.
Now we have a flexible route schema /profile/<<organization_name>>/<<username>> which will allow us to present data at either the organisation level eg. /profile/my-organisation or the the organisation member level eg. /profile/my-organisation/member-one
At the moment these endpoints just return json which is better for development purposes, but eventually they should be text/html endpoints returning a view. Currently going to /profile/my-organisation/<<username>> will tell you whether that username is in the organisation or not. like this:
So far working with data in this project has been a pain because we haven't been storing the data we pull from Github's API. For complex network visualisations, we are making a number of API calls, and when I do it against the github.com/Zendesk organisation it takes fucking ages.
In this PR I've introduced models that should be able to handle all the core analytics we are interested in running. From now on when we want data, we should check our own DB first and if it's missing we then pull from the API and store it. Here are some of the important data access patterns we can now use:
org = Organization.find_by_name("Zendesk")
org.members.all # list of User records representing the members of "Zendesk" organisation
org.repositories
org.events
user = User.find_by_username("thundergolfer")
user.repositories
user.events
user.followers
user.following
user.organizations
repo = Repository.find_by_url("https://github.com/rmit-programming-club/network-vis")
repo.contributors.all # list of people who've worked on the project
repo.events
repo.owner # can be a user OR an organization
Description
Ok, this is a big pull request so I'll do a long explanation
The Routes
This work intends to improve UI of our URLs. Before we just had
/graph/network
and/organisation
endpoints, which were hacky.Now we have a flexible route schema
/profile/<<organization_name>>/<<username>>
which will allow us to present data at either the organisation level eg./profile/my-organisation
or the the organisation member level eg./profile/my-organisation/member-one
At the moment these endpoints just return
json
which is better for development purposes, but eventually they should betext/html
endpoints returning a view. Currently going to/profile/my-organisation/<<username>>
will tell you whether that username is in the organisation or not. like this:The models
So far working with data in this project has been a pain because we haven't been storing the data we pull from Github's API. For complex network visualisations, we are making a number of API calls, and when I do it against the
github.com/Zendesk
organisation it takes fucking ages.In this PR I've introduced models that should be able to handle all the core analytics we are interested in running. From now on when we want data, we should check our own DB first and if it's missing we then pull from the API and store it. Here are some of the important data access patterns we can now use: