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.

136 lines
3.7 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. # Running
  13. Create a .env file with the code below filled in.
  14. ```
  15. CLIENT_ID = <your_github_username>
  16. CLIENT_SECRET = <your_generated_personal_access>
  17. SESSION_SECRET = <any_string_you_want>
  18. PORT = <any_number>
  19. ```
  20. ```bash
  21. npm install
  22. ```
  23. ```bash
  24. node server.js
  25. ```
  26. # Contributing
  27. 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.
  28. # API Reference
  29. `GET https://github-graphs.com/api/friends/<username>`
  30. 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`.
  31. Example result:
  32. ```json
  33. [
  34. {
  35. "login": "jrtechs",
  36. "avatar_url": "https://avatars1.githubusercontent.com/u/13894625?s=460&v=4"
  37. }
  38. ]
  39. ```
  40. ---
  41. `GET https://github-graphs.com/api/repositories/<username>`
  42. Fetches `https://api.github.com/users/<username>/repos` and returns an array of the repositories `<username>` owns.
  43. Example result:
  44. ```json
  45. [
  46. {
  47. "name": "bash_manager",
  48. "created_at": "2017-09-27T14:38:01Z",
  49. "homepage": "",
  50. "description": "Python scripts I use to manage my ssh connections, drive mounts, and other bash related things. ",
  51. "language": "Python",
  52. "forks": 26,
  53. "watchers": 4,
  54. "open_issues_count": 7,
  55. "license": {
  56. "key": "mpl-2.0",
  57. "name": "Mozilla Public License 2.0",
  58. "spdx_id": "MPL-2.0",
  59. "url": "https://api.github.com/licenses/mpl-2.0",
  60. "node_id": "MDc6TGljZW5zZTE0"
  61. },
  62. "html_url": "https://github.com/jrtechs/bash_manager"
  63. }
  64. ]
  65. ```
  66. ---
  67. `GET https://github-graphs.com/api/org/users/<organization_name>`
  68. 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`.
  69. Example result:
  70. ```json
  71. [
  72. {
  73. "login": "jrtechs",
  74. "avatar_url": "https://avatars1.githubusercontent.com/u/13894625?s=460&v=4"
  75. }
  76. ]
  77. ```
  78. ---
  79. `GET https://github-graphs.com/api/org/repositories/<organization_name>`
  80. 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.
  81. Example result:
  82. ```json
  83. [
  84. {
  85. "name": "vue",
  86. "created_at": "2013-07-29T03:24:51Z",
  87. "homepage": "http://vuejs.org",
  88. "description": "🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.",
  89. "language": "JavaScript",
  90. "forks": 23228,
  91. "watchers": 154891,
  92. "open_issues_count": 419,
  93. "license": {
  94. "key": "mit",
  95. "name": "MIT License",
  96. "spdx_id": "MIT",
  97. "url": "https://api.github.com/licenses/mit",
  98. "node_id": "MDc6TGljZW5zZTEz"
  99. },
  100. "html_url": "https://github.com/vuejs/vue"
  101. }
  102. ]
  103. ```