CSC/ECE 517 Spring 2024 - G2402 Implement REST client, REST API, and Graphql API endpoint for repositories: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 56: Line 56:
==REST API Endpoints==
==REST API Endpoints==
Get current user login:
Get current user login:
  /api/rest/current-user-login
  /api/rest/current-user-login-rest
 
Get specific user login:
/api/rest/user-login/<username>


Get list of all commits in a repo:
Get list of all commits in a repo:
  /api/graphql/specific-user-commits/<owner>/<repo_name>
  /api/rest/specific-user-commits/<owner>/<repo_name>


Get details of all contributors in a repo:
Get details of all contributors in a repo:

Revision as of 04:04, 25 March 2024

GitHub Miner

This is a convenient tool to query a user's GitHub metrics.

  1. Installation

We recommend using virtual environment. Steps to setup virtual environment:

cd path/to/your/project/directory
python -m venv venv

On macOS and Linux:

source venv/bin/activate

On Windows (Command Prompt):

.\venv\Scripts\activate


On Windows (PowerShell):

.\venv\Scripts\Activate.ps1

Next, install all the necessary libraries:

pip -r requirements.txt

Next, set the PYTHONPATH to

On Windows

set PYTHONPATH=%PYTHONPATH%;path/to/your/project
set PYTHONPATH=%PYTHONPATH%;path/to/your/project/backend

On Unix or MacOS

export PYTHONPATH=$PYTHONPATH:/path/to/your/project
export PYTHONPATH=%PYTHONPATH%;path/to/your/project/backend

You can run the app from your terminal by executing the following command:

python backend\run.py


GraphQL Active Endpoints

Get current user login:

/api/graphql/current-user-login

Get specific user login:

/api/graphql/user-login/<username>

Get list of all commits in a repo:

/api/graphql/specific-user-commits/<owner>/<repo_name>

Get details of all contributors in a repo:

/api/graphql/repository-contributors/<owner>/<repo_name>
  1. Not working correctly

'/api/graphql/contributors-contribution/<owner>/<repo_name>/<id>'

REST API Endpoints

Get current user login:

/api/rest/current-user-login-rest

Get list of all commits in a repo:

/api/rest/specific-user-commits/<owner>/<repo_name>

Get details of all contributors in a repo:

/api/rest/repository-contributors/<owner>/<repo_name>
  1. Not working correctly

'/api/rest/contributors-contribution/<owner>/<repo_name>/<id>'