Website for visualizing a persons github network.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

160 lines
4.8 KiB

5 years ago
4 years ago
  1. # Github-Graphs
  2. Website for visualizing a persons github network.
  3. ![Example Graph](./doc/graphExample.png)
  4. If you are lucky, you can find the site live [here](https://github-graphs.com/).
  5. ## Built With
  6. - [BootStrap](https://getbootstrap.com/)
  7. - [jQuery](https://jquery.com/)
  8. - [Vis JS](http://visjs.org/)
  9. - [Github v3 API](https://developer.github.com/v3/)
  10. - [Node.js](https://nodejs.org/en/)
  11. ![javascript](./doc/javaScript.jpg)
  12. ## Native Deployment
  13. The easiest way to get started with Github-Graphs is to fork this repository
  14. and follow the instructions below.
  15. #### Create a new OAuth app
  16. The objective of creating an app under your github account is to access an
  17. endpoint through the GitHub API and obtain credentials to set your environment
  18. file. For directives on how to create a new OAuth app, consult the corresponding
  19. Github developer documentation [here](https://developer.github.com/apps/building-oauth-apps/creating-an-oauth-app/).
  20. #### Create a .env file
  21. Setup your environment credentials by creating a `.env file` inside the folder
  22. `/server` with the code below filled in.
  23. ```
  24. CLIENT_ID = <your_client_ID_from_oauth_app>
  25. CLIENT_SECRET = <your_generated_personal_access_from_oauth_app>
  26. SESSION_SECRET = <any_string_you_want>
  27. PORT = <any_number>
  28. ```
  29. #### Install dependencies
  30. Dependencies are installed using `npm`. Therefore, please install the package manager
  31. before proceeding. If you already have `npm` installed, run the command below inside
  32. `/server` in order to install the dependencies in the package directory.
  33. ```bash
  34. npm install
  35. ```
  36. #### Activate GitHub-Graphs
  37. Inside `/server`, run the following command to start the program, and in your
  38. browser, check `localhost:8000` to visualize your Github network.
  39. ```bash
  40. node server.js
  41. ```
  42. ## Contributing
  43. We are very open to new contributors. If you want to contribute to this project, and don't know where to start, look at the [open issues](https://github.com/jrtechs/github-graphs/issues). Once you know what you want to work on, comment on the issue and file a pull request.
  44. ## API Reference
  45. `GET https://github-graphs.com/api/friends/<username>`
  46. Fetches `https://api.github.com/users/<username>/followers` [(GitHub Reference)](https://developer.github.com/v3/users/followers/#list-followers-of-a-user) and `https://api.github.com/users/<username>/following` [(GitHub Reference)](https://developer.github.com/v3/users/followers/#list-users-followed-by-another-user) to generate an array of users following `<username>` and that `<username>` follows each with values `login` and `avatar_url`.
  47. Example result:
  48. ```json
  49. [
  50. {
  51. "login": "jrtechs",
  52. "avatar_url": "https://avatars1.githubusercontent.com/u/13894625?s=460&v=4"
  53. }
  54. ]
  55. ```
  56. ---
  57. `GET https://github-graphs.com/api/repositories/<username>`
  58. Fetches `https://api.github.com/users/<username>/repos` and returns an array of the repositories `<username>` owns.
  59. Example result:
  60. ```json
  61. [
  62. {
  63. "name": "bash_manager",
  64. "created_at": "2017-09-27T14:38:01Z",
  65. "homepage": "",
  66. "description": "Python scripts I use to manage my ssh connections, drive mounts, and other bash related things. ",
  67. "language": "Python",
  68. "forks": 26,
  69. "watchers": 4,
  70. "open_issues_count": 7,
  71. "license": {
  72. "key": "mpl-2.0",
  73. "name": "Mozilla Public License 2.0",
  74. "spdx_id": "MPL-2.0",
  75. "url": "https://api.github.com/licenses/mpl-2.0",
  76. "node_id": "MDc6TGljZW5zZTE0"
  77. },
  78. "html_url": "https://github.com/jrtechs/bash_manager"
  79. }
  80. ]
  81. ```
  82. ---
  83. `GET https://github-graphs.com/api/org/users/<organization_name>`
  84. Fetches `https://api.github.com/orgs/<organization_name>/members` [(GitHub Reference)](https://developer.github.com/v3/orgs/members/#members-list) to generate an array of users that are in `<organization_name>` each with values `login` and `avatar_url`.
  85. Example result:
  86. ```json
  87. [
  88. {
  89. "login": "jrtechs",
  90. "avatar_url": "https://avatars1.githubusercontent.com/u/13894625?s=460&v=4"
  91. }
  92. ]
  93. ```
  94. ---
  95. `GET https://github-graphs.com/api/org/repositories/<organization_name>`
  96. Fetches `https://api.github.com/orgs/<organization_name>/repos` [(GitHub Reference)](https://developer.github.com/v3/repos/#list-organization-repositories) to return an array of repositories `<organization_name>` owns.
  97. Example result:
  98. ```json
  99. [
  100. {
  101. "name": "vue",
  102. "created_at": "2013-07-29T03:24:51Z",
  103. "homepage": "http://vuejs.org",
  104. "description": "🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.",
  105. "language": "JavaScript",
  106. "forks": 23228,
  107. "watchers": 154891,
  108. "open_issues_count": 419,
  109. "license": {
  110. "key": "mit",
  111. "name": "MIT License",
  112. "spdx_id": "MIT",
  113. "url": "https://api.github.com/licenses/mit",
  114. "node_id": "MDc6TGljZW5zZTEz"
  115. },
  116. "html_url": "https://github.com/vuejs/vue"
  117. }
  118. ]
  119. ```