<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.expertiza.ncsu.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Slimbur</id>
	<title>Expertiza_Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.expertiza.ncsu.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Slimbur"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Slimbur"/>
	<updated>2026-05-22T01:19:55Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_G2402_Implement_REST_client,_REST_API,_and_Graphql_API_endpoint_for_repositories_-_Part_2&amp;diff=156964</id>
		<title>CSC/ECE 517 Spring 2024 - G2402 Implement REST client, REST API, and Graphql API endpoint for repositories - Part 2</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_G2402_Implement_REST_client,_REST_API,_and_Graphql_API_endpoint_for_repositories_-_Part_2&amp;diff=156964"/>
		<updated>2024-04-29T16:19:54Z</updated>

		<summary type="html">&lt;p&gt;Slimbur: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
== Project Objective ==&lt;br /&gt;
This project aims to create a robust tool enabling users to access and analyze their GitHub metrics conveniently. The phase one objective was to develop API endpoints leveraging GitHub GraphQL and GitHub REST queries within a Python Flask framework. This involves integrating Flask with existing code to expose GraphQL queries as API endpoints, building a REST client, and establishing REST endpoints for streamlined data retrieval. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Subsequently, in phase two of the project, each API endpoint established in the initial phase will be complemented with a React-based frontend. This frontend will be specifically designed to visualize and present the GitHub data retrieved through these endpoints in an intuitive user interface. The goal is to seamlessly integrate backend functionality with frontend design to enhance user interaction and data presentation.&lt;br /&gt;
&lt;br /&gt;
==Demo and Source code links==&lt;br /&gt;
[https://www.youtube.com/watch?v=5g_WtZqLE9A YouTube Link]&lt;br /&gt;
&lt;br /&gt;
[https://github.ncsu.edu/slimbur/GH_Miner Source Code]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Below is the MVC architecture of our GitHub project:==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:MVC2.drawio.png|900px|Image : 900 pixels]]&lt;br /&gt;
&lt;br /&gt;
==Plan of Work==&lt;br /&gt;
In the second phase of the project, we will focus on developing a robust and user-friendly frontend using React. The frontend will serve as an intuitive interface for displaying and interacting with the data retrieved from the GitHub API endpoints implemented in the first phase.&lt;br /&gt;
&lt;br /&gt;
The plan includes the following key steps:&lt;br /&gt;
&lt;br /&gt;
1. &amp;lt;b&amp;gt;Setup React Environment&amp;lt;/b&amp;gt;: &lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Selecting Tooling and Libraries: Choose an appropriate React setup such as Create React App for rapid development or Next.js for server-side rendering and enhanced performance.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Dependency Management: Use npm or Yarn to manage project dependencies, including React, ReactDOM, and additional libraries for state management (Redux, Recoil), routing (React Router), and styling (styled-components, Tailwind CSS).&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Project Structure: Organize the project structure with components, containers, services, and utility folders to maintain a scalable and maintainable codebase.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &amp;lt;b&amp;gt;Design UI Components&amp;lt;/b&amp;gt;:&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Translate the data from the API endpoints into interactive React components, focusing on usability and accessibility standards.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Component Composition: Create reusable and composable UI components following component-based design principles, leveraging hooks (useState, useEffect) for managing state and side effects.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Styling: Implement consistent styling using CSS-in-JS solutions like styled-components or CSS modules, ensuring modular and scoped styles for each component.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. &amp;lt;b&amp;gt;Integrate with API Endpoints&amp;lt;/b&amp;gt;: &lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;HTTP Requests: Use Axios or Fetch API to handle asynchronous data fetching from the backend API endpoints implemented in phase one.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;State Management: Implement state management (e.g., Redux, Context API) to store and manage fetched data centrally across components, ensuring efficient data flow and reactivity.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Optimizing Performance: Implement memoization techniques (e.g., useMemo, useCallback) to optimize re-renders and reduce unnecessary API calls.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. &amp;lt;b&amp;gt;Implement Pagination&amp;lt;/b&amp;gt;: &lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Pagination Logic: Develop pagination logic to manage and display large datasets in manageable chunks, adhering to RESTful API standards for page-based navigation.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;UI Components: Create pagination controls (e.g., buttons, page indicators) to allow users to navigate through paginated data smoothly, updating the UI dynamically based on user interactions.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. &amp;lt;b&amp;gt;Enhance User Experience&amp;lt;/b&amp;gt;: &lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We will focus on improving the user experience by adding features such as search functionality, filtering, sorting, and other relevant enhancements based on the data being displayed. These enhancements will empower users to interact with the data more effectively and derive valuable insights.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Interactive Visualizations: Integrate interactive charts (e.g., using Chart.js, D3.js) to visually represent data trends and insights, enhancing user engagement and understanding.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
6. &amp;lt;b&amp;gt;Test and Debug&amp;lt;/b&amp;gt;: &lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Unit Testing: Write unit tests using Jest and React Testing Library to ensure individual components render correctly and exhibit expected behavior based on props and state.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Integration Testing: Conduct integration tests to validate API integrations, data flow, and interactions between frontend components.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Cross-Browser Compatibility: Perform cross-browser testing (e.g., Chrome, Firefox, Safari) and responsive testing to ensure consistent rendering and functionality across different browsers and devices.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
7. &amp;lt;b&amp;gt;Deploy and Document&amp;lt;/b&amp;gt;: Finally, we will deploy the React frontend to a hosting platform, ensuring it is accessible and easily usable by end-users. Comprehensive documentation will be provided, including instructions for setup, usage, and any relevant information for future maintenance and development.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
==Frontend==&lt;br /&gt;
As shown below, we plan to display contributors' individual contribution and commit count. We will be implementing the UI using ReactJS &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:LoginPage.png|900px|Image : 900 pixels]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Commits page with number of commits&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:OAuthLogin.png|900px|Image : 900 pixels]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:HomePage.png|900px|Image : 900 pixels]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:OODD4.png|900px|Image : 900 pixels]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:OODD5.png|900px|Image : 900 pixels]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:OODD6.png|900px|Image : 900 pixels]]&lt;br /&gt;
&lt;br /&gt;
==GraphQL Endpoints==&lt;br /&gt;
&lt;br /&gt;
Get current user login:&lt;br /&gt;
 /api/graphql/current-user-login&lt;br /&gt;
&lt;br /&gt;
Sample Output:&lt;br /&gt;
 {&lt;br /&gt;
   &amp;quot;viewer&amp;quot;: {&lt;br /&gt;
     &amp;quot;login&amp;quot;: &amp;quot;&amp;lt;your-username&amp;gt;&amp;quot;&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Get specific user login:&lt;br /&gt;
 /api/graphql/user-login/&amp;lt;username&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get list of all commits in a repo:&lt;br /&gt;
 /api/graphql/specific-user-commits/&amp;lt;owner&amp;gt;/&amp;lt;repo_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sample Output:&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;repository&amp;quot;: {&lt;br /&gt;
      &amp;quot;defaultBranchRef&amp;quot;: {&lt;br /&gt;
        &amp;quot;target&amp;quot;: {&lt;br /&gt;
          &amp;quot;history&amp;quot;: {&lt;br /&gt;
            &amp;quot;nodes&amp;quot;: [&lt;br /&gt;
              {&lt;br /&gt;
                &amp;quot;additions&amp;quot;: 0,&lt;br /&gt;
                &amp;quot;author&amp;quot;: {&lt;br /&gt;
                  &amp;quot;email&amp;quot;: &amp;quot;61797592+Atharva7007@users.noreply.github.com&amp;quot;,&lt;br /&gt;
                  &amp;quot;name&amp;quot;: &amp;quot;Atharva Pansare&amp;quot;,&lt;br /&gt;
                  &amp;quot;user&amp;quot;: {&lt;br /&gt;
                    &amp;quot;login&amp;quot;: &amp;quot;Atharva7007&amp;quot;&lt;br /&gt;
                  }&lt;br /&gt;
                },&lt;br /&gt;
                &amp;quot;authoredDate&amp;quot;: &amp;quot;2020-04-03T09:30:17Z&amp;quot;,&lt;br /&gt;
                &amp;quot;changedFilesIfAvailable&amp;quot;: 1,&lt;br /&gt;
                &amp;quot;deletions&amp;quot;: 0,&lt;br /&gt;
                &amp;quot;message&amp;quot;: &amp;quot;Add files via upload&amp;quot;,&lt;br /&gt;
                &amp;quot;parents&amp;quot;: {&lt;br /&gt;
                  &amp;quot;totalCount&amp;quot;: 1&lt;br /&gt;
                }&lt;br /&gt;
              }&lt;br /&gt;
            ],&lt;br /&gt;
            &amp;quot;pageInfo&amp;quot;: {&lt;br /&gt;
              &amp;quot;endCursor&amp;quot;: &amp;quot;98ba34a6c62ff6fe7c4d4de5c342a194f72d66e4 0&amp;quot;,&lt;br /&gt;
              &amp;quot;hasNextPage&amp;quot;: true&lt;br /&gt;
            },&lt;br /&gt;
            &amp;quot;totalCount&amp;quot;: 6&lt;br /&gt;
          }&lt;br /&gt;
        }&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
Get details of all contributors in a repo:&lt;br /&gt;
 /api/graphql/repository-contributors/&amp;lt;owner&amp;gt;/&amp;lt;repo_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sample Output:&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;repository&amp;quot;: {&lt;br /&gt;
      &amp;quot;defaultBranchRef&amp;quot;: {&lt;br /&gt;
        &amp;quot;target&amp;quot;: {&lt;br /&gt;
          &amp;quot;history&amp;quot;: {&lt;br /&gt;
            &amp;quot;nodes&amp;quot;: [&lt;br /&gt;
              {&lt;br /&gt;
                &amp;quot;author&amp;quot;: {&lt;br /&gt;
                  &amp;quot;email&amp;quot;: &amp;quot;61797592+Atharva7007@users.noreply.github.com&amp;quot;,&lt;br /&gt;
                  &amp;quot;name&amp;quot;: &amp;quot;Atharva Pansare&amp;quot;,&lt;br /&gt;
                  &amp;quot;user&amp;quot;: {&lt;br /&gt;
                    &amp;quot;login&amp;quot;: &amp;quot;Atharva7007&amp;quot;&lt;br /&gt;
                  }&lt;br /&gt;
                }&lt;br /&gt;
              }&lt;br /&gt;
            ],&lt;br /&gt;
            &amp;quot;pageInfo&amp;quot;: {&lt;br /&gt;
              &amp;quot;endCursor&amp;quot;: &amp;quot;98ba34a6c62ff6fe7c4d4de5c342a194f72d66e4 0&amp;quot;,&lt;br /&gt;
              &amp;quot;hasNextPage&amp;quot;: true&lt;br /&gt;
            },&lt;br /&gt;
            &amp;quot;totalCount&amp;quot;: 6&lt;br /&gt;
          }&lt;br /&gt;
        }&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
==REST API Endpoints==&lt;br /&gt;
Get current user login:&lt;br /&gt;
 /api/rest/current-user-login-rest&lt;br /&gt;
&lt;br /&gt;
This endpoint retrieves the login information of the currently authenticated user. It fetches the user's profile data from the GitHub API and returns details such as their username, avatar URL, and other relevant information.&lt;br /&gt;
&lt;br /&gt;
Sample Output:&lt;br /&gt;
 {&lt;br /&gt;
   &amp;quot;avatar_url&amp;quot;: &amp;quot;https://avatars.githubusercontent.com/u/61797592?v=4&amp;quot;,&lt;br /&gt;
   &amp;quot;bio&amp;quot;: null,&lt;br /&gt;
   &amp;quot;blog&amp;quot;: &amp;quot;&amp;quot;,&lt;br /&gt;
   &amp;quot;company&amp;quot;: null,&lt;br /&gt;
   &amp;quot;created_at&amp;quot;: &amp;quot;2020-03-04T16:49:06Z&amp;quot;,&lt;br /&gt;
   &amp;quot;email&amp;quot;: null,&lt;br /&gt;
   &amp;quot;events_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/events{/privacy}&amp;quot;,&lt;br /&gt;
   &amp;quot;followers&amp;quot;: 1,&lt;br /&gt;
   &amp;quot;followers_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/followers&amp;quot;,&lt;br /&gt;
   &amp;quot;following&amp;quot;: 3,&lt;br /&gt;
   &amp;quot;following_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/following{/other_user}&amp;quot;,&lt;br /&gt;
   &amp;quot;gists_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/gists{/gist_id}&amp;quot;,&lt;br /&gt;
   &amp;quot;gravatar_id&amp;quot;: &amp;quot;&amp;quot;,&lt;br /&gt;
   &amp;quot;hireable&amp;quot;: null,&lt;br /&gt;
   &amp;quot;html_url&amp;quot;: &amp;quot;https://github.com/Atharva7007&amp;quot;,&lt;br /&gt;
   &amp;quot;id&amp;quot;: 61797592,&lt;br /&gt;
   &amp;quot;location&amp;quot;: null,&lt;br /&gt;
   &amp;quot;login&amp;quot;: &amp;quot;Atharva7007&amp;quot;,&lt;br /&gt;
   &amp;quot;name&amp;quot;: &amp;quot;Atharva Pansare&amp;quot;,&lt;br /&gt;
   &amp;quot;node_id&amp;quot;: &amp;quot;MDQ6VXNlcjYxNzk3NTky&amp;quot;,&lt;br /&gt;
   &amp;quot;organizations_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/orgs&amp;quot;,&lt;br /&gt;
   &amp;quot;public_gists&amp;quot;: 0,&lt;br /&gt;
   &amp;quot;public_repos&amp;quot;: 11,&lt;br /&gt;
   &amp;quot;received_events_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/received_events&amp;quot;,&lt;br /&gt;
   &amp;quot;repos_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/repos&amp;quot;,&lt;br /&gt;
   &amp;quot;site_admin&amp;quot;: false,&lt;br /&gt;
   &amp;quot;starred_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/starred{/owner}{/repo}&amp;quot;,&lt;br /&gt;
   &amp;quot;subscriptions_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/subscriptions&amp;quot;,&lt;br /&gt;
   &amp;quot;twitter_username&amp;quot;: null,&lt;br /&gt;
   &amp;quot;type&amp;quot;: &amp;quot;User&amp;quot;,&lt;br /&gt;
   &amp;quot;updated_at&amp;quot;: &amp;quot;2024-03-14T19:03:46Z&amp;quot;,&lt;br /&gt;
   &amp;quot;url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007&amp;quot;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Get list of all commits in a repo:&lt;br /&gt;
 /api/rest/specific-user-commits/&amp;lt;owner&amp;gt;/&amp;lt;repo_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This endpoint retrieves a list of all commits made to a specific repository. It takes the repository owner and repository name as parameters. The endpoint fetches the commit history from the GitHub API and returns details about each commit, such as the author, commit message, and changes made.&lt;br /&gt;
&lt;br /&gt;
Sample Output:&lt;br /&gt;
 [&lt;br /&gt;
   {&lt;br /&gt;
     &amp;quot;repository&amp;quot;: {&lt;br /&gt;
       &amp;quot;defaultBranchRef&amp;quot;: {&lt;br /&gt;
         &amp;quot;target&amp;quot;: {&lt;br /&gt;
           &amp;quot;history&amp;quot;: {&lt;br /&gt;
             &amp;quot;nodes&amp;quot;: [&lt;br /&gt;
               {&lt;br /&gt;
                 &amp;quot;additions&amp;quot;: 0,&lt;br /&gt;
                 &amp;quot;author&amp;quot;: {&lt;br /&gt;
                   &amp;quot;email&amp;quot;: &amp;quot;61797592+Atharva7007@users.noreply.github.com&amp;quot;,&lt;br /&gt;
                   &amp;quot;name&amp;quot;: &amp;quot;Atharva Pansare&amp;quot;,&lt;br /&gt;
                   &amp;quot;user&amp;quot;: {&lt;br /&gt;
                     &amp;quot;login&amp;quot;: &amp;quot;Atharva7007&amp;quot;&lt;br /&gt;
                   }&lt;br /&gt;
                 },&lt;br /&gt;
                 &amp;quot;authoredDate&amp;quot;: &amp;quot;2020-04-03T09:30:17Z&amp;quot;,&lt;br /&gt;
                 &amp;quot;changedFilesIfAvailable&amp;quot;: 1,&lt;br /&gt;
                 &amp;quot;deletions&amp;quot;: 0,&lt;br /&gt;
                 &amp;quot;message&amp;quot;: &amp;quot;Add files via upload&amp;quot;,&lt;br /&gt;
                 &amp;quot;parents&amp;quot;: {&lt;br /&gt;
                   &amp;quot;totalCount&amp;quot;: 1&lt;br /&gt;
                 }&lt;br /&gt;
               }&lt;br /&gt;
             ],&lt;br /&gt;
             &amp;quot;pageInfo&amp;quot;: {&lt;br /&gt;
               &amp;quot;endCursor&amp;quot;: &amp;quot;98ba34a6c62ff6fe7c4d4de5c342a194f72d66e4 0&amp;quot;,&lt;br /&gt;
               &amp;quot;hasNextPage&amp;quot;: true&lt;br /&gt;
             },&lt;br /&gt;
             &amp;quot;totalCount&amp;quot;: 6&lt;br /&gt;
           }&lt;br /&gt;
         }&lt;br /&gt;
       }&lt;br /&gt;
     }&lt;br /&gt;
   }&lt;br /&gt;
 ]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Get details of all contributors in a repo:&lt;br /&gt;
 /api/rest/repository-contributors/&amp;lt;owner&amp;gt;/&amp;lt;repo_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This endpoint fetches the details of all contributors to a specific repository. It takes the repository owner and repository name as parameters. The endpoint retrieves the list of contributors from the GitHub API and returns information about each contributor, such as their username, avatar URL, and permissions within the repository.&lt;br /&gt;
&lt;br /&gt;
Sample Output:&lt;br /&gt;
[&lt;br /&gt;
  {&lt;br /&gt;
    &amp;quot;avatar_url&amp;quot;: &amp;quot;https://avatars.githubusercontent.com/u/61797592?v=4&amp;quot;,&lt;br /&gt;
    &amp;quot;events_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/events{/privacy}&amp;quot;,&lt;br /&gt;
    &amp;quot;followers_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/followers&amp;quot;,&lt;br /&gt;
    &amp;quot;following_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/following{/other_user}&amp;quot;,&lt;br /&gt;
    &amp;quot;gists_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/gists{/gist_id}&amp;quot;,&lt;br /&gt;
    &amp;quot;gravatar_id&amp;quot;: &amp;quot;&amp;quot;,&lt;br /&gt;
    &amp;quot;html_url&amp;quot;: &amp;quot;https://github.com/Atharva7007&amp;quot;,&lt;br /&gt;
    &amp;quot;id&amp;quot;: 61797592,&lt;br /&gt;
    &amp;quot;login&amp;quot;: &amp;quot;Atharva7007&amp;quot;,&lt;br /&gt;
    &amp;quot;node_id&amp;quot;: &amp;quot;MDQ6VXNlcjYxNzk3NTky&amp;quot;,&lt;br /&gt;
    &amp;quot;organizations_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/orgs&amp;quot;,&lt;br /&gt;
    &amp;quot;permissions&amp;quot;: {&lt;br /&gt;
      &amp;quot;admin&amp;quot;: true,&lt;br /&gt;
      &amp;quot;maintain&amp;quot;: true,&lt;br /&gt;
      &amp;quot;pull&amp;quot;: true,&lt;br /&gt;
      &amp;quot;push&amp;quot;: true,&lt;br /&gt;
      &amp;quot;triage&amp;quot;: true&lt;br /&gt;
    },&lt;br /&gt;
    &amp;quot;received_events_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/received_events&amp;quot;,&lt;br /&gt;
    &amp;quot;repos_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/repos&amp;quot;,&lt;br /&gt;
    &amp;quot;role_name&amp;quot;: &amp;quot;admin&amp;quot;,&lt;br /&gt;
    &amp;quot;site_admin&amp;quot;: false,&lt;br /&gt;
    &amp;quot;starred_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/starred{/owner}{/repo}&amp;quot;,&lt;br /&gt;
    &amp;quot;subscriptions_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/subscriptions&amp;quot;,&lt;br /&gt;
    &amp;quot;type&amp;quot;: &amp;quot;User&amp;quot;,&lt;br /&gt;
    &amp;quot;url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Implementation Details==&lt;br /&gt;
The GitHub Miner project consists of two main components: the backend API and the frontend user interface.&lt;br /&gt;
&lt;br /&gt;
The backend API is implemented using Flask, a lightweight Python web framework. It exposes two sets of endpoints: one for GraphQL queries and another for REST API queries. Flask Blueprints are used to route requests to the appropriate endpoints based on the URL path.&lt;br /&gt;
&lt;br /&gt;
The GraphQL implementation utilizes the `graphene` library, which provides a way to define GraphQL schemas and resolvers. The resolvers are responsible for fetching data from the GitHub API using the `pygithub` library.&lt;br /&gt;
&lt;br /&gt;
The REST implementation uses the `requests` library to make HTTP requests to the GitHub API and process the responses.&lt;br /&gt;
&lt;br /&gt;
To ensure reliability and robustness, comprehensive testing strategies, including unit tests and integration tests, have been implemented. These tests validate the functionality of the API endpoints across different scenarios, ensuring the system's correctness and stability.&lt;br /&gt;
&lt;br /&gt;
In the API, we have 2 separate endpoints to retrieve the same data: one for REST and the other using GraphQL queries. To manage this, we have made use of Flask Blueprints where all the &amp;quot;api/graphql&amp;quot; requests get routed to the graphql variants and the &amp;quot;api/rest&amp;quot; requests get routed to the REST variants.&lt;br /&gt;
&lt;br /&gt;
=== Design Patterns used ===&lt;br /&gt;
# The REST API Client '''/backend/app/services/github_query/github_rest/client.py''' is a Singleton.&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;To ensure the reliability and robustness of the GitHub Miner, comprehensive testing strategies, including unit tests and integration tests, have been implemented. These tests validate the functionality of the API endpoints across different scenarios, ensuring the system's correctness and stability. The testing suite covers the following areas:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;1. Unit Tests:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Unit tests have been meticulously developed to evaluate the individual components of the GitHub Miner in isolation. Each test is designed to ensure that every component functions correctly by itself without dependencies, thereby identifying issues in the smallest units of code. This section delves into both the GitHub GraphQL integration and the specific queries used for data retrieval, ensuring comprehensive coverage.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;2. GitHub GraphQL Tests:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;&amp;lt;strong&amp;gt;test_authentication.py&amp;lt;/strong&amp;gt;: Tests the robustness of the authentication system by verifying token handling and refresh mechanisms, critical for maintaining secure access to GitHub data.&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;&amp;lt;strong&amp;gt;test_client.py&amp;lt;/strong&amp;gt;: Assesses the initialization and operational integrity of the GraphQL client, including its error handling capabilities and the accuracy of its response parsing, ensuring the client can reliably communicate with the GitHub API.&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;&amp;lt;strong&amp;gt;test_query.py&amp;lt;/strong&amp;gt;: Evaluates the formation and execution of GraphQL queries and their error handling, confirming that queries are constructed correctly and yield expected results or manage errors gracefully.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;3. Queries Tests:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;&amp;lt;strong&amp;gt;Comments&amp;lt;/strong&amp;gt;: Confirms the precise retrieval and parsing of comments from GitHub repositories, ensuring data integrity and accuracy for user interactions displayed on the platform.&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;&amp;lt;strong&amp;gt;Contributions&amp;lt;/strong&amp;gt;: Verifies the accuracy and completeness of data regarding user contributions such as commits and pull requests, which are pivotal for analytics and tracking user engagement.&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;&amp;lt;strong&amp;gt;Costs&amp;lt;/strong&amp;gt;: Tests the system's ability to calculate API usage costs efficiently, which is essential for managing rate limits and optimizing resource consumption.&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;&amp;lt;strong&amp;gt;Profiles&amp;lt;/strong&amp;gt;: Ensures thorough and accurate fetching and parsing of GitHub user profiles, critical for displaying detailed user data and analytics.&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;&amp;lt;strong&amp;gt;Repositories&amp;lt;/strong&amp;gt;: Validates the accurate retrieval of comprehensive repository information, essential for repository management and data display.&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;&amp;lt;strong&amp;gt;Time Range Contributions&amp;lt;/strong&amp;gt;: Assesses the accuracy of fetching and aggregating contributions within specified time ranges, vital for historical data analysis and trend assessment.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;4. Integration Tests:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Integration tests are designed to verify the effective cooperation between various components of the GitHub Miner. These tests ensure that components work seamlessly together, which is essential for the smooth operation of the system. This testing phase is crucial for assessing the interaction between the frontend and backend components, ensuring data flows correctly through the application and that user actions trigger the appropriate responses in real-time.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;&amp;lt;strong&amp;gt;TestClient&amp;lt;/strong&amp;gt;: Tests the GitHub client's ability to initialize correctly, generate appropriate headers, handle retries, execute queries efficiently, and manage paginated responses, ensuring robustness and reliability in accessing GitHub data.&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;&amp;lt;strong&amp;gt;Authentication Tests&amp;lt;/strong&amp;gt;: Validates the generation of correct authorization headers and proper handling of personal access tokens, crucial for maintaining secure and authorized access to the GitHub API.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;5. Testing Examples:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Here, we provide specific examples of test cases implemented in our project. You can see how we approach testing for both unit and integration levels, focusing on key functionalities and integration points.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;code&amp;gt;&lt;br /&gt;
import pytest&lt;br /&gt;
import requests_mock&lt;br /&gt;
from unittest.mock import MagicMock&lt;br /&gt;
from datetime import datetime, timezone&lt;br /&gt;
from requests.exceptions import Timeout&lt;br /&gt;
from backend.app.services.github_query.github_graphql.client import Client, InvalidAuthenticationError, QueryFailedException&lt;br /&gt;
from backend.app.services.github_query.github_graphql.authentication import PersonalAccessTokenAuthenticator &lt;br /&gt;
from backend.app.services.github_query.github_graphql.query import Query, PaginatedQuery&lt;br /&gt;
from backend.app.services.github_query.github_rest.client import RESTClient&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
@pytest.fixture&lt;br /&gt;
def valid_token():&lt;br /&gt;
    return &amp;quot;valid_token_123&amp;quot;&lt;br /&gt;
&lt;br /&gt;
@pytest.fixture&lt;br /&gt;
def authenticator(valid_token):&lt;br /&gt;
    return PersonalAccessTokenAuthenticator(token=valid_token)&lt;br /&gt;
&lt;br /&gt;
@pytest.fixture&lt;br /&gt;
def github_client(authenticator):&lt;br /&gt;
    return Client(authenticator=authenticator)&lt;br /&gt;
&lt;br /&gt;
class TestClient:&lt;br /&gt;
    def test_client_without_authenticator(self):&lt;br /&gt;
        &amp;quot;&amp;quot;&amp;quot;Test that client raises error when no authenticator is provided&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
        with pytest.raises(InvalidAuthenticationError):&lt;br /&gt;
            Client()  # No authenticator provided&lt;br /&gt;
&lt;br /&gt;
    def test_client_initialization(self, github_client):&lt;br /&gt;
        &amp;quot;&amp;quot;&amp;quot;Test that the client is correctly initialized with the given authenticator&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
        assert github_client._authenticator is not None, &amp;quot;Authenticator should be set.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    def test_client_base_path(self, github_client):&lt;br /&gt;
        &amp;quot;&amp;quot;&amp;quot;Test that the base path is correctly constructed&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
        assert &amp;quot;api.github.com&amp;quot; in github_client._base_path(), &amp;quot;Base path should include the host.&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    def test_generate_headers(self, github_client, authenticator):&lt;br /&gt;
        &amp;quot;&amp;quot;&amp;quot;Test that headers are correctly generated including authorization and additional headers.&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
        additional_headers = {&amp;quot;Custom-Header&amp;quot;: &amp;quot;CustomValue&amp;quot;}&lt;br /&gt;
        expected_headers = authenticator.get_authorization_header()&lt;br /&gt;
        expected_headers.update(additional_headers)&lt;br /&gt;
&lt;br /&gt;
        assert github_client._generate_headers(**additional_headers) == expected_headers, &amp;quot;Headers should include both authenticator and additional headers.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    def test_retry_success(self, github_client, requests_mock):&lt;br /&gt;
        &amp;quot;&amp;quot;&amp;quot;Test that retry_request succeeds after a retry.&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
        # Mock the request to timeout once then succeed&lt;br /&gt;
        requests_mock.register_uri('POST', github_client._base_path(), [&lt;br /&gt;
            {'exc': Timeout},&lt;br /&gt;
            {'json': {'data': 'success'}, 'status_code': 200}&lt;br /&gt;
        ])&lt;br /&gt;
        &lt;br /&gt;
        response = github_client._retry_request(2, 1, &amp;quot;query { viewer { login }}&amp;quot;, {})&lt;br /&gt;
        assert response.json() == {'data': 'success'}, &amp;quot;Should succeed on the second attempt.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    def test_retry_timeout(self, github_client, requests_mock):&lt;br /&gt;
        &amp;quot;&amp;quot;&amp;quot;Test that retry_request gives up after attempts are exhausted.&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
        # Mock the request to timeout&lt;br /&gt;
        requests_mock.register_uri('POST', github_client._base_path(), [&lt;br /&gt;
            {'exc': Timeout},&lt;br /&gt;
            {'exc': Timeout}&lt;br /&gt;
        ])&lt;br /&gt;
        &lt;br /&gt;
        with pytest.raises(Timeout):&lt;br /&gt;
            github_client._retry_request(2, 1, &amp;quot;query { viewer { login }}&amp;quot;, {})&lt;br /&gt;
&lt;br /&gt;
    def test_execute_success(self, github_client, requests_mock):&lt;br /&gt;
        &amp;quot;&amp;quot;&amp;quot;Test successful execution of a query.&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
        # Mock the rate limit pre-check and the actual query execution&lt;br /&gt;
        requests_mock.post(github_client._base_path(), [&lt;br /&gt;
            {'json': {&amp;quot;data&amp;quot;: {&amp;quot;rateLimit&amp;quot;: {&amp;quot;cost&amp;quot;: 1, &amp;quot;remaining&amp;quot;: 5000, &amp;quot;resetAt&amp;quot;: &amp;quot;2021-01-01T00:00:00Z&amp;quot;}}}, 'status_code': 200},&lt;br /&gt;
            {'json': {&amp;quot;data&amp;quot;: &amp;quot;query success&amp;quot;}, 'status_code': 200}&lt;br /&gt;
        ])&lt;br /&gt;
        response = github_client._execute(&amp;quot;query { viewer { login }}&amp;quot;, {})&lt;br /&gt;
        assert response == &amp;quot;query success&amp;quot;, &amp;quot;Execute should return success on valid response.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    def test_execute_rate_limit_exceeded(self, github_client, requests_mock):&lt;br /&gt;
        &amp;quot;&amp;quot;&amp;quot;Test execution of a query leading to waiting for rate limit reset.&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
        # Set specific values for cost, remaining, and resetAt&lt;br /&gt;
        mock_cost = 10&lt;br /&gt;
        mock_remaining = 14  # Ensure remaining - 5 &amp;lt; mock_cost&lt;br /&gt;
        # mock_reset_at = datetime.utcnow().strftime('%Y-%m-%dT%H:%M:%SZ')&lt;br /&gt;
        mock_reset_at = datetime.now(timezone.utc).strftime('%Y-%m-%dT%H:%M:%SZ')&lt;br /&gt;
&lt;br /&gt;
        # Mock rate limit response&lt;br /&gt;
        mock_rate_limit_response = {&lt;br /&gt;
            &amp;quot;data&amp;quot;: {&lt;br /&gt;
                &amp;quot;rateLimit&amp;quot;: {&lt;br /&gt;
                    &amp;quot;cost&amp;quot;: mock_cost,&lt;br /&gt;
                    &amp;quot;remaining&amp;quot;: mock_remaining,&lt;br /&gt;
                    &amp;quot;resetAt&amp;quot;: mock_reset_at&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        # Setup requests_mock to simulate the rate limit response and any subsequent requests&lt;br /&gt;
        base_path = github_client._base_path()&lt;br /&gt;
        requests_mock.post(base_path, [&lt;br /&gt;
            {'json': mock_rate_limit_response, 'status_code': 200},&lt;br /&gt;
            {'json': {&amp;quot;data&amp;quot;: &amp;quot;query success&amp;quot;}, 'status_code': 200}&lt;br /&gt;
        ])&lt;br /&gt;
        response = github_client._execute(&amp;quot;query { viewer { login }}&amp;quot;, {})&lt;br /&gt;
        assert response == &amp;quot;query success&amp;quot;, &amp;quot;Execute should return success on valid response.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    def test_execute_query_failed(self, github_client, requests_mock):&lt;br /&gt;
        &amp;quot;&amp;quot;&amp;quot;Test execution of a query leading to QueryFailedException with retries.&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
        # Mock a failed query response for each retry attempt&lt;br /&gt;
        requests_mock.post(github_client._base_path(), [&lt;br /&gt;
            {'json': {&amp;quot;data&amp;quot;: {&amp;quot;rateLimit&amp;quot;: {&amp;quot;cost&amp;quot;: 1, &amp;quot;remaining&amp;quot;: 5000, &amp;quot;resetAt&amp;quot;: &amp;quot;2021-01-01T00:00:00Z&amp;quot;}}}, 'status_code': 200},&lt;br /&gt;
            {&amp;quot;json&amp;quot;: {&amp;quot;error&amp;quot;: &amp;quot;bad request&amp;quot;}, &amp;quot;status_code&amp;quot;: 400}&lt;br /&gt;
        ])&lt;br /&gt;
        # Expecting QueryFailedException after all retries have been exhausted&lt;br /&gt;
        with pytest.raises(QueryFailedException):&lt;br /&gt;
            github_client._execute(&amp;quot;query { viewer { login }}&amp;quot;, {})&lt;br /&gt;
    &lt;br /&gt;
    def test_execution_generator(self, github_client):&lt;br /&gt;
        &amp;quot;&amp;quot;&amp;quot;Test that _execution_generator correctly handles paginated responses.&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
        # Setup a mock paginated query&lt;br /&gt;
        query = MagicMock()&lt;br /&gt;
        query.paginator.has_next.side_effect = [True, True, False]  # Simulate 2 pages of results, then stop&lt;br /&gt;
        query.path = []  # Example path, adjust based on your actual usage&lt;br /&gt;
&lt;br /&gt;
        # Mock the _execute method to return simulated page results&lt;br /&gt;
        github_client._execute = MagicMock()&lt;br /&gt;
        github_client._execute.side_effect = [&lt;br /&gt;
            {&amp;quot;pageInfo&amp;quot;: {&amp;quot;endCursor&amp;quot;: &amp;quot;cursor1&amp;quot;, &amp;quot;hasNextPage&amp;quot;: True}, &amp;quot;nodes&amp;quot;: [{&amp;quot;edges&amp;quot;: &amp;quot;data1&amp;quot;}]},&lt;br /&gt;
            {&amp;quot;pageInfo&amp;quot;: {&amp;quot;endCursor&amp;quot;: &amp;quot;cursor2&amp;quot;, &amp;quot;hasNextPage&amp;quot;: False}, &amp;quot;nodes&amp;quot;: [{&amp;quot;edges&amp;quot;: &amp;quot;data2&amp;quot;}]}&lt;br /&gt;
        ]&lt;br /&gt;
&lt;br /&gt;
        # Mock the update_paginator method to reflect the changing state of pagination&lt;br /&gt;
        query.paginator.update_paginator = MagicMock()&lt;br /&gt;
&lt;br /&gt;
        # Collect all results from the generator&lt;br /&gt;
        results = list(github_client._execution_generator(query, {}))&lt;br /&gt;
&lt;br /&gt;
        # Assertions&lt;br /&gt;
        assert len(results) == 2, &amp;quot;Should yield two results for the two pages&amp;quot;&lt;br /&gt;
        assert results[0]['nodes'][0]['edges'] == &amp;quot;data1&amp;quot;, &amp;quot;First result should match first mocked response&amp;quot;&lt;br /&gt;
        assert results[1]['nodes'][0]['edges'] == &amp;quot;data2&amp;quot;, &amp;quot;Second result should match second mocked response&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        # Ensure update_paginator was called correctly&lt;br /&gt;
        assert query.paginator.update_paginator.call_count == 2, &amp;quot;update_paginator should be called twice, once per page&amp;quot;&lt;br /&gt;
        query.paginator.update_paginator.assert_called_with(False, &amp;quot;cursor2&amp;quot;)  # Last call should reflect the end of pagination&lt;br /&gt;
&lt;br /&gt;
    def test_client_execute_success(self, github_client, requests_mock):&lt;br /&gt;
        &amp;quot;&amp;quot;&amp;quot;Test successful execution of a query&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
        requests_mock.post(github_client._base_path(), [&lt;br /&gt;
            {'json': {&amp;quot;data&amp;quot;: {&amp;quot;rateLimit&amp;quot;: {&amp;quot;cost&amp;quot;: 1, &amp;quot;remaining&amp;quot;: 5000, &amp;quot;resetAt&amp;quot;: &amp;quot;2021-01-01T00:00:00Z&amp;quot;}}}, 'status_code': 200},&lt;br /&gt;
            {'json': {&amp;quot;data&amp;quot;: &amp;quot;query success&amp;quot;}, 'status_code': 200}&lt;br /&gt;
        ])&lt;br /&gt;
        response = github_client.execute(Query(&amp;quot;query { viewer { login }}&amp;quot;), {})&lt;br /&gt;
        assert response == &amp;quot;query success&amp;quot;, &amp;quot;Execute should return success on valid response.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    def test_client_execute_failed(self, github_client, requests_mock):&lt;br /&gt;
        &amp;quot;&amp;quot;&amp;quot;Test that a failed query raises QueryFailedException&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
        requests_mock.post(github_client._base_path(), [&lt;br /&gt;
            {'json': {&amp;quot;data&amp;quot;: {&amp;quot;rateLimit&amp;quot;: {&amp;quot;cost&amp;quot;: 1, &amp;quot;remaining&amp;quot;: 5000, &amp;quot;resetAt&amp;quot;: &amp;quot;2021-01-01T00:00:00Z&amp;quot;}}}, 'status_code': 200},&lt;br /&gt;
            {&amp;quot;json&amp;quot;: {&amp;quot;error&amp;quot;: &amp;quot;bad request&amp;quot;}, &amp;quot;status_code&amp;quot;: 400}&lt;br /&gt;
        ])&lt;br /&gt;
        with pytest.raises(QueryFailedException) as excinfo:&lt;br /&gt;
            github_client.execute(Query(&amp;quot;query { viewer { login }}&amp;quot;), {})&lt;br /&gt;
        assert &amp;quot;Query failed with code&amp;quot; in str(excinfo.value), &amp;quot;QueryFailedException should contain the right error message.&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;These tests collectively ensure that the GitHub Miner operates reliably, providing accurate and timely data from GitHub's APIs. By covering a wide range of scenarios, from successful queries to error handling and rate limiting, the tests ensure that the application can be used confidently in production environments.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
Atharva Pansare&lt;br /&gt;
&lt;br /&gt;
Sumedh Limburkar&lt;br /&gt;
&lt;br /&gt;
Viraj Sanap&lt;br /&gt;
&lt;br /&gt;
Mengning Li&lt;br /&gt;
&lt;br /&gt;
Mentor: Jialin Cui&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
GitHub REST API documentation - https://docs.github.com/en/rest?apiVersion=2022-11-28&lt;/div&gt;</summary>
		<author><name>Slimbur</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_G2402_Implement_REST_client,_REST_API,_and_Graphql_API_endpoint_for_repositories_-_Part_2&amp;diff=156962</id>
		<title>CSC/ECE 517 Spring 2024 - G2402 Implement REST client, REST API, and Graphql API endpoint for repositories - Part 2</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_G2402_Implement_REST_client,_REST_API,_and_Graphql_API_endpoint_for_repositories_-_Part_2&amp;diff=156962"/>
		<updated>2024-04-29T16:17:15Z</updated>

		<summary type="html">&lt;p&gt;Slimbur: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
== Project Objective ==&lt;br /&gt;
This project aims to create a robust tool enabling users to access and analyze their GitHub metrics conveniently. The phase one objective was to develop API endpoints leveraging GitHub GraphQL and GitHub REST queries within a Python Flask framework. This involves integrating Flask with existing code to expose GraphQL queries as API endpoints, building a REST client, and establishing REST endpoints for streamlined data retrieval. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Subsequently, in phase two of the project, each API endpoint established in the initial phase will be complemented with a React-based frontend. This frontend will be specifically designed to visualize and present the GitHub data retrieved through these endpoints in an intuitive user interface. The goal is to seamlessly integrate backend functionality with frontend design to enhance user interaction and data presentation.&lt;br /&gt;
&lt;br /&gt;
==Demo==&lt;br /&gt;
[https://www.youtube.com/watch?v=5g_WtZqLE9A YouTube Link]&lt;br /&gt;
&lt;br /&gt;
==Below is the MVC architecture of our GitHub project:==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:MVC2.drawio.png|900px|Image : 900 pixels]]&lt;br /&gt;
&lt;br /&gt;
==Plan of Work==&lt;br /&gt;
In the second phase of the project, we will focus on developing a robust and user-friendly frontend using React. The frontend will serve as an intuitive interface for displaying and interacting with the data retrieved from the GitHub API endpoints implemented in the first phase.&lt;br /&gt;
&lt;br /&gt;
The plan includes the following key steps:&lt;br /&gt;
&lt;br /&gt;
1. &amp;lt;b&amp;gt;Setup React Environment&amp;lt;/b&amp;gt;: &lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Selecting Tooling and Libraries: Choose an appropriate React setup such as Create React App for rapid development or Next.js for server-side rendering and enhanced performance.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Dependency Management: Use npm or Yarn to manage project dependencies, including React, ReactDOM, and additional libraries for state management (Redux, Recoil), routing (React Router), and styling (styled-components, Tailwind CSS).&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Project Structure: Organize the project structure with components, containers, services, and utility folders to maintain a scalable and maintainable codebase.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &amp;lt;b&amp;gt;Design UI Components&amp;lt;/b&amp;gt;:&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Translate the data from the API endpoints into interactive React components, focusing on usability and accessibility standards.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Component Composition: Create reusable and composable UI components following component-based design principles, leveraging hooks (useState, useEffect) for managing state and side effects.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Styling: Implement consistent styling using CSS-in-JS solutions like styled-components or CSS modules, ensuring modular and scoped styles for each component.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. &amp;lt;b&amp;gt;Integrate with API Endpoints&amp;lt;/b&amp;gt;: &lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;HTTP Requests: Use Axios or Fetch API to handle asynchronous data fetching from the backend API endpoints implemented in phase one.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;State Management: Implement state management (e.g., Redux, Context API) to store and manage fetched data centrally across components, ensuring efficient data flow and reactivity.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Optimizing Performance: Implement memoization techniques (e.g., useMemo, useCallback) to optimize re-renders and reduce unnecessary API calls.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. &amp;lt;b&amp;gt;Implement Pagination&amp;lt;/b&amp;gt;: &lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Pagination Logic: Develop pagination logic to manage and display large datasets in manageable chunks, adhering to RESTful API standards for page-based navigation.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;UI Components: Create pagination controls (e.g., buttons, page indicators) to allow users to navigate through paginated data smoothly, updating the UI dynamically based on user interactions.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. &amp;lt;b&amp;gt;Enhance User Experience&amp;lt;/b&amp;gt;: &lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We will focus on improving the user experience by adding features such as search functionality, filtering, sorting, and other relevant enhancements based on the data being displayed. These enhancements will empower users to interact with the data more effectively and derive valuable insights.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Interactive Visualizations: Integrate interactive charts (e.g., using Chart.js, D3.js) to visually represent data trends and insights, enhancing user engagement and understanding.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
6. &amp;lt;b&amp;gt;Test and Debug&amp;lt;/b&amp;gt;: &lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Unit Testing: Write unit tests using Jest and React Testing Library to ensure individual components render correctly and exhibit expected behavior based on props and state.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Integration Testing: Conduct integration tests to validate API integrations, data flow, and interactions between frontend components.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Cross-Browser Compatibility: Perform cross-browser testing (e.g., Chrome, Firefox, Safari) and responsive testing to ensure consistent rendering and functionality across different browsers and devices.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
7. &amp;lt;b&amp;gt;Deploy and Document&amp;lt;/b&amp;gt;: Finally, we will deploy the React frontend to a hosting platform, ensuring it is accessible and easily usable by end-users. Comprehensive documentation will be provided, including instructions for setup, usage, and any relevant information for future maintenance and development.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
==Frontend==&lt;br /&gt;
As shown below, we plan to display contributors' individual contribution and commit count. We will be implementing the UI using ReactJS &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Login_ss.png|900px|Image : 900 pixels]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Commits page with number of commits&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:User_ss.png|900px|Image : 900 pixels]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Contributors ss.png|900px|Image : 900 pixels]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Table ss.png|900px|Image : 900 pixels]]&lt;br /&gt;
&lt;br /&gt;
==GraphQL Endpoints==&lt;br /&gt;
&lt;br /&gt;
Get current user login:&lt;br /&gt;
 /api/graphql/current-user-login&lt;br /&gt;
&lt;br /&gt;
Sample Output:&lt;br /&gt;
 {&lt;br /&gt;
   &amp;quot;viewer&amp;quot;: {&lt;br /&gt;
     &amp;quot;login&amp;quot;: &amp;quot;&amp;lt;your-username&amp;gt;&amp;quot;&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Get specific user login:&lt;br /&gt;
 /api/graphql/user-login/&amp;lt;username&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get list of all commits in a repo:&lt;br /&gt;
 /api/graphql/specific-user-commits/&amp;lt;owner&amp;gt;/&amp;lt;repo_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sample Output:&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;repository&amp;quot;: {&lt;br /&gt;
      &amp;quot;defaultBranchRef&amp;quot;: {&lt;br /&gt;
        &amp;quot;target&amp;quot;: {&lt;br /&gt;
          &amp;quot;history&amp;quot;: {&lt;br /&gt;
            &amp;quot;nodes&amp;quot;: [&lt;br /&gt;
              {&lt;br /&gt;
                &amp;quot;additions&amp;quot;: 0,&lt;br /&gt;
                &amp;quot;author&amp;quot;: {&lt;br /&gt;
                  &amp;quot;email&amp;quot;: &amp;quot;61797592+Atharva7007@users.noreply.github.com&amp;quot;,&lt;br /&gt;
                  &amp;quot;name&amp;quot;: &amp;quot;Atharva Pansare&amp;quot;,&lt;br /&gt;
                  &amp;quot;user&amp;quot;: {&lt;br /&gt;
                    &amp;quot;login&amp;quot;: &amp;quot;Atharva7007&amp;quot;&lt;br /&gt;
                  }&lt;br /&gt;
                },&lt;br /&gt;
                &amp;quot;authoredDate&amp;quot;: &amp;quot;2020-04-03T09:30:17Z&amp;quot;,&lt;br /&gt;
                &amp;quot;changedFilesIfAvailable&amp;quot;: 1,&lt;br /&gt;
                &amp;quot;deletions&amp;quot;: 0,&lt;br /&gt;
                &amp;quot;message&amp;quot;: &amp;quot;Add files via upload&amp;quot;,&lt;br /&gt;
                &amp;quot;parents&amp;quot;: {&lt;br /&gt;
                  &amp;quot;totalCount&amp;quot;: 1&lt;br /&gt;
                }&lt;br /&gt;
              }&lt;br /&gt;
            ],&lt;br /&gt;
            &amp;quot;pageInfo&amp;quot;: {&lt;br /&gt;
              &amp;quot;endCursor&amp;quot;: &amp;quot;98ba34a6c62ff6fe7c4d4de5c342a194f72d66e4 0&amp;quot;,&lt;br /&gt;
              &amp;quot;hasNextPage&amp;quot;: true&lt;br /&gt;
            },&lt;br /&gt;
            &amp;quot;totalCount&amp;quot;: 6&lt;br /&gt;
          }&lt;br /&gt;
        }&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
Get details of all contributors in a repo:&lt;br /&gt;
 /api/graphql/repository-contributors/&amp;lt;owner&amp;gt;/&amp;lt;repo_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sample Output:&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;repository&amp;quot;: {&lt;br /&gt;
      &amp;quot;defaultBranchRef&amp;quot;: {&lt;br /&gt;
        &amp;quot;target&amp;quot;: {&lt;br /&gt;
          &amp;quot;history&amp;quot;: {&lt;br /&gt;
            &amp;quot;nodes&amp;quot;: [&lt;br /&gt;
              {&lt;br /&gt;
                &amp;quot;author&amp;quot;: {&lt;br /&gt;
                  &amp;quot;email&amp;quot;: &amp;quot;61797592+Atharva7007@users.noreply.github.com&amp;quot;,&lt;br /&gt;
                  &amp;quot;name&amp;quot;: &amp;quot;Atharva Pansare&amp;quot;,&lt;br /&gt;
                  &amp;quot;user&amp;quot;: {&lt;br /&gt;
                    &amp;quot;login&amp;quot;: &amp;quot;Atharva7007&amp;quot;&lt;br /&gt;
                  }&lt;br /&gt;
                }&lt;br /&gt;
              }&lt;br /&gt;
            ],&lt;br /&gt;
            &amp;quot;pageInfo&amp;quot;: {&lt;br /&gt;
              &amp;quot;endCursor&amp;quot;: &amp;quot;98ba34a6c62ff6fe7c4d4de5c342a194f72d66e4 0&amp;quot;,&lt;br /&gt;
              &amp;quot;hasNextPage&amp;quot;: true&lt;br /&gt;
            },&lt;br /&gt;
            &amp;quot;totalCount&amp;quot;: 6&lt;br /&gt;
          }&lt;br /&gt;
        }&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
==REST API Endpoints==&lt;br /&gt;
Get current user login:&lt;br /&gt;
 /api/rest/current-user-login-rest&lt;br /&gt;
&lt;br /&gt;
This endpoint retrieves the login information of the currently authenticated user. It fetches the user's profile data from the GitHub API and returns details such as their username, avatar URL, and other relevant information.&lt;br /&gt;
&lt;br /&gt;
Sample Output:&lt;br /&gt;
 {&lt;br /&gt;
   &amp;quot;avatar_url&amp;quot;: &amp;quot;https://avatars.githubusercontent.com/u/61797592?v=4&amp;quot;,&lt;br /&gt;
   &amp;quot;bio&amp;quot;: null,&lt;br /&gt;
   &amp;quot;blog&amp;quot;: &amp;quot;&amp;quot;,&lt;br /&gt;
   &amp;quot;company&amp;quot;: null,&lt;br /&gt;
   &amp;quot;created_at&amp;quot;: &amp;quot;2020-03-04T16:49:06Z&amp;quot;,&lt;br /&gt;
   &amp;quot;email&amp;quot;: null,&lt;br /&gt;
   &amp;quot;events_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/events{/privacy}&amp;quot;,&lt;br /&gt;
   &amp;quot;followers&amp;quot;: 1,&lt;br /&gt;
   &amp;quot;followers_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/followers&amp;quot;,&lt;br /&gt;
   &amp;quot;following&amp;quot;: 3,&lt;br /&gt;
   &amp;quot;following_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/following{/other_user}&amp;quot;,&lt;br /&gt;
   &amp;quot;gists_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/gists{/gist_id}&amp;quot;,&lt;br /&gt;
   &amp;quot;gravatar_id&amp;quot;: &amp;quot;&amp;quot;,&lt;br /&gt;
   &amp;quot;hireable&amp;quot;: null,&lt;br /&gt;
   &amp;quot;html_url&amp;quot;: &amp;quot;https://github.com/Atharva7007&amp;quot;,&lt;br /&gt;
   &amp;quot;id&amp;quot;: 61797592,&lt;br /&gt;
   &amp;quot;location&amp;quot;: null,&lt;br /&gt;
   &amp;quot;login&amp;quot;: &amp;quot;Atharva7007&amp;quot;,&lt;br /&gt;
   &amp;quot;name&amp;quot;: &amp;quot;Atharva Pansare&amp;quot;,&lt;br /&gt;
   &amp;quot;node_id&amp;quot;: &amp;quot;MDQ6VXNlcjYxNzk3NTky&amp;quot;,&lt;br /&gt;
   &amp;quot;organizations_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/orgs&amp;quot;,&lt;br /&gt;
   &amp;quot;public_gists&amp;quot;: 0,&lt;br /&gt;
   &amp;quot;public_repos&amp;quot;: 11,&lt;br /&gt;
   &amp;quot;received_events_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/received_events&amp;quot;,&lt;br /&gt;
   &amp;quot;repos_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/repos&amp;quot;,&lt;br /&gt;
   &amp;quot;site_admin&amp;quot;: false,&lt;br /&gt;
   &amp;quot;starred_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/starred{/owner}{/repo}&amp;quot;,&lt;br /&gt;
   &amp;quot;subscriptions_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/subscriptions&amp;quot;,&lt;br /&gt;
   &amp;quot;twitter_username&amp;quot;: null,&lt;br /&gt;
   &amp;quot;type&amp;quot;: &amp;quot;User&amp;quot;,&lt;br /&gt;
   &amp;quot;updated_at&amp;quot;: &amp;quot;2024-03-14T19:03:46Z&amp;quot;,&lt;br /&gt;
   &amp;quot;url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007&amp;quot;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Get list of all commits in a repo:&lt;br /&gt;
 /api/rest/specific-user-commits/&amp;lt;owner&amp;gt;/&amp;lt;repo_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This endpoint retrieves a list of all commits made to a specific repository. It takes the repository owner and repository name as parameters. The endpoint fetches the commit history from the GitHub API and returns details about each commit, such as the author, commit message, and changes made.&lt;br /&gt;
&lt;br /&gt;
Sample Output:&lt;br /&gt;
 [&lt;br /&gt;
   {&lt;br /&gt;
     &amp;quot;repository&amp;quot;: {&lt;br /&gt;
       &amp;quot;defaultBranchRef&amp;quot;: {&lt;br /&gt;
         &amp;quot;target&amp;quot;: {&lt;br /&gt;
           &amp;quot;history&amp;quot;: {&lt;br /&gt;
             &amp;quot;nodes&amp;quot;: [&lt;br /&gt;
               {&lt;br /&gt;
                 &amp;quot;additions&amp;quot;: 0,&lt;br /&gt;
                 &amp;quot;author&amp;quot;: {&lt;br /&gt;
                   &amp;quot;email&amp;quot;: &amp;quot;61797592+Atharva7007@users.noreply.github.com&amp;quot;,&lt;br /&gt;
                   &amp;quot;name&amp;quot;: &amp;quot;Atharva Pansare&amp;quot;,&lt;br /&gt;
                   &amp;quot;user&amp;quot;: {&lt;br /&gt;
                     &amp;quot;login&amp;quot;: &amp;quot;Atharva7007&amp;quot;&lt;br /&gt;
                   }&lt;br /&gt;
                 },&lt;br /&gt;
                 &amp;quot;authoredDate&amp;quot;: &amp;quot;2020-04-03T09:30:17Z&amp;quot;,&lt;br /&gt;
                 &amp;quot;changedFilesIfAvailable&amp;quot;: 1,&lt;br /&gt;
                 &amp;quot;deletions&amp;quot;: 0,&lt;br /&gt;
                 &amp;quot;message&amp;quot;: &amp;quot;Add files via upload&amp;quot;,&lt;br /&gt;
                 &amp;quot;parents&amp;quot;: {&lt;br /&gt;
                   &amp;quot;totalCount&amp;quot;: 1&lt;br /&gt;
                 }&lt;br /&gt;
               }&lt;br /&gt;
             ],&lt;br /&gt;
             &amp;quot;pageInfo&amp;quot;: {&lt;br /&gt;
               &amp;quot;endCursor&amp;quot;: &amp;quot;98ba34a6c62ff6fe7c4d4de5c342a194f72d66e4 0&amp;quot;,&lt;br /&gt;
               &amp;quot;hasNextPage&amp;quot;: true&lt;br /&gt;
             },&lt;br /&gt;
             &amp;quot;totalCount&amp;quot;: 6&lt;br /&gt;
           }&lt;br /&gt;
         }&lt;br /&gt;
       }&lt;br /&gt;
     }&lt;br /&gt;
   }&lt;br /&gt;
 ]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Get details of all contributors in a repo:&lt;br /&gt;
 /api/rest/repository-contributors/&amp;lt;owner&amp;gt;/&amp;lt;repo_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This endpoint fetches the details of all contributors to a specific repository. It takes the repository owner and repository name as parameters. The endpoint retrieves the list of contributors from the GitHub API and returns information about each contributor, such as their username, avatar URL, and permissions within the repository.&lt;br /&gt;
&lt;br /&gt;
Sample Output:&lt;br /&gt;
[&lt;br /&gt;
  {&lt;br /&gt;
    &amp;quot;avatar_url&amp;quot;: &amp;quot;https://avatars.githubusercontent.com/u/61797592?v=4&amp;quot;,&lt;br /&gt;
    &amp;quot;events_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/events{/privacy}&amp;quot;,&lt;br /&gt;
    &amp;quot;followers_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/followers&amp;quot;,&lt;br /&gt;
    &amp;quot;following_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/following{/other_user}&amp;quot;,&lt;br /&gt;
    &amp;quot;gists_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/gists{/gist_id}&amp;quot;,&lt;br /&gt;
    &amp;quot;gravatar_id&amp;quot;: &amp;quot;&amp;quot;,&lt;br /&gt;
    &amp;quot;html_url&amp;quot;: &amp;quot;https://github.com/Atharva7007&amp;quot;,&lt;br /&gt;
    &amp;quot;id&amp;quot;: 61797592,&lt;br /&gt;
    &amp;quot;login&amp;quot;: &amp;quot;Atharva7007&amp;quot;,&lt;br /&gt;
    &amp;quot;node_id&amp;quot;: &amp;quot;MDQ6VXNlcjYxNzk3NTky&amp;quot;,&lt;br /&gt;
    &amp;quot;organizations_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/orgs&amp;quot;,&lt;br /&gt;
    &amp;quot;permissions&amp;quot;: {&lt;br /&gt;
      &amp;quot;admin&amp;quot;: true,&lt;br /&gt;
      &amp;quot;maintain&amp;quot;: true,&lt;br /&gt;
      &amp;quot;pull&amp;quot;: true,&lt;br /&gt;
      &amp;quot;push&amp;quot;: true,&lt;br /&gt;
      &amp;quot;triage&amp;quot;: true&lt;br /&gt;
    },&lt;br /&gt;
    &amp;quot;received_events_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/received_events&amp;quot;,&lt;br /&gt;
    &amp;quot;repos_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/repos&amp;quot;,&lt;br /&gt;
    &amp;quot;role_name&amp;quot;: &amp;quot;admin&amp;quot;,&lt;br /&gt;
    &amp;quot;site_admin&amp;quot;: false,&lt;br /&gt;
    &amp;quot;starred_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/starred{/owner}{/repo}&amp;quot;,&lt;br /&gt;
    &amp;quot;subscriptions_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/subscriptions&amp;quot;,&lt;br /&gt;
    &amp;quot;type&amp;quot;: &amp;quot;User&amp;quot;,&lt;br /&gt;
    &amp;quot;url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Implementation Details==&lt;br /&gt;
The GitHub Miner project consists of two main components: the backend API and the frontend user interface.&lt;br /&gt;
&lt;br /&gt;
The backend API is implemented using Flask, a lightweight Python web framework. It exposes two sets of endpoints: one for GraphQL queries and another for REST API queries. Flask Blueprints are used to route requests to the appropriate endpoints based on the URL path.&lt;br /&gt;
&lt;br /&gt;
The GraphQL implementation utilizes the `graphene` library, which provides a way to define GraphQL schemas and resolvers. The resolvers are responsible for fetching data from the GitHub API using the `pygithub` library.&lt;br /&gt;
&lt;br /&gt;
The REST implementation uses the `requests` library to make HTTP requests to the GitHub API and process the responses.&lt;br /&gt;
&lt;br /&gt;
To ensure reliability and robustness, comprehensive testing strategies, including unit tests and integration tests, have been implemented. These tests validate the functionality of the API endpoints across different scenarios, ensuring the system's correctness and stability.&lt;br /&gt;
&lt;br /&gt;
In the API, we have 2 separate endpoints to retrieve the same data: one for REST and the other using GraphQL queries. To manage this, we have made use of Flask Blueprints where all the &amp;quot;api/graphql&amp;quot; requests get routed to the graphql variants and the &amp;quot;api/rest&amp;quot; requests get routed to the REST variants.&lt;br /&gt;
&lt;br /&gt;
=== Design Patterns used ===&lt;br /&gt;
# The REST API Client '''/backend/app/services/github_query/github_rest/client.py''' is a Singleton.&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;To ensure the reliability and robustness of the GitHub Miner, comprehensive testing strategies, including unit tests and integration tests, have been implemented. These tests validate the functionality of the API endpoints across different scenarios, ensuring the system's correctness and stability. The testing suite covers the following areas:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;1. Unit Tests:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Unit tests have been meticulously developed to evaluate the individual components of the GitHub Miner in isolation. Each test is designed to ensure that every component functions correctly by itself without dependencies, thereby identifying issues in the smallest units of code. This section delves into both the GitHub GraphQL integration and the specific queries used for data retrieval, ensuring comprehensive coverage.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;2. GitHub GraphQL Tests:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;&amp;lt;strong&amp;gt;test_authentication.py&amp;lt;/strong&amp;gt;: Tests the robustness of the authentication system by verifying token handling and refresh mechanisms, critical for maintaining secure access to GitHub data.&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;&amp;lt;strong&amp;gt;test_client.py&amp;lt;/strong&amp;gt;: Assesses the initialization and operational integrity of the GraphQL client, including its error handling capabilities and the accuracy of its response parsing, ensuring the client can reliably communicate with the GitHub API.&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;&amp;lt;strong&amp;gt;test_query.py&amp;lt;/strong&amp;gt;: Evaluates the formation and execution of GraphQL queries and their error handling, confirming that queries are constructed correctly and yield expected results or manage errors gracefully.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;3. Queries Tests:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;&amp;lt;strong&amp;gt;Comments&amp;lt;/strong&amp;gt;: Confirms the precise retrieval and parsing of comments from GitHub repositories, ensuring data integrity and accuracy for user interactions displayed on the platform.&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;&amp;lt;strong&amp;gt;Contributions&amp;lt;/strong&amp;gt;: Verifies the accuracy and completeness of data regarding user contributions such as commits and pull requests, which are pivotal for analytics and tracking user engagement.&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;&amp;lt;strong&amp;gt;Costs&amp;lt;/strong&amp;gt;: Tests the system's ability to calculate API usage costs efficiently, which is essential for managing rate limits and optimizing resource consumption.&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;&amp;lt;strong&amp;gt;Profiles&amp;lt;/strong&amp;gt;: Ensures thorough and accurate fetching and parsing of GitHub user profiles, critical for displaying detailed user data and analytics.&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;&amp;lt;strong&amp;gt;Repositories&amp;lt;/strong&amp;gt;: Validates the accurate retrieval of comprehensive repository information, essential for repository management and data display.&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;&amp;lt;strong&amp;gt;Time Range Contributions&amp;lt;/strong&amp;gt;: Assesses the accuracy of fetching and aggregating contributions within specified time ranges, vital for historical data analysis and trend assessment.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;4. Integration Tests:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Integration tests are designed to verify the effective cooperation between various components of the GitHub Miner. These tests ensure that components work seamlessly together, which is essential for the smooth operation of the system. This testing phase is crucial for assessing the interaction between the frontend and backend components, ensuring data flows correctly through the application and that user actions trigger the appropriate responses in real-time.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;&amp;lt;strong&amp;gt;TestClient&amp;lt;/strong&amp;gt;: Tests the GitHub client's ability to initialize correctly, generate appropriate headers, handle retries, execute queries efficiently, and manage paginated responses, ensuring robustness and reliability in accessing GitHub data.&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;&amp;lt;strong&amp;gt;Authentication Tests&amp;lt;/strong&amp;gt;: Validates the generation of correct authorization headers and proper handling of personal access tokens, crucial for maintaining secure and authorized access to the GitHub API.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;5. Testing Examples:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Here, we provide specific examples of test cases implemented in our project. You can see how we approach testing for both unit and integration levels, focusing on key functionalities and integration points.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;code&amp;gt;&lt;br /&gt;
import pytest&lt;br /&gt;
import requests_mock&lt;br /&gt;
from unittest.mock import MagicMock&lt;br /&gt;
from datetime import datetime, timezone&lt;br /&gt;
from requests.exceptions import Timeout&lt;br /&gt;
from backend.app.services.github_query.github_graphql.client import Client, InvalidAuthenticationError, QueryFailedException&lt;br /&gt;
from backend.app.services.github_query.github_graphql.authentication import PersonalAccessTokenAuthenticator &lt;br /&gt;
from backend.app.services.github_query.github_graphql.query import Query, PaginatedQuery&lt;br /&gt;
from backend.app.services.github_query.github_rest.client import RESTClient&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
@pytest.fixture&lt;br /&gt;
def valid_token():&lt;br /&gt;
    return &amp;quot;valid_token_123&amp;quot;&lt;br /&gt;
&lt;br /&gt;
@pytest.fixture&lt;br /&gt;
def authenticator(valid_token):&lt;br /&gt;
    return PersonalAccessTokenAuthenticator(token=valid_token)&lt;br /&gt;
&lt;br /&gt;
@pytest.fixture&lt;br /&gt;
def github_client(authenticator):&lt;br /&gt;
    return Client(authenticator=authenticator)&lt;br /&gt;
&lt;br /&gt;
class TestClient:&lt;br /&gt;
    def test_client_without_authenticator(self):&lt;br /&gt;
        &amp;quot;&amp;quot;&amp;quot;Test that client raises error when no authenticator is provided&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
        with pytest.raises(InvalidAuthenticationError):&lt;br /&gt;
            Client()  # No authenticator provided&lt;br /&gt;
&lt;br /&gt;
    def test_client_initialization(self, github_client):&lt;br /&gt;
        &amp;quot;&amp;quot;&amp;quot;Test that the client is correctly initialized with the given authenticator&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
        assert github_client._authenticator is not None, &amp;quot;Authenticator should be set.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    def test_client_base_path(self, github_client):&lt;br /&gt;
        &amp;quot;&amp;quot;&amp;quot;Test that the base path is correctly constructed&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
        assert &amp;quot;api.github.com&amp;quot; in github_client._base_path(), &amp;quot;Base path should include the host.&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    def test_generate_headers(self, github_client, authenticator):&lt;br /&gt;
        &amp;quot;&amp;quot;&amp;quot;Test that headers are correctly generated including authorization and additional headers.&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
        additional_headers = {&amp;quot;Custom-Header&amp;quot;: &amp;quot;CustomValue&amp;quot;}&lt;br /&gt;
        expected_headers = authenticator.get_authorization_header()&lt;br /&gt;
        expected_headers.update(additional_headers)&lt;br /&gt;
&lt;br /&gt;
        assert github_client._generate_headers(**additional_headers) == expected_headers, &amp;quot;Headers should include both authenticator and additional headers.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    def test_retry_success(self, github_client, requests_mock):&lt;br /&gt;
        &amp;quot;&amp;quot;&amp;quot;Test that retry_request succeeds after a retry.&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
        # Mock the request to timeout once then succeed&lt;br /&gt;
        requests_mock.register_uri('POST', github_client._base_path(), [&lt;br /&gt;
            {'exc': Timeout},&lt;br /&gt;
            {'json': {'data': 'success'}, 'status_code': 200}&lt;br /&gt;
        ])&lt;br /&gt;
        &lt;br /&gt;
        response = github_client._retry_request(2, 1, &amp;quot;query { viewer { login }}&amp;quot;, {})&lt;br /&gt;
        assert response.json() == {'data': 'success'}, &amp;quot;Should succeed on the second attempt.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    def test_retry_timeout(self, github_client, requests_mock):&lt;br /&gt;
        &amp;quot;&amp;quot;&amp;quot;Test that retry_request gives up after attempts are exhausted.&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
        # Mock the request to timeout&lt;br /&gt;
        requests_mock.register_uri('POST', github_client._base_path(), [&lt;br /&gt;
            {'exc': Timeout},&lt;br /&gt;
            {'exc': Timeout}&lt;br /&gt;
        ])&lt;br /&gt;
        &lt;br /&gt;
        with pytest.raises(Timeout):&lt;br /&gt;
            github_client._retry_request(2, 1, &amp;quot;query { viewer { login }}&amp;quot;, {})&lt;br /&gt;
&lt;br /&gt;
    def test_execute_success(self, github_client, requests_mock):&lt;br /&gt;
        &amp;quot;&amp;quot;&amp;quot;Test successful execution of a query.&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
        # Mock the rate limit pre-check and the actual query execution&lt;br /&gt;
        requests_mock.post(github_client._base_path(), [&lt;br /&gt;
            {'json': {&amp;quot;data&amp;quot;: {&amp;quot;rateLimit&amp;quot;: {&amp;quot;cost&amp;quot;: 1, &amp;quot;remaining&amp;quot;: 5000, &amp;quot;resetAt&amp;quot;: &amp;quot;2021-01-01T00:00:00Z&amp;quot;}}}, 'status_code': 200},&lt;br /&gt;
            {'json': {&amp;quot;data&amp;quot;: &amp;quot;query success&amp;quot;}, 'status_code': 200}&lt;br /&gt;
        ])&lt;br /&gt;
        response = github_client._execute(&amp;quot;query { viewer { login }}&amp;quot;, {})&lt;br /&gt;
        assert response == &amp;quot;query success&amp;quot;, &amp;quot;Execute should return success on valid response.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    def test_execute_rate_limit_exceeded(self, github_client, requests_mock):&lt;br /&gt;
        &amp;quot;&amp;quot;&amp;quot;Test execution of a query leading to waiting for rate limit reset.&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
        # Set specific values for cost, remaining, and resetAt&lt;br /&gt;
        mock_cost = 10&lt;br /&gt;
        mock_remaining = 14  # Ensure remaining - 5 &amp;lt; mock_cost&lt;br /&gt;
        # mock_reset_at = datetime.utcnow().strftime('%Y-%m-%dT%H:%M:%SZ')&lt;br /&gt;
        mock_reset_at = datetime.now(timezone.utc).strftime('%Y-%m-%dT%H:%M:%SZ')&lt;br /&gt;
&lt;br /&gt;
        # Mock rate limit response&lt;br /&gt;
        mock_rate_limit_response = {&lt;br /&gt;
            &amp;quot;data&amp;quot;: {&lt;br /&gt;
                &amp;quot;rateLimit&amp;quot;: {&lt;br /&gt;
                    &amp;quot;cost&amp;quot;: mock_cost,&lt;br /&gt;
                    &amp;quot;remaining&amp;quot;: mock_remaining,&lt;br /&gt;
                    &amp;quot;resetAt&amp;quot;: mock_reset_at&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        # Setup requests_mock to simulate the rate limit response and any subsequent requests&lt;br /&gt;
        base_path = github_client._base_path()&lt;br /&gt;
        requests_mock.post(base_path, [&lt;br /&gt;
            {'json': mock_rate_limit_response, 'status_code': 200},&lt;br /&gt;
            {'json': {&amp;quot;data&amp;quot;: &amp;quot;query success&amp;quot;}, 'status_code': 200}&lt;br /&gt;
        ])&lt;br /&gt;
        response = github_client._execute(&amp;quot;query { viewer { login }}&amp;quot;, {})&lt;br /&gt;
        assert response == &amp;quot;query success&amp;quot;, &amp;quot;Execute should return success on valid response.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    def test_execute_query_failed(self, github_client, requests_mock):&lt;br /&gt;
        &amp;quot;&amp;quot;&amp;quot;Test execution of a query leading to QueryFailedException with retries.&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
        # Mock a failed query response for each retry attempt&lt;br /&gt;
        requests_mock.post(github_client._base_path(), [&lt;br /&gt;
            {'json': {&amp;quot;data&amp;quot;: {&amp;quot;rateLimit&amp;quot;: {&amp;quot;cost&amp;quot;: 1, &amp;quot;remaining&amp;quot;: 5000, &amp;quot;resetAt&amp;quot;: &amp;quot;2021-01-01T00:00:00Z&amp;quot;}}}, 'status_code': 200},&lt;br /&gt;
            {&amp;quot;json&amp;quot;: {&amp;quot;error&amp;quot;: &amp;quot;bad request&amp;quot;}, &amp;quot;status_code&amp;quot;: 400}&lt;br /&gt;
        ])&lt;br /&gt;
        # Expecting QueryFailedException after all retries have been exhausted&lt;br /&gt;
        with pytest.raises(QueryFailedException):&lt;br /&gt;
            github_client._execute(&amp;quot;query { viewer { login }}&amp;quot;, {})&lt;br /&gt;
    &lt;br /&gt;
    def test_execution_generator(self, github_client):&lt;br /&gt;
        &amp;quot;&amp;quot;&amp;quot;Test that _execution_generator correctly handles paginated responses.&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
        # Setup a mock paginated query&lt;br /&gt;
        query = MagicMock()&lt;br /&gt;
        query.paginator.has_next.side_effect = [True, True, False]  # Simulate 2 pages of results, then stop&lt;br /&gt;
        query.path = []  # Example path, adjust based on your actual usage&lt;br /&gt;
&lt;br /&gt;
        # Mock the _execute method to return simulated page results&lt;br /&gt;
        github_client._execute = MagicMock()&lt;br /&gt;
        github_client._execute.side_effect = [&lt;br /&gt;
            {&amp;quot;pageInfo&amp;quot;: {&amp;quot;endCursor&amp;quot;: &amp;quot;cursor1&amp;quot;, &amp;quot;hasNextPage&amp;quot;: True}, &amp;quot;nodes&amp;quot;: [{&amp;quot;edges&amp;quot;: &amp;quot;data1&amp;quot;}]},&lt;br /&gt;
            {&amp;quot;pageInfo&amp;quot;: {&amp;quot;endCursor&amp;quot;: &amp;quot;cursor2&amp;quot;, &amp;quot;hasNextPage&amp;quot;: False}, &amp;quot;nodes&amp;quot;: [{&amp;quot;edges&amp;quot;: &amp;quot;data2&amp;quot;}]}&lt;br /&gt;
        ]&lt;br /&gt;
&lt;br /&gt;
        # Mock the update_paginator method to reflect the changing state of pagination&lt;br /&gt;
        query.paginator.update_paginator = MagicMock()&lt;br /&gt;
&lt;br /&gt;
        # Collect all results from the generator&lt;br /&gt;
        results = list(github_client._execution_generator(query, {}))&lt;br /&gt;
&lt;br /&gt;
        # Assertions&lt;br /&gt;
        assert len(results) == 2, &amp;quot;Should yield two results for the two pages&amp;quot;&lt;br /&gt;
        assert results[0]['nodes'][0]['edges'] == &amp;quot;data1&amp;quot;, &amp;quot;First result should match first mocked response&amp;quot;&lt;br /&gt;
        assert results[1]['nodes'][0]['edges'] == &amp;quot;data2&amp;quot;, &amp;quot;Second result should match second mocked response&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        # Ensure update_paginator was called correctly&lt;br /&gt;
        assert query.paginator.update_paginator.call_count == 2, &amp;quot;update_paginator should be called twice, once per page&amp;quot;&lt;br /&gt;
        query.paginator.update_paginator.assert_called_with(False, &amp;quot;cursor2&amp;quot;)  # Last call should reflect the end of pagination&lt;br /&gt;
&lt;br /&gt;
    def test_client_execute_success(self, github_client, requests_mock):&lt;br /&gt;
        &amp;quot;&amp;quot;&amp;quot;Test successful execution of a query&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
        requests_mock.post(github_client._base_path(), [&lt;br /&gt;
            {'json': {&amp;quot;data&amp;quot;: {&amp;quot;rateLimit&amp;quot;: {&amp;quot;cost&amp;quot;: 1, &amp;quot;remaining&amp;quot;: 5000, &amp;quot;resetAt&amp;quot;: &amp;quot;2021-01-01T00:00:00Z&amp;quot;}}}, 'status_code': 200},&lt;br /&gt;
            {'json': {&amp;quot;data&amp;quot;: &amp;quot;query success&amp;quot;}, 'status_code': 200}&lt;br /&gt;
        ])&lt;br /&gt;
        response = github_client.execute(Query(&amp;quot;query { viewer { login }}&amp;quot;), {})&lt;br /&gt;
        assert response == &amp;quot;query success&amp;quot;, &amp;quot;Execute should return success on valid response.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    def test_client_execute_failed(self, github_client, requests_mock):&lt;br /&gt;
        &amp;quot;&amp;quot;&amp;quot;Test that a failed query raises QueryFailedException&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
        requests_mock.post(github_client._base_path(), [&lt;br /&gt;
            {'json': {&amp;quot;data&amp;quot;: {&amp;quot;rateLimit&amp;quot;: {&amp;quot;cost&amp;quot;: 1, &amp;quot;remaining&amp;quot;: 5000, &amp;quot;resetAt&amp;quot;: &amp;quot;2021-01-01T00:00:00Z&amp;quot;}}}, 'status_code': 200},&lt;br /&gt;
            {&amp;quot;json&amp;quot;: {&amp;quot;error&amp;quot;: &amp;quot;bad request&amp;quot;}, &amp;quot;status_code&amp;quot;: 400}&lt;br /&gt;
        ])&lt;br /&gt;
        with pytest.raises(QueryFailedException) as excinfo:&lt;br /&gt;
            github_client.execute(Query(&amp;quot;query { viewer { login }}&amp;quot;), {})&lt;br /&gt;
        assert &amp;quot;Query failed with code&amp;quot; in str(excinfo.value), &amp;quot;QueryFailedException should contain the right error message.&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;These tests collectively ensure that the GitHub Miner operates reliably, providing accurate and timely data from GitHub's APIs. By covering a wide range of scenarios, from successful queries to error handling and rate limiting, the tests ensure that the application can be used confidently in production environments.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Live Demo &amp;amp; Source Code==&lt;br /&gt;
http://152.7.177.239:5000/auth/login Link]&lt;br /&gt;
(Please login using your personal GitHub accounts, not NCSU accounts)&lt;br /&gt;
&lt;br /&gt;
[https://github.ncsu.edu/slimbur/GH_Miner Source Code]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
Atharva Pansare&lt;br /&gt;
&lt;br /&gt;
Sumedh Limburkar&lt;br /&gt;
&lt;br /&gt;
Viraj Sanap&lt;br /&gt;
&lt;br /&gt;
Mengning Li&lt;br /&gt;
&lt;br /&gt;
Mentor: Jialin Cui&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
GitHub REST API documentation - https://docs.github.com/en/rest?apiVersion=2022-11-28&lt;/div&gt;</summary>
		<author><name>Slimbur</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_G2402_Implement_REST_client,_REST_API,_and_Graphql_API_endpoint_for_repositories_-_Part_2&amp;diff=156960</id>
		<title>CSC/ECE 517 Spring 2024 - G2402 Implement REST client, REST API, and Graphql API endpoint for repositories - Part 2</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_G2402_Implement_REST_client,_REST_API,_and_Graphql_API_endpoint_for_repositories_-_Part_2&amp;diff=156960"/>
		<updated>2024-04-29T16:16:21Z</updated>

		<summary type="html">&lt;p&gt;Slimbur: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
== Project Objective ==&lt;br /&gt;
This project aims to create a robust tool enabling users to access and analyze their GitHub metrics conveniently. The phase one objective was to develop API endpoints leveraging GitHub GraphQL and GitHub REST queries within a Python Flask framework. This involves integrating Flask with existing code to expose GraphQL queries as API endpoints, building a REST client, and establishing REST endpoints for streamlined data retrieval. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Subsequently, in phase two of the project, each API endpoint established in the initial phase will be complemented with a React-based frontend. This frontend will be specifically designed to visualize and present the GitHub data retrieved through these endpoints in an intuitive user interface. The goal is to seamlessly integrate backend functionality with frontend design to enhance user interaction and data presentation.&lt;br /&gt;
&lt;br /&gt;
==Demo==&lt;br /&gt;
https://www.youtube.com/watch?v=5g_WtZqLE9A&lt;br /&gt;
&lt;br /&gt;
==Below is the MVC architecture of our GitHub project:==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:MVC2.drawio.png|900px|Image : 900 pixels]]&lt;br /&gt;
&lt;br /&gt;
==Plan of Work==&lt;br /&gt;
In the second phase of the project, we will focus on developing a robust and user-friendly frontend using React. The frontend will serve as an intuitive interface for displaying and interacting with the data retrieved from the GitHub API endpoints implemented in the first phase.&lt;br /&gt;
&lt;br /&gt;
The plan includes the following key steps:&lt;br /&gt;
&lt;br /&gt;
1. &amp;lt;b&amp;gt;Setup React Environment&amp;lt;/b&amp;gt;: &lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Selecting Tooling and Libraries: Choose an appropriate React setup such as Create React App for rapid development or Next.js for server-side rendering and enhanced performance.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Dependency Management: Use npm or Yarn to manage project dependencies, including React, ReactDOM, and additional libraries for state management (Redux, Recoil), routing (React Router), and styling (styled-components, Tailwind CSS).&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Project Structure: Organize the project structure with components, containers, services, and utility folders to maintain a scalable and maintainable codebase.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &amp;lt;b&amp;gt;Design UI Components&amp;lt;/b&amp;gt;:&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Translate the data from the API endpoints into interactive React components, focusing on usability and accessibility standards.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Component Composition: Create reusable and composable UI components following component-based design principles, leveraging hooks (useState, useEffect) for managing state and side effects.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Styling: Implement consistent styling using CSS-in-JS solutions like styled-components or CSS modules, ensuring modular and scoped styles for each component.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. &amp;lt;b&amp;gt;Integrate with API Endpoints&amp;lt;/b&amp;gt;: &lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;HTTP Requests: Use Axios or Fetch API to handle asynchronous data fetching from the backend API endpoints implemented in phase one.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;State Management: Implement state management (e.g., Redux, Context API) to store and manage fetched data centrally across components, ensuring efficient data flow and reactivity.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Optimizing Performance: Implement memoization techniques (e.g., useMemo, useCallback) to optimize re-renders and reduce unnecessary API calls.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. &amp;lt;b&amp;gt;Implement Pagination&amp;lt;/b&amp;gt;: &lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Pagination Logic: Develop pagination logic to manage and display large datasets in manageable chunks, adhering to RESTful API standards for page-based navigation.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;UI Components: Create pagination controls (e.g., buttons, page indicators) to allow users to navigate through paginated data smoothly, updating the UI dynamically based on user interactions.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. &amp;lt;b&amp;gt;Enhance User Experience&amp;lt;/b&amp;gt;: &lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We will focus on improving the user experience by adding features such as search functionality, filtering, sorting, and other relevant enhancements based on the data being displayed. These enhancements will empower users to interact with the data more effectively and derive valuable insights.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Interactive Visualizations: Integrate interactive charts (e.g., using Chart.js, D3.js) to visually represent data trends and insights, enhancing user engagement and understanding.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
6. &amp;lt;b&amp;gt;Test and Debug&amp;lt;/b&amp;gt;: &lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Unit Testing: Write unit tests using Jest and React Testing Library to ensure individual components render correctly and exhibit expected behavior based on props and state.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Integration Testing: Conduct integration tests to validate API integrations, data flow, and interactions between frontend components.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Cross-Browser Compatibility: Perform cross-browser testing (e.g., Chrome, Firefox, Safari) and responsive testing to ensure consistent rendering and functionality across different browsers and devices.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
7. &amp;lt;b&amp;gt;Deploy and Document&amp;lt;/b&amp;gt;: Finally, we will deploy the React frontend to a hosting platform, ensuring it is accessible and easily usable by end-users. Comprehensive documentation will be provided, including instructions for setup, usage, and any relevant information for future maintenance and development.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
==Frontend==&lt;br /&gt;
As shown below, we plan to display contributors' individual contribution and commit count. We will be implementing the UI using ReactJS &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Login_ss.png|900px|Image : 900 pixels]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Commits page with number of commits&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:User_ss.png|900px|Image : 900 pixels]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Contributors ss.png|900px|Image : 900 pixels]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Table ss.png|900px|Image : 900 pixels]]&lt;br /&gt;
&lt;br /&gt;
==GraphQL Endpoints==&lt;br /&gt;
&lt;br /&gt;
Get current user login:&lt;br /&gt;
 /api/graphql/current-user-login&lt;br /&gt;
&lt;br /&gt;
Sample Output:&lt;br /&gt;
 {&lt;br /&gt;
   &amp;quot;viewer&amp;quot;: {&lt;br /&gt;
     &amp;quot;login&amp;quot;: &amp;quot;&amp;lt;your-username&amp;gt;&amp;quot;&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Get specific user login:&lt;br /&gt;
 /api/graphql/user-login/&amp;lt;username&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get list of all commits in a repo:&lt;br /&gt;
 /api/graphql/specific-user-commits/&amp;lt;owner&amp;gt;/&amp;lt;repo_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sample Output:&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;repository&amp;quot;: {&lt;br /&gt;
      &amp;quot;defaultBranchRef&amp;quot;: {&lt;br /&gt;
        &amp;quot;target&amp;quot;: {&lt;br /&gt;
          &amp;quot;history&amp;quot;: {&lt;br /&gt;
            &amp;quot;nodes&amp;quot;: [&lt;br /&gt;
              {&lt;br /&gt;
                &amp;quot;additions&amp;quot;: 0,&lt;br /&gt;
                &amp;quot;author&amp;quot;: {&lt;br /&gt;
                  &amp;quot;email&amp;quot;: &amp;quot;61797592+Atharva7007@users.noreply.github.com&amp;quot;,&lt;br /&gt;
                  &amp;quot;name&amp;quot;: &amp;quot;Atharva Pansare&amp;quot;,&lt;br /&gt;
                  &amp;quot;user&amp;quot;: {&lt;br /&gt;
                    &amp;quot;login&amp;quot;: &amp;quot;Atharva7007&amp;quot;&lt;br /&gt;
                  }&lt;br /&gt;
                },&lt;br /&gt;
                &amp;quot;authoredDate&amp;quot;: &amp;quot;2020-04-03T09:30:17Z&amp;quot;,&lt;br /&gt;
                &amp;quot;changedFilesIfAvailable&amp;quot;: 1,&lt;br /&gt;
                &amp;quot;deletions&amp;quot;: 0,&lt;br /&gt;
                &amp;quot;message&amp;quot;: &amp;quot;Add files via upload&amp;quot;,&lt;br /&gt;
                &amp;quot;parents&amp;quot;: {&lt;br /&gt;
                  &amp;quot;totalCount&amp;quot;: 1&lt;br /&gt;
                }&lt;br /&gt;
              }&lt;br /&gt;
            ],&lt;br /&gt;
            &amp;quot;pageInfo&amp;quot;: {&lt;br /&gt;
              &amp;quot;endCursor&amp;quot;: &amp;quot;98ba34a6c62ff6fe7c4d4de5c342a194f72d66e4 0&amp;quot;,&lt;br /&gt;
              &amp;quot;hasNextPage&amp;quot;: true&lt;br /&gt;
            },&lt;br /&gt;
            &amp;quot;totalCount&amp;quot;: 6&lt;br /&gt;
          }&lt;br /&gt;
        }&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
Get details of all contributors in a repo:&lt;br /&gt;
 /api/graphql/repository-contributors/&amp;lt;owner&amp;gt;/&amp;lt;repo_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sample Output:&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;repository&amp;quot;: {&lt;br /&gt;
      &amp;quot;defaultBranchRef&amp;quot;: {&lt;br /&gt;
        &amp;quot;target&amp;quot;: {&lt;br /&gt;
          &amp;quot;history&amp;quot;: {&lt;br /&gt;
            &amp;quot;nodes&amp;quot;: [&lt;br /&gt;
              {&lt;br /&gt;
                &amp;quot;author&amp;quot;: {&lt;br /&gt;
                  &amp;quot;email&amp;quot;: &amp;quot;61797592+Atharva7007@users.noreply.github.com&amp;quot;,&lt;br /&gt;
                  &amp;quot;name&amp;quot;: &amp;quot;Atharva Pansare&amp;quot;,&lt;br /&gt;
                  &amp;quot;user&amp;quot;: {&lt;br /&gt;
                    &amp;quot;login&amp;quot;: &amp;quot;Atharva7007&amp;quot;&lt;br /&gt;
                  }&lt;br /&gt;
                }&lt;br /&gt;
              }&lt;br /&gt;
            ],&lt;br /&gt;
            &amp;quot;pageInfo&amp;quot;: {&lt;br /&gt;
              &amp;quot;endCursor&amp;quot;: &amp;quot;98ba34a6c62ff6fe7c4d4de5c342a194f72d66e4 0&amp;quot;,&lt;br /&gt;
              &amp;quot;hasNextPage&amp;quot;: true&lt;br /&gt;
            },&lt;br /&gt;
            &amp;quot;totalCount&amp;quot;: 6&lt;br /&gt;
          }&lt;br /&gt;
        }&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
==REST API Endpoints==&lt;br /&gt;
Get current user login:&lt;br /&gt;
 /api/rest/current-user-login-rest&lt;br /&gt;
&lt;br /&gt;
This endpoint retrieves the login information of the currently authenticated user. It fetches the user's profile data from the GitHub API and returns details such as their username, avatar URL, and other relevant information.&lt;br /&gt;
&lt;br /&gt;
Sample Output:&lt;br /&gt;
 {&lt;br /&gt;
   &amp;quot;avatar_url&amp;quot;: &amp;quot;https://avatars.githubusercontent.com/u/61797592?v=4&amp;quot;,&lt;br /&gt;
   &amp;quot;bio&amp;quot;: null,&lt;br /&gt;
   &amp;quot;blog&amp;quot;: &amp;quot;&amp;quot;,&lt;br /&gt;
   &amp;quot;company&amp;quot;: null,&lt;br /&gt;
   &amp;quot;created_at&amp;quot;: &amp;quot;2020-03-04T16:49:06Z&amp;quot;,&lt;br /&gt;
   &amp;quot;email&amp;quot;: null,&lt;br /&gt;
   &amp;quot;events_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/events{/privacy}&amp;quot;,&lt;br /&gt;
   &amp;quot;followers&amp;quot;: 1,&lt;br /&gt;
   &amp;quot;followers_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/followers&amp;quot;,&lt;br /&gt;
   &amp;quot;following&amp;quot;: 3,&lt;br /&gt;
   &amp;quot;following_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/following{/other_user}&amp;quot;,&lt;br /&gt;
   &amp;quot;gists_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/gists{/gist_id}&amp;quot;,&lt;br /&gt;
   &amp;quot;gravatar_id&amp;quot;: &amp;quot;&amp;quot;,&lt;br /&gt;
   &amp;quot;hireable&amp;quot;: null,&lt;br /&gt;
   &amp;quot;html_url&amp;quot;: &amp;quot;https://github.com/Atharva7007&amp;quot;,&lt;br /&gt;
   &amp;quot;id&amp;quot;: 61797592,&lt;br /&gt;
   &amp;quot;location&amp;quot;: null,&lt;br /&gt;
   &amp;quot;login&amp;quot;: &amp;quot;Atharva7007&amp;quot;,&lt;br /&gt;
   &amp;quot;name&amp;quot;: &amp;quot;Atharva Pansare&amp;quot;,&lt;br /&gt;
   &amp;quot;node_id&amp;quot;: &amp;quot;MDQ6VXNlcjYxNzk3NTky&amp;quot;,&lt;br /&gt;
   &amp;quot;organizations_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/orgs&amp;quot;,&lt;br /&gt;
   &amp;quot;public_gists&amp;quot;: 0,&lt;br /&gt;
   &amp;quot;public_repos&amp;quot;: 11,&lt;br /&gt;
   &amp;quot;received_events_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/received_events&amp;quot;,&lt;br /&gt;
   &amp;quot;repos_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/repos&amp;quot;,&lt;br /&gt;
   &amp;quot;site_admin&amp;quot;: false,&lt;br /&gt;
   &amp;quot;starred_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/starred{/owner}{/repo}&amp;quot;,&lt;br /&gt;
   &amp;quot;subscriptions_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/subscriptions&amp;quot;,&lt;br /&gt;
   &amp;quot;twitter_username&amp;quot;: null,&lt;br /&gt;
   &amp;quot;type&amp;quot;: &amp;quot;User&amp;quot;,&lt;br /&gt;
   &amp;quot;updated_at&amp;quot;: &amp;quot;2024-03-14T19:03:46Z&amp;quot;,&lt;br /&gt;
   &amp;quot;url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007&amp;quot;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Get list of all commits in a repo:&lt;br /&gt;
 /api/rest/specific-user-commits/&amp;lt;owner&amp;gt;/&amp;lt;repo_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This endpoint retrieves a list of all commits made to a specific repository. It takes the repository owner and repository name as parameters. The endpoint fetches the commit history from the GitHub API and returns details about each commit, such as the author, commit message, and changes made.&lt;br /&gt;
&lt;br /&gt;
Sample Output:&lt;br /&gt;
 [&lt;br /&gt;
   {&lt;br /&gt;
     &amp;quot;repository&amp;quot;: {&lt;br /&gt;
       &amp;quot;defaultBranchRef&amp;quot;: {&lt;br /&gt;
         &amp;quot;target&amp;quot;: {&lt;br /&gt;
           &amp;quot;history&amp;quot;: {&lt;br /&gt;
             &amp;quot;nodes&amp;quot;: [&lt;br /&gt;
               {&lt;br /&gt;
                 &amp;quot;additions&amp;quot;: 0,&lt;br /&gt;
                 &amp;quot;author&amp;quot;: {&lt;br /&gt;
                   &amp;quot;email&amp;quot;: &amp;quot;61797592+Atharva7007@users.noreply.github.com&amp;quot;,&lt;br /&gt;
                   &amp;quot;name&amp;quot;: &amp;quot;Atharva Pansare&amp;quot;,&lt;br /&gt;
                   &amp;quot;user&amp;quot;: {&lt;br /&gt;
                     &amp;quot;login&amp;quot;: &amp;quot;Atharva7007&amp;quot;&lt;br /&gt;
                   }&lt;br /&gt;
                 },&lt;br /&gt;
                 &amp;quot;authoredDate&amp;quot;: &amp;quot;2020-04-03T09:30:17Z&amp;quot;,&lt;br /&gt;
                 &amp;quot;changedFilesIfAvailable&amp;quot;: 1,&lt;br /&gt;
                 &amp;quot;deletions&amp;quot;: 0,&lt;br /&gt;
                 &amp;quot;message&amp;quot;: &amp;quot;Add files via upload&amp;quot;,&lt;br /&gt;
                 &amp;quot;parents&amp;quot;: {&lt;br /&gt;
                   &amp;quot;totalCount&amp;quot;: 1&lt;br /&gt;
                 }&lt;br /&gt;
               }&lt;br /&gt;
             ],&lt;br /&gt;
             &amp;quot;pageInfo&amp;quot;: {&lt;br /&gt;
               &amp;quot;endCursor&amp;quot;: &amp;quot;98ba34a6c62ff6fe7c4d4de5c342a194f72d66e4 0&amp;quot;,&lt;br /&gt;
               &amp;quot;hasNextPage&amp;quot;: true&lt;br /&gt;
             },&lt;br /&gt;
             &amp;quot;totalCount&amp;quot;: 6&lt;br /&gt;
           }&lt;br /&gt;
         }&lt;br /&gt;
       }&lt;br /&gt;
     }&lt;br /&gt;
   }&lt;br /&gt;
 ]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Get details of all contributors in a repo:&lt;br /&gt;
 /api/rest/repository-contributors/&amp;lt;owner&amp;gt;/&amp;lt;repo_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This endpoint fetches the details of all contributors to a specific repository. It takes the repository owner and repository name as parameters. The endpoint retrieves the list of contributors from the GitHub API and returns information about each contributor, such as their username, avatar URL, and permissions within the repository.&lt;br /&gt;
&lt;br /&gt;
Sample Output:&lt;br /&gt;
[&lt;br /&gt;
  {&lt;br /&gt;
    &amp;quot;avatar_url&amp;quot;: &amp;quot;https://avatars.githubusercontent.com/u/61797592?v=4&amp;quot;,&lt;br /&gt;
    &amp;quot;events_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/events{/privacy}&amp;quot;,&lt;br /&gt;
    &amp;quot;followers_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/followers&amp;quot;,&lt;br /&gt;
    &amp;quot;following_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/following{/other_user}&amp;quot;,&lt;br /&gt;
    &amp;quot;gists_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/gists{/gist_id}&amp;quot;,&lt;br /&gt;
    &amp;quot;gravatar_id&amp;quot;: &amp;quot;&amp;quot;,&lt;br /&gt;
    &amp;quot;html_url&amp;quot;: &amp;quot;https://github.com/Atharva7007&amp;quot;,&lt;br /&gt;
    &amp;quot;id&amp;quot;: 61797592,&lt;br /&gt;
    &amp;quot;login&amp;quot;: &amp;quot;Atharva7007&amp;quot;,&lt;br /&gt;
    &amp;quot;node_id&amp;quot;: &amp;quot;MDQ6VXNlcjYxNzk3NTky&amp;quot;,&lt;br /&gt;
    &amp;quot;organizations_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/orgs&amp;quot;,&lt;br /&gt;
    &amp;quot;permissions&amp;quot;: {&lt;br /&gt;
      &amp;quot;admin&amp;quot;: true,&lt;br /&gt;
      &amp;quot;maintain&amp;quot;: true,&lt;br /&gt;
      &amp;quot;pull&amp;quot;: true,&lt;br /&gt;
      &amp;quot;push&amp;quot;: true,&lt;br /&gt;
      &amp;quot;triage&amp;quot;: true&lt;br /&gt;
    },&lt;br /&gt;
    &amp;quot;received_events_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/received_events&amp;quot;,&lt;br /&gt;
    &amp;quot;repos_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/repos&amp;quot;,&lt;br /&gt;
    &amp;quot;role_name&amp;quot;: &amp;quot;admin&amp;quot;,&lt;br /&gt;
    &amp;quot;site_admin&amp;quot;: false,&lt;br /&gt;
    &amp;quot;starred_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/starred{/owner}{/repo}&amp;quot;,&lt;br /&gt;
    &amp;quot;subscriptions_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/subscriptions&amp;quot;,&lt;br /&gt;
    &amp;quot;type&amp;quot;: &amp;quot;User&amp;quot;,&lt;br /&gt;
    &amp;quot;url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Implementation Details==&lt;br /&gt;
The GitHub Miner project consists of two main components: the backend API and the frontend user interface.&lt;br /&gt;
&lt;br /&gt;
The backend API is implemented using Flask, a lightweight Python web framework. It exposes two sets of endpoints: one for GraphQL queries and another for REST API queries. Flask Blueprints are used to route requests to the appropriate endpoints based on the URL path.&lt;br /&gt;
&lt;br /&gt;
The GraphQL implementation utilizes the `graphene` library, which provides a way to define GraphQL schemas and resolvers. The resolvers are responsible for fetching data from the GitHub API using the `pygithub` library.&lt;br /&gt;
&lt;br /&gt;
The REST implementation uses the `requests` library to make HTTP requests to the GitHub API and process the responses.&lt;br /&gt;
&lt;br /&gt;
To ensure reliability and robustness, comprehensive testing strategies, including unit tests and integration tests, have been implemented. These tests validate the functionality of the API endpoints across different scenarios, ensuring the system's correctness and stability.&lt;br /&gt;
&lt;br /&gt;
In the API, we have 2 separate endpoints to retrieve the same data: one for REST and the other using GraphQL queries. To manage this, we have made use of Flask Blueprints where all the &amp;quot;api/graphql&amp;quot; requests get routed to the graphql variants and the &amp;quot;api/rest&amp;quot; requests get routed to the REST variants.&lt;br /&gt;
&lt;br /&gt;
=== Design Patterns used ===&lt;br /&gt;
# The REST API Client '''/backend/app/services/github_query/github_rest/client.py''' is a Singleton.&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;To ensure the reliability and robustness of the GitHub Miner, comprehensive testing strategies, including unit tests and integration tests, have been implemented. These tests validate the functionality of the API endpoints across different scenarios, ensuring the system's correctness and stability. The testing suite covers the following areas:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;1. Unit Tests:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Unit tests have been meticulously developed to evaluate the individual components of the GitHub Miner in isolation. Each test is designed to ensure that every component functions correctly by itself without dependencies, thereby identifying issues in the smallest units of code. This section delves into both the GitHub GraphQL integration and the specific queries used for data retrieval, ensuring comprehensive coverage.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;2. GitHub GraphQL Tests:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;&amp;lt;strong&amp;gt;test_authentication.py&amp;lt;/strong&amp;gt;: Tests the robustness of the authentication system by verifying token handling and refresh mechanisms, critical for maintaining secure access to GitHub data.&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;&amp;lt;strong&amp;gt;test_client.py&amp;lt;/strong&amp;gt;: Assesses the initialization and operational integrity of the GraphQL client, including its error handling capabilities and the accuracy of its response parsing, ensuring the client can reliably communicate with the GitHub API.&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;&amp;lt;strong&amp;gt;test_query.py&amp;lt;/strong&amp;gt;: Evaluates the formation and execution of GraphQL queries and their error handling, confirming that queries are constructed correctly and yield expected results or manage errors gracefully.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;3. Queries Tests:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;&amp;lt;strong&amp;gt;Comments&amp;lt;/strong&amp;gt;: Confirms the precise retrieval and parsing of comments from GitHub repositories, ensuring data integrity and accuracy for user interactions displayed on the platform.&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;&amp;lt;strong&amp;gt;Contributions&amp;lt;/strong&amp;gt;: Verifies the accuracy and completeness of data regarding user contributions such as commits and pull requests, which are pivotal for analytics and tracking user engagement.&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;&amp;lt;strong&amp;gt;Costs&amp;lt;/strong&amp;gt;: Tests the system's ability to calculate API usage costs efficiently, which is essential for managing rate limits and optimizing resource consumption.&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;&amp;lt;strong&amp;gt;Profiles&amp;lt;/strong&amp;gt;: Ensures thorough and accurate fetching and parsing of GitHub user profiles, critical for displaying detailed user data and analytics.&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;&amp;lt;strong&amp;gt;Repositories&amp;lt;/strong&amp;gt;: Validates the accurate retrieval of comprehensive repository information, essential for repository management and data display.&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;&amp;lt;strong&amp;gt;Time Range Contributions&amp;lt;/strong&amp;gt;: Assesses the accuracy of fetching and aggregating contributions within specified time ranges, vital for historical data analysis and trend assessment.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;4. Integration Tests:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Integration tests are designed to verify the effective cooperation between various components of the GitHub Miner. These tests ensure that components work seamlessly together, which is essential for the smooth operation of the system. This testing phase is crucial for assessing the interaction between the frontend and backend components, ensuring data flows correctly through the application and that user actions trigger the appropriate responses in real-time.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;&amp;lt;strong&amp;gt;TestClient&amp;lt;/strong&amp;gt;: Tests the GitHub client's ability to initialize correctly, generate appropriate headers, handle retries, execute queries efficiently, and manage paginated responses, ensuring robustness and reliability in accessing GitHub data.&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;&amp;lt;strong&amp;gt;Authentication Tests&amp;lt;/strong&amp;gt;: Validates the generation of correct authorization headers and proper handling of personal access tokens, crucial for maintaining secure and authorized access to the GitHub API.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;5. Testing Examples:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Here, we provide specific examples of test cases implemented in our project. You can see how we approach testing for both unit and integration levels, focusing on key functionalities and integration points.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;code&amp;gt;&lt;br /&gt;
import pytest&lt;br /&gt;
import requests_mock&lt;br /&gt;
from unittest.mock import MagicMock&lt;br /&gt;
from datetime import datetime, timezone&lt;br /&gt;
from requests.exceptions import Timeout&lt;br /&gt;
from backend.app.services.github_query.github_graphql.client import Client, InvalidAuthenticationError, QueryFailedException&lt;br /&gt;
from backend.app.services.github_query.github_graphql.authentication import PersonalAccessTokenAuthenticator &lt;br /&gt;
from backend.app.services.github_query.github_graphql.query import Query, PaginatedQuery&lt;br /&gt;
from backend.app.services.github_query.github_rest.client import RESTClient&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
@pytest.fixture&lt;br /&gt;
def valid_token():&lt;br /&gt;
    return &amp;quot;valid_token_123&amp;quot;&lt;br /&gt;
&lt;br /&gt;
@pytest.fixture&lt;br /&gt;
def authenticator(valid_token):&lt;br /&gt;
    return PersonalAccessTokenAuthenticator(token=valid_token)&lt;br /&gt;
&lt;br /&gt;
@pytest.fixture&lt;br /&gt;
def github_client(authenticator):&lt;br /&gt;
    return Client(authenticator=authenticator)&lt;br /&gt;
&lt;br /&gt;
class TestClient:&lt;br /&gt;
    def test_client_without_authenticator(self):&lt;br /&gt;
        &amp;quot;&amp;quot;&amp;quot;Test that client raises error when no authenticator is provided&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
        with pytest.raises(InvalidAuthenticationError):&lt;br /&gt;
            Client()  # No authenticator provided&lt;br /&gt;
&lt;br /&gt;
    def test_client_initialization(self, github_client):&lt;br /&gt;
        &amp;quot;&amp;quot;&amp;quot;Test that the client is correctly initialized with the given authenticator&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
        assert github_client._authenticator is not None, &amp;quot;Authenticator should be set.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    def test_client_base_path(self, github_client):&lt;br /&gt;
        &amp;quot;&amp;quot;&amp;quot;Test that the base path is correctly constructed&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
        assert &amp;quot;api.github.com&amp;quot; in github_client._base_path(), &amp;quot;Base path should include the host.&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    def test_generate_headers(self, github_client, authenticator):&lt;br /&gt;
        &amp;quot;&amp;quot;&amp;quot;Test that headers are correctly generated including authorization and additional headers.&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
        additional_headers = {&amp;quot;Custom-Header&amp;quot;: &amp;quot;CustomValue&amp;quot;}&lt;br /&gt;
        expected_headers = authenticator.get_authorization_header()&lt;br /&gt;
        expected_headers.update(additional_headers)&lt;br /&gt;
&lt;br /&gt;
        assert github_client._generate_headers(**additional_headers) == expected_headers, &amp;quot;Headers should include both authenticator and additional headers.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    def test_retry_success(self, github_client, requests_mock):&lt;br /&gt;
        &amp;quot;&amp;quot;&amp;quot;Test that retry_request succeeds after a retry.&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
        # Mock the request to timeout once then succeed&lt;br /&gt;
        requests_mock.register_uri('POST', github_client._base_path(), [&lt;br /&gt;
            {'exc': Timeout},&lt;br /&gt;
            {'json': {'data': 'success'}, 'status_code': 200}&lt;br /&gt;
        ])&lt;br /&gt;
        &lt;br /&gt;
        response = github_client._retry_request(2, 1, &amp;quot;query { viewer { login }}&amp;quot;, {})&lt;br /&gt;
        assert response.json() == {'data': 'success'}, &amp;quot;Should succeed on the second attempt.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    def test_retry_timeout(self, github_client, requests_mock):&lt;br /&gt;
        &amp;quot;&amp;quot;&amp;quot;Test that retry_request gives up after attempts are exhausted.&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
        # Mock the request to timeout&lt;br /&gt;
        requests_mock.register_uri('POST', github_client._base_path(), [&lt;br /&gt;
            {'exc': Timeout},&lt;br /&gt;
            {'exc': Timeout}&lt;br /&gt;
        ])&lt;br /&gt;
        &lt;br /&gt;
        with pytest.raises(Timeout):&lt;br /&gt;
            github_client._retry_request(2, 1, &amp;quot;query { viewer { login }}&amp;quot;, {})&lt;br /&gt;
&lt;br /&gt;
    def test_execute_success(self, github_client, requests_mock):&lt;br /&gt;
        &amp;quot;&amp;quot;&amp;quot;Test successful execution of a query.&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
        # Mock the rate limit pre-check and the actual query execution&lt;br /&gt;
        requests_mock.post(github_client._base_path(), [&lt;br /&gt;
            {'json': {&amp;quot;data&amp;quot;: {&amp;quot;rateLimit&amp;quot;: {&amp;quot;cost&amp;quot;: 1, &amp;quot;remaining&amp;quot;: 5000, &amp;quot;resetAt&amp;quot;: &amp;quot;2021-01-01T00:00:00Z&amp;quot;}}}, 'status_code': 200},&lt;br /&gt;
            {'json': {&amp;quot;data&amp;quot;: &amp;quot;query success&amp;quot;}, 'status_code': 200}&lt;br /&gt;
        ])&lt;br /&gt;
        response = github_client._execute(&amp;quot;query { viewer { login }}&amp;quot;, {})&lt;br /&gt;
        assert response == &amp;quot;query success&amp;quot;, &amp;quot;Execute should return success on valid response.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    def test_execute_rate_limit_exceeded(self, github_client, requests_mock):&lt;br /&gt;
        &amp;quot;&amp;quot;&amp;quot;Test execution of a query leading to waiting for rate limit reset.&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
        # Set specific values for cost, remaining, and resetAt&lt;br /&gt;
        mock_cost = 10&lt;br /&gt;
        mock_remaining = 14  # Ensure remaining - 5 &amp;lt; mock_cost&lt;br /&gt;
        # mock_reset_at = datetime.utcnow().strftime('%Y-%m-%dT%H:%M:%SZ')&lt;br /&gt;
        mock_reset_at = datetime.now(timezone.utc).strftime('%Y-%m-%dT%H:%M:%SZ')&lt;br /&gt;
&lt;br /&gt;
        # Mock rate limit response&lt;br /&gt;
        mock_rate_limit_response = {&lt;br /&gt;
            &amp;quot;data&amp;quot;: {&lt;br /&gt;
                &amp;quot;rateLimit&amp;quot;: {&lt;br /&gt;
                    &amp;quot;cost&amp;quot;: mock_cost,&lt;br /&gt;
                    &amp;quot;remaining&amp;quot;: mock_remaining,&lt;br /&gt;
                    &amp;quot;resetAt&amp;quot;: mock_reset_at&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        # Setup requests_mock to simulate the rate limit response and any subsequent requests&lt;br /&gt;
        base_path = github_client._base_path()&lt;br /&gt;
        requests_mock.post(base_path, [&lt;br /&gt;
            {'json': mock_rate_limit_response, 'status_code': 200},&lt;br /&gt;
            {'json': {&amp;quot;data&amp;quot;: &amp;quot;query success&amp;quot;}, 'status_code': 200}&lt;br /&gt;
        ])&lt;br /&gt;
        response = github_client._execute(&amp;quot;query { viewer { login }}&amp;quot;, {})&lt;br /&gt;
        assert response == &amp;quot;query success&amp;quot;, &amp;quot;Execute should return success on valid response.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    def test_execute_query_failed(self, github_client, requests_mock):&lt;br /&gt;
        &amp;quot;&amp;quot;&amp;quot;Test execution of a query leading to QueryFailedException with retries.&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
        # Mock a failed query response for each retry attempt&lt;br /&gt;
        requests_mock.post(github_client._base_path(), [&lt;br /&gt;
            {'json': {&amp;quot;data&amp;quot;: {&amp;quot;rateLimit&amp;quot;: {&amp;quot;cost&amp;quot;: 1, &amp;quot;remaining&amp;quot;: 5000, &amp;quot;resetAt&amp;quot;: &amp;quot;2021-01-01T00:00:00Z&amp;quot;}}}, 'status_code': 200},&lt;br /&gt;
            {&amp;quot;json&amp;quot;: {&amp;quot;error&amp;quot;: &amp;quot;bad request&amp;quot;}, &amp;quot;status_code&amp;quot;: 400}&lt;br /&gt;
        ])&lt;br /&gt;
        # Expecting QueryFailedException after all retries have been exhausted&lt;br /&gt;
        with pytest.raises(QueryFailedException):&lt;br /&gt;
            github_client._execute(&amp;quot;query { viewer { login }}&amp;quot;, {})&lt;br /&gt;
    &lt;br /&gt;
    def test_execution_generator(self, github_client):&lt;br /&gt;
        &amp;quot;&amp;quot;&amp;quot;Test that _execution_generator correctly handles paginated responses.&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
        # Setup a mock paginated query&lt;br /&gt;
        query = MagicMock()&lt;br /&gt;
        query.paginator.has_next.side_effect = [True, True, False]  # Simulate 2 pages of results, then stop&lt;br /&gt;
        query.path = []  # Example path, adjust based on your actual usage&lt;br /&gt;
&lt;br /&gt;
        # Mock the _execute method to return simulated page results&lt;br /&gt;
        github_client._execute = MagicMock()&lt;br /&gt;
        github_client._execute.side_effect = [&lt;br /&gt;
            {&amp;quot;pageInfo&amp;quot;: {&amp;quot;endCursor&amp;quot;: &amp;quot;cursor1&amp;quot;, &amp;quot;hasNextPage&amp;quot;: True}, &amp;quot;nodes&amp;quot;: [{&amp;quot;edges&amp;quot;: &amp;quot;data1&amp;quot;}]},&lt;br /&gt;
            {&amp;quot;pageInfo&amp;quot;: {&amp;quot;endCursor&amp;quot;: &amp;quot;cursor2&amp;quot;, &amp;quot;hasNextPage&amp;quot;: False}, &amp;quot;nodes&amp;quot;: [{&amp;quot;edges&amp;quot;: &amp;quot;data2&amp;quot;}]}&lt;br /&gt;
        ]&lt;br /&gt;
&lt;br /&gt;
        # Mock the update_paginator method to reflect the changing state of pagination&lt;br /&gt;
        query.paginator.update_paginator = MagicMock()&lt;br /&gt;
&lt;br /&gt;
        # Collect all results from the generator&lt;br /&gt;
        results = list(github_client._execution_generator(query, {}))&lt;br /&gt;
&lt;br /&gt;
        # Assertions&lt;br /&gt;
        assert len(results) == 2, &amp;quot;Should yield two results for the two pages&amp;quot;&lt;br /&gt;
        assert results[0]['nodes'][0]['edges'] == &amp;quot;data1&amp;quot;, &amp;quot;First result should match first mocked response&amp;quot;&lt;br /&gt;
        assert results[1]['nodes'][0]['edges'] == &amp;quot;data2&amp;quot;, &amp;quot;Second result should match second mocked response&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        # Ensure update_paginator was called correctly&lt;br /&gt;
        assert query.paginator.update_paginator.call_count == 2, &amp;quot;update_paginator should be called twice, once per page&amp;quot;&lt;br /&gt;
        query.paginator.update_paginator.assert_called_with(False, &amp;quot;cursor2&amp;quot;)  # Last call should reflect the end of pagination&lt;br /&gt;
&lt;br /&gt;
    def test_client_execute_success(self, github_client, requests_mock):&lt;br /&gt;
        &amp;quot;&amp;quot;&amp;quot;Test successful execution of a query&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
        requests_mock.post(github_client._base_path(), [&lt;br /&gt;
            {'json': {&amp;quot;data&amp;quot;: {&amp;quot;rateLimit&amp;quot;: {&amp;quot;cost&amp;quot;: 1, &amp;quot;remaining&amp;quot;: 5000, &amp;quot;resetAt&amp;quot;: &amp;quot;2021-01-01T00:00:00Z&amp;quot;}}}, 'status_code': 200},&lt;br /&gt;
            {'json': {&amp;quot;data&amp;quot;: &amp;quot;query success&amp;quot;}, 'status_code': 200}&lt;br /&gt;
        ])&lt;br /&gt;
        response = github_client.execute(Query(&amp;quot;query { viewer { login }}&amp;quot;), {})&lt;br /&gt;
        assert response == &amp;quot;query success&amp;quot;, &amp;quot;Execute should return success on valid response.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    def test_client_execute_failed(self, github_client, requests_mock):&lt;br /&gt;
        &amp;quot;&amp;quot;&amp;quot;Test that a failed query raises QueryFailedException&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
        requests_mock.post(github_client._base_path(), [&lt;br /&gt;
            {'json': {&amp;quot;data&amp;quot;: {&amp;quot;rateLimit&amp;quot;: {&amp;quot;cost&amp;quot;: 1, &amp;quot;remaining&amp;quot;: 5000, &amp;quot;resetAt&amp;quot;: &amp;quot;2021-01-01T00:00:00Z&amp;quot;}}}, 'status_code': 200},&lt;br /&gt;
            {&amp;quot;json&amp;quot;: {&amp;quot;error&amp;quot;: &amp;quot;bad request&amp;quot;}, &amp;quot;status_code&amp;quot;: 400}&lt;br /&gt;
        ])&lt;br /&gt;
        with pytest.raises(QueryFailedException) as excinfo:&lt;br /&gt;
            github_client.execute(Query(&amp;quot;query { viewer { login }}&amp;quot;), {})&lt;br /&gt;
        assert &amp;quot;Query failed with code&amp;quot; in str(excinfo.value), &amp;quot;QueryFailedException should contain the right error message.&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;These tests collectively ensure that the GitHub Miner operates reliably, providing accurate and timely data from GitHub's APIs. By covering a wide range of scenarios, from successful queries to error handling and rate limiting, the tests ensure that the application can be used confidently in production environments.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Live Demo &amp;amp; Source Code==&lt;br /&gt;
http://152.7.177.239:5000/auth/login Link]&lt;br /&gt;
(Please login using your personal GitHub accounts, not NCSU accounts)&lt;br /&gt;
&lt;br /&gt;
[https://github.ncsu.edu/slimbur/GH_Miner Source Code]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
Atharva Pansare&lt;br /&gt;
&lt;br /&gt;
Sumedh Limburkar&lt;br /&gt;
&lt;br /&gt;
Viraj Sanap&lt;br /&gt;
&lt;br /&gt;
Mengning Li&lt;br /&gt;
&lt;br /&gt;
Mentor: Jialin Cui&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
GitHub REST API documentation - https://docs.github.com/en/rest?apiVersion=2022-11-28&lt;/div&gt;</summary>
		<author><name>Slimbur</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_G2402_Implement_REST_client,_REST_API,_and_Graphql_API_endpoint_for_repositories_-_Part_2&amp;diff=155610</id>
		<title>CSC/ECE 517 Spring 2024 - G2402 Implement REST client, REST API, and Graphql API endpoint for repositories - Part 2</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_G2402_Implement_REST_client,_REST_API,_and_Graphql_API_endpoint_for_repositories_-_Part_2&amp;diff=155610"/>
		<updated>2024-04-09T06:36:02Z</updated>

		<summary type="html">&lt;p&gt;Slimbur: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
== Project Objective ==&lt;br /&gt;
This is a convenient tool to query a user's GitHub metrics. The project aims to develop API endpoints for GitHub GraphQL queries and GitHub REST queries using Python Flask. It involves integrating existing code with Flask to expose GraphQL queries as API endpoints, developing a REST client, and creating REST endpoints for querying the same data sets. The project also includes thorough testing and documentation of the endpoints.&lt;br /&gt;
&lt;br /&gt;
==Live Demo &amp;amp; Source Code==&lt;br /&gt;
http://152.7.177.239:5000/auth/login Link]&lt;br /&gt;
(Please login using your personal GitHub accounts, not NCSU accounts)&lt;br /&gt;
&lt;br /&gt;
[https://github.ncsu.edu/slimbur/GH_Miner Source Code]&lt;br /&gt;
&lt;br /&gt;
==Below is the MVC architecture of our GitHub project:==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:MVC2.drawio.png|900px|Image : 900 pixels]]&lt;br /&gt;
&lt;br /&gt;
==Plan of Work==&lt;br /&gt;
In the second phase of the project, we will focus on developing a robust and user-friendly frontend using React. The frontend will serve as an intuitive interface for displaying and interacting with the data retrieved from the GitHub API endpoints implemented in the first phase.&lt;br /&gt;
&lt;br /&gt;
The plan includes the following key steps:&lt;br /&gt;
&lt;br /&gt;
1. **Setup React Environment**: We will set up a modern React development environment, including the necessary tooling, dependencies, and libraries required for building a performant and scalable frontend application.&lt;br /&gt;
&lt;br /&gt;
2. **Design UI Components**: We will design and develop reusable UI components to present the data from the API endpoints in a visually appealing and organized manner. These components will follow best practices for React component development, ensuring modularity, reusability, and maintainability.&lt;br /&gt;
&lt;br /&gt;
3. **Integrate with API Endpoints**: The React frontend will integrate seamlessly with the existing API endpoints. We will implement efficient HTTP request handling mechanisms to fetch data from the endpoints and update the UI components accordingly.&lt;br /&gt;
&lt;br /&gt;
4. **Implement Pagination**: For endpoints that return paginated data, we will implement intuitive pagination functionality in the React UI. This will allow users to navigate through the results smoothly, enhancing the overall user experience.&lt;br /&gt;
&lt;br /&gt;
5. **Enhance User Experience**: We will focus on improving the user experience by adding features such as search functionality, filtering, sorting, and other relevant enhancements based on the data being displayed. These enhancements will empower users to interact with the data more effectively and derive valuable insights.&lt;br /&gt;
&lt;br /&gt;
6. **Test and Debug**: Thorough testing and debugging will be a critical part of the development process. We will implement unit tests and end-to-end tests to ensure the React frontend functions correctly and consistently across different browsers and devices.&lt;br /&gt;
&lt;br /&gt;
7. **Deploy and Document**: Finally, we will deploy the React frontend to a hosting platform, ensuring it is accessible and easily usable by end-users. Comprehensive documentation will be provided, including instructions for setup, usage, and any relevant information for future maintenance and development.&lt;br /&gt;
&lt;br /&gt;
==Frontend==&lt;br /&gt;
As shown below, we plan to display contributors' individual contribution and commit count. We will be implementing the UI using ReactJS &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:GitHub contributors 1.png|900px|Image : 900 pixels]]&lt;br /&gt;
&lt;br /&gt;
==GraphQL Endpoints==&lt;br /&gt;
&lt;br /&gt;
Get current user login:&lt;br /&gt;
 /api/graphql/current-user-login&lt;br /&gt;
&lt;br /&gt;
Sample Output:&lt;br /&gt;
 {&lt;br /&gt;
   &amp;quot;viewer&amp;quot;: {&lt;br /&gt;
     &amp;quot;login&amp;quot;: &amp;quot;&amp;lt;your-username&amp;gt;&amp;quot;&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Get specific user login:&lt;br /&gt;
 /api/graphql/user-login/&amp;lt;username&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get list of all commits in a repo:&lt;br /&gt;
 /api/graphql/specific-user-commits/&amp;lt;owner&amp;gt;/&amp;lt;repo_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sample Output:&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;repository&amp;quot;: {&lt;br /&gt;
      &amp;quot;defaultBranchRef&amp;quot;: {&lt;br /&gt;
        &amp;quot;target&amp;quot;: {&lt;br /&gt;
          &amp;quot;history&amp;quot;: {&lt;br /&gt;
            &amp;quot;nodes&amp;quot;: [&lt;br /&gt;
              {&lt;br /&gt;
                &amp;quot;additions&amp;quot;: 0,&lt;br /&gt;
                &amp;quot;author&amp;quot;: {&lt;br /&gt;
                  &amp;quot;email&amp;quot;: &amp;quot;61797592+Atharva7007@users.noreply.github.com&amp;quot;,&lt;br /&gt;
                  &amp;quot;name&amp;quot;: &amp;quot;Atharva Pansare&amp;quot;,&lt;br /&gt;
                  &amp;quot;user&amp;quot;: {&lt;br /&gt;
                    &amp;quot;login&amp;quot;: &amp;quot;Atharva7007&amp;quot;&lt;br /&gt;
                  }&lt;br /&gt;
                },&lt;br /&gt;
                &amp;quot;authoredDate&amp;quot;: &amp;quot;2020-04-03T09:30:17Z&amp;quot;,&lt;br /&gt;
                &amp;quot;changedFilesIfAvailable&amp;quot;: 1,&lt;br /&gt;
                &amp;quot;deletions&amp;quot;: 0,&lt;br /&gt;
                &amp;quot;message&amp;quot;: &amp;quot;Add files via upload&amp;quot;,&lt;br /&gt;
                &amp;quot;parents&amp;quot;: {&lt;br /&gt;
                  &amp;quot;totalCount&amp;quot;: 1&lt;br /&gt;
                }&lt;br /&gt;
              }&lt;br /&gt;
            ],&lt;br /&gt;
            &amp;quot;pageInfo&amp;quot;: {&lt;br /&gt;
              &amp;quot;endCursor&amp;quot;: &amp;quot;98ba34a6c62ff6fe7c4d4de5c342a194f72d66e4 0&amp;quot;,&lt;br /&gt;
              &amp;quot;hasNextPage&amp;quot;: true&lt;br /&gt;
            },&lt;br /&gt;
            &amp;quot;totalCount&amp;quot;: 6&lt;br /&gt;
          }&lt;br /&gt;
        }&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
Get details of all contributors in a repo:&lt;br /&gt;
 /api/graphql/repository-contributors/&amp;lt;owner&amp;gt;/&amp;lt;repo_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sample Output:&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;repository&amp;quot;: {&lt;br /&gt;
      &amp;quot;defaultBranchRef&amp;quot;: {&lt;br /&gt;
        &amp;quot;target&amp;quot;: {&lt;br /&gt;
          &amp;quot;history&amp;quot;: {&lt;br /&gt;
            &amp;quot;nodes&amp;quot;: [&lt;br /&gt;
              {&lt;br /&gt;
                &amp;quot;author&amp;quot;: {&lt;br /&gt;
                  &amp;quot;email&amp;quot;: &amp;quot;61797592+Atharva7007@users.noreply.github.com&amp;quot;,&lt;br /&gt;
                  &amp;quot;name&amp;quot;: &amp;quot;Atharva Pansare&amp;quot;,&lt;br /&gt;
                  &amp;quot;user&amp;quot;: {&lt;br /&gt;
                    &amp;quot;login&amp;quot;: &amp;quot;Atharva7007&amp;quot;&lt;br /&gt;
                  }&lt;br /&gt;
                }&lt;br /&gt;
              }&lt;br /&gt;
            ],&lt;br /&gt;
            &amp;quot;pageInfo&amp;quot;: {&lt;br /&gt;
              &amp;quot;endCursor&amp;quot;: &amp;quot;98ba34a6c62ff6fe7c4d4de5c342a194f72d66e4 0&amp;quot;,&lt;br /&gt;
              &amp;quot;hasNextPage&amp;quot;: true&lt;br /&gt;
            },&lt;br /&gt;
            &amp;quot;totalCount&amp;quot;: 6&lt;br /&gt;
          }&lt;br /&gt;
        }&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
==REST API Endpoints==&lt;br /&gt;
Get current user login:&lt;br /&gt;
 /api/rest/current-user-login-rest&lt;br /&gt;
&lt;br /&gt;
This endpoint retrieves the login information of the currently authenticated user. It fetches the user's profile data from the GitHub API and returns details such as their username, avatar URL, and other relevant information.&lt;br /&gt;
&lt;br /&gt;
Sample Output:&lt;br /&gt;
 {&lt;br /&gt;
   &amp;quot;avatar_url&amp;quot;: &amp;quot;https://avatars.githubusercontent.com/u/61797592?v=4&amp;quot;,&lt;br /&gt;
   &amp;quot;bio&amp;quot;: null,&lt;br /&gt;
   &amp;quot;blog&amp;quot;: &amp;quot;&amp;quot;,&lt;br /&gt;
   &amp;quot;company&amp;quot;: null,&lt;br /&gt;
   &amp;quot;created_at&amp;quot;: &amp;quot;2020-03-04T16:49:06Z&amp;quot;,&lt;br /&gt;
   &amp;quot;email&amp;quot;: null,&lt;br /&gt;
   &amp;quot;events_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/events{/privacy}&amp;quot;,&lt;br /&gt;
   &amp;quot;followers&amp;quot;: 1,&lt;br /&gt;
   &amp;quot;followers_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/followers&amp;quot;,&lt;br /&gt;
   &amp;quot;following&amp;quot;: 3,&lt;br /&gt;
   &amp;quot;following_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/following{/other_user}&amp;quot;,&lt;br /&gt;
   &amp;quot;gists_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/gists{/gist_id}&amp;quot;,&lt;br /&gt;
   &amp;quot;gravatar_id&amp;quot;: &amp;quot;&amp;quot;,&lt;br /&gt;
   &amp;quot;hireable&amp;quot;: null,&lt;br /&gt;
   &amp;quot;html_url&amp;quot;: &amp;quot;https://github.com/Atharva7007&amp;quot;,&lt;br /&gt;
   &amp;quot;id&amp;quot;: 61797592,&lt;br /&gt;
   &amp;quot;location&amp;quot;: null,&lt;br /&gt;
   &amp;quot;login&amp;quot;: &amp;quot;Atharva7007&amp;quot;,&lt;br /&gt;
   &amp;quot;name&amp;quot;: &amp;quot;Atharva Pansare&amp;quot;,&lt;br /&gt;
   &amp;quot;node_id&amp;quot;: &amp;quot;MDQ6VXNlcjYxNzk3NTky&amp;quot;,&lt;br /&gt;
   &amp;quot;organizations_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/orgs&amp;quot;,&lt;br /&gt;
   &amp;quot;public_gists&amp;quot;: 0,&lt;br /&gt;
   &amp;quot;public_repos&amp;quot;: 11,&lt;br /&gt;
   &amp;quot;received_events_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/received_events&amp;quot;,&lt;br /&gt;
   &amp;quot;repos_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/repos&amp;quot;,&lt;br /&gt;
   &amp;quot;site_admin&amp;quot;: false,&lt;br /&gt;
   &amp;quot;starred_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/starred{/owner}{/repo}&amp;quot;,&lt;br /&gt;
   &amp;quot;subscriptions_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/subscriptions&amp;quot;,&lt;br /&gt;
   &amp;quot;twitter_username&amp;quot;: null,&lt;br /&gt;
   &amp;quot;type&amp;quot;: &amp;quot;User&amp;quot;,&lt;br /&gt;
   &amp;quot;updated_at&amp;quot;: &amp;quot;2024-03-14T19:03:46Z&amp;quot;,&lt;br /&gt;
   &amp;quot;url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007&amp;quot;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Get list of all commits in a repo:&lt;br /&gt;
 /api/rest/specific-user-commits/&amp;lt;owner&amp;gt;/&amp;lt;repo_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This endpoint retrieves a list of all commits made to a specific repository. It takes the repository owner and repository name as parameters. The endpoint fetches the commit history from the GitHub API and returns details about each commit, such as the author, commit message, and changes made.&lt;br /&gt;
&lt;br /&gt;
Sample Output:&lt;br /&gt;
 [&lt;br /&gt;
   {&lt;br /&gt;
     &amp;quot;repository&amp;quot;: {&lt;br /&gt;
       &amp;quot;defaultBranchRef&amp;quot;: {&lt;br /&gt;
         &amp;quot;target&amp;quot;: {&lt;br /&gt;
           &amp;quot;history&amp;quot;: {&lt;br /&gt;
             &amp;quot;nodes&amp;quot;: [&lt;br /&gt;
               {&lt;br /&gt;
                 &amp;quot;additions&amp;quot;: 0,&lt;br /&gt;
                 &amp;quot;author&amp;quot;: {&lt;br /&gt;
                   &amp;quot;email&amp;quot;: &amp;quot;61797592+Atharva7007@users.noreply.github.com&amp;quot;,&lt;br /&gt;
                   &amp;quot;name&amp;quot;: &amp;quot;Atharva Pansare&amp;quot;,&lt;br /&gt;
                   &amp;quot;user&amp;quot;: {&lt;br /&gt;
                     &amp;quot;login&amp;quot;: &amp;quot;Atharva7007&amp;quot;&lt;br /&gt;
                   }&lt;br /&gt;
                 },&lt;br /&gt;
                 &amp;quot;authoredDate&amp;quot;: &amp;quot;2020-04-03T09:30:17Z&amp;quot;,&lt;br /&gt;
                 &amp;quot;changedFilesIfAvailable&amp;quot;: 1,&lt;br /&gt;
                 &amp;quot;deletions&amp;quot;: 0,&lt;br /&gt;
                 &amp;quot;message&amp;quot;: &amp;quot;Add files via upload&amp;quot;,&lt;br /&gt;
                 &amp;quot;parents&amp;quot;: {&lt;br /&gt;
                   &amp;quot;totalCount&amp;quot;: 1&lt;br /&gt;
                 }&lt;br /&gt;
               }&lt;br /&gt;
             ],&lt;br /&gt;
             &amp;quot;pageInfo&amp;quot;: {&lt;br /&gt;
               &amp;quot;endCursor&amp;quot;: &amp;quot;98ba34a6c62ff6fe7c4d4de5c342a194f72d66e4 0&amp;quot;,&lt;br /&gt;
               &amp;quot;hasNextPage&amp;quot;: true&lt;br /&gt;
             },&lt;br /&gt;
             &amp;quot;totalCount&amp;quot;: 6&lt;br /&gt;
           }&lt;br /&gt;
         }&lt;br /&gt;
       }&lt;br /&gt;
     }&lt;br /&gt;
   }&lt;br /&gt;
 ]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Get details of all contributors in a repo:&lt;br /&gt;
 /api/rest/repository-contributors/&amp;lt;owner&amp;gt;/&amp;lt;repo_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This endpoint fetches the details of all contributors to a specific repository. It takes the repository owner and repository name as parameters. The endpoint retrieves the list of contributors from the GitHub API and returns information about each contributor, such as their username, avatar URL, and permissions within the repository.&lt;br /&gt;
&lt;br /&gt;
Sample Output:&lt;br /&gt;
[&lt;br /&gt;
  {&lt;br /&gt;
    &amp;quot;avatar_url&amp;quot;: &amp;quot;https://avatars.githubusercontent.com/u/61797592?v=4&amp;quot;,&lt;br /&gt;
    &amp;quot;events_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/events{/privacy}&amp;quot;,&lt;br /&gt;
    &amp;quot;followers_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/followers&amp;quot;,&lt;br /&gt;
    &amp;quot;following_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/following{/other_user}&amp;quot;,&lt;br /&gt;
    &amp;quot;gists_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/gists{/gist_id}&amp;quot;,&lt;br /&gt;
    &amp;quot;gravatar_id&amp;quot;: &amp;quot;&amp;quot;,&lt;br /&gt;
    &amp;quot;html_url&amp;quot;: &amp;quot;https://github.com/Atharva7007&amp;quot;,&lt;br /&gt;
    &amp;quot;id&amp;quot;: 61797592,&lt;br /&gt;
    &amp;quot;login&amp;quot;: &amp;quot;Atharva7007&amp;quot;,&lt;br /&gt;
    &amp;quot;node_id&amp;quot;: &amp;quot;MDQ6VXNlcjYxNzk3NTky&amp;quot;,&lt;br /&gt;
    &amp;quot;organizations_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/orgs&amp;quot;,&lt;br /&gt;
    &amp;quot;permissions&amp;quot;: {&lt;br /&gt;
      &amp;quot;admin&amp;quot;: true,&lt;br /&gt;
      &amp;quot;maintain&amp;quot;: true,&lt;br /&gt;
      &amp;quot;pull&amp;quot;: true,&lt;br /&gt;
      &amp;quot;push&amp;quot;: true,&lt;br /&gt;
      &amp;quot;triage&amp;quot;: true&lt;br /&gt;
    },&lt;br /&gt;
    &amp;quot;received_events_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/received_events&amp;quot;,&lt;br /&gt;
    &amp;quot;repos_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/repos&amp;quot;,&lt;br /&gt;
    &amp;quot;role_name&amp;quot;: &amp;quot;admin&amp;quot;,&lt;br /&gt;
    &amp;quot;site_admin&amp;quot;: false,&lt;br /&gt;
    &amp;quot;starred_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/starred{/owner}{/repo}&amp;quot;,&lt;br /&gt;
    &amp;quot;subscriptions_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/subscriptions&amp;quot;,&lt;br /&gt;
    &amp;quot;type&amp;quot;: &amp;quot;User&amp;quot;,&lt;br /&gt;
    &amp;quot;url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Implementation Details==&lt;br /&gt;
The GitHub Miner project consists of two main components: the backend API and the frontend user interface.&lt;br /&gt;
&lt;br /&gt;
The backend API is implemented using Flask, a lightweight Python web framework. It exposes two sets of endpoints: one for GraphQL queries and another for REST API queries. Flask Blueprints are used to route requests to the appropriate endpoints based on the URL path.&lt;br /&gt;
&lt;br /&gt;
The GraphQL implementation utilizes the `graphene` library, which provides a way to define GraphQL schemas and resolvers. The resolvers are responsible for fetching data from the GitHub API using the `pygithub` library.&lt;br /&gt;
&lt;br /&gt;
The REST implementation uses the `requests` library to make HTTP requests to the GitHub API and process the responses.&lt;br /&gt;
&lt;br /&gt;
To ensure reliability and robustness, comprehensive testing strategies, including unit tests and integration tests, have been implemented. These tests validate the functionality of the API endpoints across different scenarios, ensuring the system's correctness and stability.&lt;br /&gt;
&lt;br /&gt;
== Implementation Details == &lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
In the API, we have 2 separate endpoints to retrieve the same data: one for REST and the other using GraphQL queries. To manage this, we have made use of Flask Blueprints where all the &amp;quot;api/graphql&amp;quot; requests get routed to the graphql variants and the &amp;quot;api/rest&amp;quot; requests get routed to the REST variants.&lt;br /&gt;
&lt;br /&gt;
=== Design Patterns used ===&lt;br /&gt;
# The REST API Client '''/backend/app/services/github_query/github_rest/client.py''' is a Singleton.&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
To ensure the reliability and robustness of the GitHub Miner, comprehensive testing strategies, including unit tests and integration tests, have been implemented. These tests validate the functionality of the API endpoints across different scenarios, ensuring the system's correctness and stability. The testing suite covers the following areas:&lt;br /&gt;
&lt;br /&gt;
=== Unit Tests ===&lt;br /&gt;
&lt;br /&gt;
Unit tests have been developed to test individual components in isolation, ensuring that each part functions correctly on its own. This includes testing the initialization, argument formatting, field formatting, string representation, and equality of query nodes, as well as the correct behavior of the query builders and authenticators. Examples of unit tests include:&lt;br /&gt;
&lt;br /&gt;
- **TestQueryNode**: Validates the initialization, argument formatting, and field formatting of query nodes.&lt;br /&gt;
&lt;br /&gt;
- **TestQuery**: Ensures correct query initialization, argument substitution, and time formatting.&lt;br /&gt;
&lt;br /&gt;
- **TestQueryNodePaginator**: Tests the functionality of the paginator, including initialization, updating, and resetting.&lt;br /&gt;
&lt;br /&gt;
- **TestPaginatedQuery**: Validates the initialization and execution of paginated queries.&lt;br /&gt;
&lt;br /&gt;
=== Integration Tests ===&lt;br /&gt;
&lt;br /&gt;
Integration tests verify the interaction between different components of the system, ensuring that they work together as expected. This includes testing the behavior of the client when making actual requests to the GitHub API, handling authentication, executing queries, and processing paginated responses. Examples of integration tests include:&lt;br /&gt;
&lt;br /&gt;
- **TestClient**: Tests the GitHub client's initialization, header generation, retry logic, query execution, and handling of paginated queries.&lt;br /&gt;
- **Authentication Tests**: Validate the generation of correct authorization headers and the handling of personal access tokens.&lt;br /&gt;
&lt;br /&gt;
These tests collectively ensure that the GitHub Miner operates reliably, providing accurate and timely data from GitHub's APIs. By covering a wide range of scenarios, from successful queries to error handling and rate limiting, the tests ensure that the application can be used confidently in production environments.&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
Atharva Pansare&lt;br /&gt;
&lt;br /&gt;
Sumedh Limburkar&lt;br /&gt;
&lt;br /&gt;
Viraj Sanap&lt;br /&gt;
&lt;br /&gt;
Mengning Li&lt;br /&gt;
&lt;br /&gt;
Mentor: Jialin Cui&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
GitHub REST API documentation - https://docs.github.com/en/rest?apiVersion=2022-11-28&lt;/div&gt;</summary>
		<author><name>Slimbur</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_G2402_Implement_REST_client,_REST_API,_and_Graphql_API_endpoint_for_repositories_-_Part_2&amp;diff=155609</id>
		<title>CSC/ECE 517 Spring 2024 - G2402 Implement REST client, REST API, and Graphql API endpoint for repositories - Part 2</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_G2402_Implement_REST_client,_REST_API,_and_Graphql_API_endpoint_for_repositories_-_Part_2&amp;diff=155609"/>
		<updated>2024-04-09T06:30:19Z</updated>

		<summary type="html">&lt;p&gt;Slimbur: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
== Project Objective ==&lt;br /&gt;
This is a convenient tool to query a user's GitHub metrics. The project aims to develop API endpoints for GitHub GraphQL queries and GitHub REST queries using Python Flask. It involves integrating existing code with Flask to expose GraphQL queries as API endpoints, developing a REST client, and creating REST endpoints for querying the same data sets. The project also includes thorough testing and documentation of the endpoints.&lt;br /&gt;
&lt;br /&gt;
==Live Demo &amp;amp; Source Code==&lt;br /&gt;
http://152.7.177.239:5000/auth/login Link]&lt;br /&gt;
(Please login using your personal GitHub accounts, not NCSU accounts)&lt;br /&gt;
&lt;br /&gt;
[https://github.ncsu.edu/slimbur/GH_Miner Source Code]&lt;br /&gt;
&lt;br /&gt;
==Below is the MVC architecture of our GitHub project:==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:MVC2.drawio.png|900px|Image : 900 pixels]]&lt;br /&gt;
&lt;br /&gt;
==Plan of Work==&lt;br /&gt;
In the second phase of the project, we will focus on developing a robust and user-friendly frontend using React. The frontend will serve as an intuitive interface for displaying and interacting with the data retrieved from the GitHub API endpoints implemented in the first phase.&lt;br /&gt;
&lt;br /&gt;
The plan includes the following key steps:&lt;br /&gt;
&lt;br /&gt;
1. **Setup React Environment**: We will set up a modern React development environment, including the necessary tooling, dependencies, and libraries required for building a performant and scalable frontend application.&lt;br /&gt;
&lt;br /&gt;
2. **Design UI Components**: We will design and develop reusable UI components to present the data from the API endpoints in a visually appealing and organized manner. These components will follow best practices for React component development, ensuring modularity, reusability, and maintainability.&lt;br /&gt;
&lt;br /&gt;
3. **Integrate with API Endpoints**: The React frontend will integrate seamlessly with the existing API endpoints. We will implement efficient HTTP request handling mechanisms to fetch data from the endpoints and update the UI components accordingly.&lt;br /&gt;
&lt;br /&gt;
4. **Implement Pagination**: For endpoints that return paginated data, we will implement intuitive pagination functionality in the React UI. This will allow users to navigate through the results smoothly, enhancing the overall user experience.&lt;br /&gt;
&lt;br /&gt;
5. **Enhance User Experience**: We will focus on improving the user experience by adding features such as search functionality, filtering, sorting, and other relevant enhancements based on the data being displayed. These enhancements will empower users to interact with the data more effectively and derive valuable insights.&lt;br /&gt;
&lt;br /&gt;
6. **Test and Debug**: Thorough testing and debugging will be a critical part of the development process. We will implement unit tests and end-to-end tests to ensure the React frontend functions correctly and consistently across different browsers and devices.&lt;br /&gt;
&lt;br /&gt;
7. **Deploy and Document**: Finally, we will deploy the React frontend to a hosting platform, ensuring it is accessible and easily usable by end-users. Comprehensive documentation will be provided, including instructions for setup, usage, and any relevant information for future maintenance and development.&lt;br /&gt;
&lt;br /&gt;
==Frontend==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:GitHub contributors 1.png|900px|Image : 900 pixels]]&lt;br /&gt;
&lt;br /&gt;
==GraphQL Endpoints==&lt;br /&gt;
&lt;br /&gt;
Get current user login:&lt;br /&gt;
 /api/graphql/current-user-login&lt;br /&gt;
&lt;br /&gt;
Sample Output:&lt;br /&gt;
 {&lt;br /&gt;
   &amp;quot;viewer&amp;quot;: {&lt;br /&gt;
     &amp;quot;login&amp;quot;: &amp;quot;&amp;lt;your-username&amp;gt;&amp;quot;&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Get specific user login:&lt;br /&gt;
 /api/graphql/user-login/&amp;lt;username&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get list of all commits in a repo:&lt;br /&gt;
 /api/graphql/specific-user-commits/&amp;lt;owner&amp;gt;/&amp;lt;repo_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sample Output:&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;repository&amp;quot;: {&lt;br /&gt;
      &amp;quot;defaultBranchRef&amp;quot;: {&lt;br /&gt;
        &amp;quot;target&amp;quot;: {&lt;br /&gt;
          &amp;quot;history&amp;quot;: {&lt;br /&gt;
            &amp;quot;nodes&amp;quot;: [&lt;br /&gt;
              {&lt;br /&gt;
                &amp;quot;additions&amp;quot;: 0,&lt;br /&gt;
                &amp;quot;author&amp;quot;: {&lt;br /&gt;
                  &amp;quot;email&amp;quot;: &amp;quot;61797592+Atharva7007@users.noreply.github.com&amp;quot;,&lt;br /&gt;
                  &amp;quot;name&amp;quot;: &amp;quot;Atharva Pansare&amp;quot;,&lt;br /&gt;
                  &amp;quot;user&amp;quot;: {&lt;br /&gt;
                    &amp;quot;login&amp;quot;: &amp;quot;Atharva7007&amp;quot;&lt;br /&gt;
                  }&lt;br /&gt;
                },&lt;br /&gt;
                &amp;quot;authoredDate&amp;quot;: &amp;quot;2020-04-03T09:30:17Z&amp;quot;,&lt;br /&gt;
                &amp;quot;changedFilesIfAvailable&amp;quot;: 1,&lt;br /&gt;
                &amp;quot;deletions&amp;quot;: 0,&lt;br /&gt;
                &amp;quot;message&amp;quot;: &amp;quot;Add files via upload&amp;quot;,&lt;br /&gt;
                &amp;quot;parents&amp;quot;: {&lt;br /&gt;
                  &amp;quot;totalCount&amp;quot;: 1&lt;br /&gt;
                }&lt;br /&gt;
              }&lt;br /&gt;
            ],&lt;br /&gt;
            &amp;quot;pageInfo&amp;quot;: {&lt;br /&gt;
              &amp;quot;endCursor&amp;quot;: &amp;quot;98ba34a6c62ff6fe7c4d4de5c342a194f72d66e4 0&amp;quot;,&lt;br /&gt;
              &amp;quot;hasNextPage&amp;quot;: true&lt;br /&gt;
            },&lt;br /&gt;
            &amp;quot;totalCount&amp;quot;: 6&lt;br /&gt;
          }&lt;br /&gt;
        }&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
Get details of all contributors in a repo:&lt;br /&gt;
 /api/graphql/repository-contributors/&amp;lt;owner&amp;gt;/&amp;lt;repo_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sample Output:&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;repository&amp;quot;: {&lt;br /&gt;
      &amp;quot;defaultBranchRef&amp;quot;: {&lt;br /&gt;
        &amp;quot;target&amp;quot;: {&lt;br /&gt;
          &amp;quot;history&amp;quot;: {&lt;br /&gt;
            &amp;quot;nodes&amp;quot;: [&lt;br /&gt;
              {&lt;br /&gt;
                &amp;quot;author&amp;quot;: {&lt;br /&gt;
                  &amp;quot;email&amp;quot;: &amp;quot;61797592+Atharva7007@users.noreply.github.com&amp;quot;,&lt;br /&gt;
                  &amp;quot;name&amp;quot;: &amp;quot;Atharva Pansare&amp;quot;,&lt;br /&gt;
                  &amp;quot;user&amp;quot;: {&lt;br /&gt;
                    &amp;quot;login&amp;quot;: &amp;quot;Atharva7007&amp;quot;&lt;br /&gt;
                  }&lt;br /&gt;
                }&lt;br /&gt;
              }&lt;br /&gt;
            ],&lt;br /&gt;
            &amp;quot;pageInfo&amp;quot;: {&lt;br /&gt;
              &amp;quot;endCursor&amp;quot;: &amp;quot;98ba34a6c62ff6fe7c4d4de5c342a194f72d66e4 0&amp;quot;,&lt;br /&gt;
              &amp;quot;hasNextPage&amp;quot;: true&lt;br /&gt;
            },&lt;br /&gt;
            &amp;quot;totalCount&amp;quot;: 6&lt;br /&gt;
          }&lt;br /&gt;
        }&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
==REST API Endpoints==&lt;br /&gt;
Get current user login:&lt;br /&gt;
 /api/rest/current-user-login-rest&lt;br /&gt;
&lt;br /&gt;
This endpoint retrieves the login information of the currently authenticated user. It fetches the user's profile data from the GitHub API and returns details such as their username, avatar URL, and other relevant information.&lt;br /&gt;
&lt;br /&gt;
Sample Output:&lt;br /&gt;
 {&lt;br /&gt;
   &amp;quot;avatar_url&amp;quot;: &amp;quot;https://avatars.githubusercontent.com/u/61797592?v=4&amp;quot;,&lt;br /&gt;
   &amp;quot;bio&amp;quot;: null,&lt;br /&gt;
   &amp;quot;blog&amp;quot;: &amp;quot;&amp;quot;,&lt;br /&gt;
   &amp;quot;company&amp;quot;: null,&lt;br /&gt;
   &amp;quot;created_at&amp;quot;: &amp;quot;2020-03-04T16:49:06Z&amp;quot;,&lt;br /&gt;
   &amp;quot;email&amp;quot;: null,&lt;br /&gt;
   &amp;quot;events_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/events{/privacy}&amp;quot;,&lt;br /&gt;
   &amp;quot;followers&amp;quot;: 1,&lt;br /&gt;
   &amp;quot;followers_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/followers&amp;quot;,&lt;br /&gt;
   &amp;quot;following&amp;quot;: 3,&lt;br /&gt;
   &amp;quot;following_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/following{/other_user}&amp;quot;,&lt;br /&gt;
   &amp;quot;gists_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/gists{/gist_id}&amp;quot;,&lt;br /&gt;
   &amp;quot;gravatar_id&amp;quot;: &amp;quot;&amp;quot;,&lt;br /&gt;
   &amp;quot;hireable&amp;quot;: null,&lt;br /&gt;
   &amp;quot;html_url&amp;quot;: &amp;quot;https://github.com/Atharva7007&amp;quot;,&lt;br /&gt;
   &amp;quot;id&amp;quot;: 61797592,&lt;br /&gt;
   &amp;quot;location&amp;quot;: null,&lt;br /&gt;
   &amp;quot;login&amp;quot;: &amp;quot;Atharva7007&amp;quot;,&lt;br /&gt;
   &amp;quot;name&amp;quot;: &amp;quot;Atharva Pansare&amp;quot;,&lt;br /&gt;
   &amp;quot;node_id&amp;quot;: &amp;quot;MDQ6VXNlcjYxNzk3NTky&amp;quot;,&lt;br /&gt;
   &amp;quot;organizations_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/orgs&amp;quot;,&lt;br /&gt;
   &amp;quot;public_gists&amp;quot;: 0,&lt;br /&gt;
   &amp;quot;public_repos&amp;quot;: 11,&lt;br /&gt;
   &amp;quot;received_events_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/received_events&amp;quot;,&lt;br /&gt;
   &amp;quot;repos_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/repos&amp;quot;,&lt;br /&gt;
   &amp;quot;site_admin&amp;quot;: false,&lt;br /&gt;
   &amp;quot;starred_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/starred{/owner}{/repo}&amp;quot;,&lt;br /&gt;
   &amp;quot;subscriptions_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/subscriptions&amp;quot;,&lt;br /&gt;
   &amp;quot;twitter_username&amp;quot;: null,&lt;br /&gt;
   &amp;quot;type&amp;quot;: &amp;quot;User&amp;quot;,&lt;br /&gt;
   &amp;quot;updated_at&amp;quot;: &amp;quot;2024-03-14T19:03:46Z&amp;quot;,&lt;br /&gt;
   &amp;quot;url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007&amp;quot;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Get list of all commits in a repo:&lt;br /&gt;
 /api/rest/specific-user-commits/&amp;lt;owner&amp;gt;/&amp;lt;repo_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This endpoint retrieves a list of all commits made to a specific repository. It takes the repository owner and repository name as parameters. The endpoint fetches the commit history from the GitHub API and returns details about each commit, such as the author, commit message, and changes made.&lt;br /&gt;
&lt;br /&gt;
Sample Output:&lt;br /&gt;
 [&lt;br /&gt;
   {&lt;br /&gt;
     &amp;quot;repository&amp;quot;: {&lt;br /&gt;
       &amp;quot;defaultBranchRef&amp;quot;: {&lt;br /&gt;
         &amp;quot;target&amp;quot;: {&lt;br /&gt;
           &amp;quot;history&amp;quot;: {&lt;br /&gt;
             &amp;quot;nodes&amp;quot;: [&lt;br /&gt;
               {&lt;br /&gt;
                 &amp;quot;additions&amp;quot;: 0,&lt;br /&gt;
                 &amp;quot;author&amp;quot;: {&lt;br /&gt;
                   &amp;quot;email&amp;quot;: &amp;quot;61797592+Atharva7007@users.noreply.github.com&amp;quot;,&lt;br /&gt;
                   &amp;quot;name&amp;quot;: &amp;quot;Atharva Pansare&amp;quot;,&lt;br /&gt;
                   &amp;quot;user&amp;quot;: {&lt;br /&gt;
                     &amp;quot;login&amp;quot;: &amp;quot;Atharva7007&amp;quot;&lt;br /&gt;
                   }&lt;br /&gt;
                 },&lt;br /&gt;
                 &amp;quot;authoredDate&amp;quot;: &amp;quot;2020-04-03T09:30:17Z&amp;quot;,&lt;br /&gt;
                 &amp;quot;changedFilesIfAvailable&amp;quot;: 1,&lt;br /&gt;
                 &amp;quot;deletions&amp;quot;: 0,&lt;br /&gt;
                 &amp;quot;message&amp;quot;: &amp;quot;Add files via upload&amp;quot;,&lt;br /&gt;
                 &amp;quot;parents&amp;quot;: {&lt;br /&gt;
                   &amp;quot;totalCount&amp;quot;: 1&lt;br /&gt;
                 }&lt;br /&gt;
               }&lt;br /&gt;
             ],&lt;br /&gt;
             &amp;quot;pageInfo&amp;quot;: {&lt;br /&gt;
               &amp;quot;endCursor&amp;quot;: &amp;quot;98ba34a6c62ff6fe7c4d4de5c342a194f72d66e4 0&amp;quot;,&lt;br /&gt;
               &amp;quot;hasNextPage&amp;quot;: true&lt;br /&gt;
             },&lt;br /&gt;
             &amp;quot;totalCount&amp;quot;: 6&lt;br /&gt;
           }&lt;br /&gt;
         }&lt;br /&gt;
       }&lt;br /&gt;
     }&lt;br /&gt;
   }&lt;br /&gt;
 ]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Get details of all contributors in a repo:&lt;br /&gt;
 /api/rest/repository-contributors/&amp;lt;owner&amp;gt;/&amp;lt;repo_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This endpoint fetches the details of all contributors to a specific repository. It takes the repository owner and repository name as parameters. The endpoint retrieves the list of contributors from the GitHub API and returns information about each contributor, such as their username, avatar URL, and permissions within the repository.&lt;br /&gt;
&lt;br /&gt;
Sample Output:&lt;br /&gt;
[&lt;br /&gt;
  {&lt;br /&gt;
    &amp;quot;avatar_url&amp;quot;: &amp;quot;https://avatars.githubusercontent.com/u/61797592?v=4&amp;quot;,&lt;br /&gt;
    &amp;quot;events_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/events{/privacy}&amp;quot;,&lt;br /&gt;
    &amp;quot;followers_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/followers&amp;quot;,&lt;br /&gt;
    &amp;quot;following_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/following{/other_user}&amp;quot;,&lt;br /&gt;
    &amp;quot;gists_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/gists{/gist_id}&amp;quot;,&lt;br /&gt;
    &amp;quot;gravatar_id&amp;quot;: &amp;quot;&amp;quot;,&lt;br /&gt;
    &amp;quot;html_url&amp;quot;: &amp;quot;https://github.com/Atharva7007&amp;quot;,&lt;br /&gt;
    &amp;quot;id&amp;quot;: 61797592,&lt;br /&gt;
    &amp;quot;login&amp;quot;: &amp;quot;Atharva7007&amp;quot;,&lt;br /&gt;
    &amp;quot;node_id&amp;quot;: &amp;quot;MDQ6VXNlcjYxNzk3NTky&amp;quot;,&lt;br /&gt;
    &amp;quot;organizations_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/orgs&amp;quot;,&lt;br /&gt;
    &amp;quot;permissions&amp;quot;: {&lt;br /&gt;
      &amp;quot;admin&amp;quot;: true,&lt;br /&gt;
      &amp;quot;maintain&amp;quot;: true,&lt;br /&gt;
      &amp;quot;pull&amp;quot;: true,&lt;br /&gt;
      &amp;quot;push&amp;quot;: true,&lt;br /&gt;
      &amp;quot;triage&amp;quot;: true&lt;br /&gt;
    },&lt;br /&gt;
    &amp;quot;received_events_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/received_events&amp;quot;,&lt;br /&gt;
    &amp;quot;repos_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/repos&amp;quot;,&lt;br /&gt;
    &amp;quot;role_name&amp;quot;: &amp;quot;admin&amp;quot;,&lt;br /&gt;
    &amp;quot;site_admin&amp;quot;: false,&lt;br /&gt;
    &amp;quot;starred_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/starred{/owner}{/repo}&amp;quot;,&lt;br /&gt;
    &amp;quot;subscriptions_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/subscriptions&amp;quot;,&lt;br /&gt;
    &amp;quot;type&amp;quot;: &amp;quot;User&amp;quot;,&lt;br /&gt;
    &amp;quot;url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Implementation Details==&lt;br /&gt;
The GitHub Miner project consists of two main components: the backend API and the frontend user interface.&lt;br /&gt;
&lt;br /&gt;
The backend API is implemented using Flask, a lightweight Python web framework. It exposes two sets of endpoints: one for GraphQL queries and another for REST API queries. Flask Blueprints are used to route requests to the appropriate endpoints based on the URL path.&lt;br /&gt;
&lt;br /&gt;
The GraphQL implementation utilizes the `graphene` library, which provides a way to define GraphQL schemas and resolvers. The resolvers are responsible for fetching data from the GitHub API using the `pygithub` library.&lt;br /&gt;
&lt;br /&gt;
The REST implementation uses the `requests` library to make HTTP requests to the GitHub API and process the responses.&lt;br /&gt;
&lt;br /&gt;
To ensure reliability and robustness, comprehensive testing strategies, including unit tests and integration tests, have been implemented. These tests validate the functionality of the API endpoints across different scenarios, ensuring the system's correctness and stability.&lt;br /&gt;
&lt;br /&gt;
== Implementation Details == &lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
In the API, we have 2 separate endpoints to retrieve the same data: one for REST and the other using GraphQL queries. To manage this, we have made use of Flask Blueprints where all the &amp;quot;api/graphql&amp;quot; requests get routed to the graphql variants and the &amp;quot;api/rest&amp;quot; requests get routed to the REST variants.&lt;br /&gt;
&lt;br /&gt;
=== Design Patterns used ===&lt;br /&gt;
# The REST API Client '''/backend/app/services/github_query/github_rest/client.py''' is a Singleton.&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
To ensure the reliability and robustness of the GitHub Miner, comprehensive testing strategies, including unit tests and integration tests, have been implemented. These tests validate the functionality of the API endpoints across different scenarios, ensuring the system's correctness and stability. The testing suite covers the following areas:&lt;br /&gt;
&lt;br /&gt;
=== Unit Tests ===&lt;br /&gt;
&lt;br /&gt;
Unit tests have been developed to test individual components in isolation, ensuring that each part functions correctly on its own. This includes testing the initialization, argument formatting, field formatting, string representation, and equality of query nodes, as well as the correct behavior of the query builders and authenticators. Examples of unit tests include:&lt;br /&gt;
&lt;br /&gt;
- **TestQueryNode**: Validates the initialization, argument formatting, and field formatting of query nodes.&lt;br /&gt;
&lt;br /&gt;
- **TestQuery**: Ensures correct query initialization, argument substitution, and time formatting.&lt;br /&gt;
&lt;br /&gt;
- **TestQueryNodePaginator**: Tests the functionality of the paginator, including initialization, updating, and resetting.&lt;br /&gt;
&lt;br /&gt;
- **TestPaginatedQuery**: Validates the initialization and execution of paginated queries.&lt;br /&gt;
&lt;br /&gt;
=== Integration Tests ===&lt;br /&gt;
&lt;br /&gt;
Integration tests verify the interaction between different components of the system, ensuring that they work together as expected. This includes testing the behavior of the client when making actual requests to the GitHub API, handling authentication, executing queries, and processing paginated responses. Examples of integration tests include:&lt;br /&gt;
&lt;br /&gt;
- **TestClient**: Tests the GitHub client's initialization, header generation, retry logic, query execution, and handling of paginated queries.&lt;br /&gt;
- **Authentication Tests**: Validate the generation of correct authorization headers and the handling of personal access tokens.&lt;br /&gt;
&lt;br /&gt;
These tests collectively ensure that the GitHub Miner operates reliably, providing accurate and timely data from GitHub's APIs. By covering a wide range of scenarios, from successful queries to error handling and rate limiting, the tests ensure that the application can be used confidently in production environments.&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
Atharva Pansare&lt;br /&gt;
&lt;br /&gt;
Sumedh Limburkar&lt;br /&gt;
&lt;br /&gt;
Viraj Sanap&lt;br /&gt;
&lt;br /&gt;
Mengning Li&lt;br /&gt;
&lt;br /&gt;
Mentor: Jialin Cui&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
GitHub REST API documentation - https://docs.github.com/en/rest?apiVersion=2022-11-28&lt;/div&gt;</summary>
		<author><name>Slimbur</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:GitHub_contributors_1.png&amp;diff=155608</id>
		<title>File:GitHub contributors 1.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:GitHub_contributors_1.png&amp;diff=155608"/>
		<updated>2024-04-09T06:29:19Z</updated>

		<summary type="html">&lt;p&gt;Slimbur: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Slimbur</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_G2402_Implement_REST_client,_REST_API,_and_Graphql_API_endpoint_for_repositories_-_Part_2&amp;diff=155607</id>
		<title>CSC/ECE 517 Spring 2024 - G2402 Implement REST client, REST API, and Graphql API endpoint for repositories - Part 2</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_G2402_Implement_REST_client,_REST_API,_and_Graphql_API_endpoint_for_repositories_-_Part_2&amp;diff=155607"/>
		<updated>2024-04-09T06:21:18Z</updated>

		<summary type="html">&lt;p&gt;Slimbur: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
== Project Objective ==&lt;br /&gt;
This is a convenient tool to query a user's GitHub metrics. The project aims to develop API endpoints for GitHub GraphQL queries and GitHub REST queries using Python Flask. It involves integrating existing code with Flask to expose GraphQL queries as API endpoints, developing a REST client, and creating REST endpoints for querying the same data sets. The project also includes thorough testing and documentation of the endpoints.&lt;br /&gt;
&lt;br /&gt;
==Live Demo &amp;amp; Source Code==&lt;br /&gt;
http://152.7.177.239:5000/auth/login Link]&lt;br /&gt;
(Please login using your personal GitHub accounts, not NCSU accounts)&lt;br /&gt;
&lt;br /&gt;
[https://github.ncsu.edu/slimbur/GH_Miner Source Code]&lt;br /&gt;
&lt;br /&gt;
==Below is the MVC architecture of our GitHub project:==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:MVC2.drawio.png|900px|Image : 900 pixels]]&lt;br /&gt;
&lt;br /&gt;
==Plan of Work==&lt;br /&gt;
In the second phase of the project, we will focus on developing a robust and user-friendly frontend using React. The frontend will serve as an intuitive interface for displaying and interacting with the data retrieved from the GitHub API endpoints implemented in the first phase.&lt;br /&gt;
&lt;br /&gt;
The plan includes the following key steps:&lt;br /&gt;
&lt;br /&gt;
1. **Setup React Environment**: We will set up a modern React development environment, including the necessary tooling, dependencies, and libraries required for building a performant and scalable frontend application.&lt;br /&gt;
&lt;br /&gt;
2. **Design UI Components**: We will design and develop reusable UI components to present the data from the API endpoints in a visually appealing and organized manner. These components will follow best practices for React component development, ensuring modularity, reusability, and maintainability.&lt;br /&gt;
&lt;br /&gt;
3. **Integrate with API Endpoints**: The React frontend will integrate seamlessly with the existing API endpoints. We will implement efficient HTTP request handling mechanisms to fetch data from the endpoints and update the UI components accordingly.&lt;br /&gt;
&lt;br /&gt;
4. **Implement Pagination**: For endpoints that return paginated data, we will implement intuitive pagination functionality in the React UI. This will allow users to navigate through the results smoothly, enhancing the overall user experience.&lt;br /&gt;
&lt;br /&gt;
5. **Enhance User Experience**: We will focus on improving the user experience by adding features such as search functionality, filtering, sorting, and other relevant enhancements based on the data being displayed. These enhancements will empower users to interact with the data more effectively and derive valuable insights.&lt;br /&gt;
&lt;br /&gt;
6. **Test and Debug**: Thorough testing and debugging will be a critical part of the development process. We will implement unit tests and end-to-end tests to ensure the React frontend functions correctly and consistently across different browsers and devices.&lt;br /&gt;
&lt;br /&gt;
7. **Deploy and Document**: Finally, we will deploy the React frontend to a hosting platform, ensuring it is accessible and easily usable by end-users. Comprehensive documentation will be provided, including instructions for setup, usage, and any relevant information for future maintenance and development.&lt;br /&gt;
&lt;br /&gt;
==GraphQL Endpoints==&lt;br /&gt;
&lt;br /&gt;
Get current user login:&lt;br /&gt;
 /api/graphql/current-user-login&lt;br /&gt;
&lt;br /&gt;
Sample Output:&lt;br /&gt;
 {&lt;br /&gt;
   &amp;quot;viewer&amp;quot;: {&lt;br /&gt;
     &amp;quot;login&amp;quot;: &amp;quot;&amp;lt;your-username&amp;gt;&amp;quot;&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Get specific user login:&lt;br /&gt;
 /api/graphql/user-login/&amp;lt;username&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get list of all commits in a repo:&lt;br /&gt;
 /api/graphql/specific-user-commits/&amp;lt;owner&amp;gt;/&amp;lt;repo_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sample Output:&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;repository&amp;quot;: {&lt;br /&gt;
      &amp;quot;defaultBranchRef&amp;quot;: {&lt;br /&gt;
        &amp;quot;target&amp;quot;: {&lt;br /&gt;
          &amp;quot;history&amp;quot;: {&lt;br /&gt;
            &amp;quot;nodes&amp;quot;: [&lt;br /&gt;
              {&lt;br /&gt;
                &amp;quot;additions&amp;quot;: 0,&lt;br /&gt;
                &amp;quot;author&amp;quot;: {&lt;br /&gt;
                  &amp;quot;email&amp;quot;: &amp;quot;61797592+Atharva7007@users.noreply.github.com&amp;quot;,&lt;br /&gt;
                  &amp;quot;name&amp;quot;: &amp;quot;Atharva Pansare&amp;quot;,&lt;br /&gt;
                  &amp;quot;user&amp;quot;: {&lt;br /&gt;
                    &amp;quot;login&amp;quot;: &amp;quot;Atharva7007&amp;quot;&lt;br /&gt;
                  }&lt;br /&gt;
                },&lt;br /&gt;
                &amp;quot;authoredDate&amp;quot;: &amp;quot;2020-04-03T09:30:17Z&amp;quot;,&lt;br /&gt;
                &amp;quot;changedFilesIfAvailable&amp;quot;: 1,&lt;br /&gt;
                &amp;quot;deletions&amp;quot;: 0,&lt;br /&gt;
                &amp;quot;message&amp;quot;: &amp;quot;Add files via upload&amp;quot;,&lt;br /&gt;
                &amp;quot;parents&amp;quot;: {&lt;br /&gt;
                  &amp;quot;totalCount&amp;quot;: 1&lt;br /&gt;
                }&lt;br /&gt;
              }&lt;br /&gt;
            ],&lt;br /&gt;
            &amp;quot;pageInfo&amp;quot;: {&lt;br /&gt;
              &amp;quot;endCursor&amp;quot;: &amp;quot;98ba34a6c62ff6fe7c4d4de5c342a194f72d66e4 0&amp;quot;,&lt;br /&gt;
              &amp;quot;hasNextPage&amp;quot;: true&lt;br /&gt;
            },&lt;br /&gt;
            &amp;quot;totalCount&amp;quot;: 6&lt;br /&gt;
          }&lt;br /&gt;
        }&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
Get details of all contributors in a repo:&lt;br /&gt;
 /api/graphql/repository-contributors/&amp;lt;owner&amp;gt;/&amp;lt;repo_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sample Output:&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;repository&amp;quot;: {&lt;br /&gt;
      &amp;quot;defaultBranchRef&amp;quot;: {&lt;br /&gt;
        &amp;quot;target&amp;quot;: {&lt;br /&gt;
          &amp;quot;history&amp;quot;: {&lt;br /&gt;
            &amp;quot;nodes&amp;quot;: [&lt;br /&gt;
              {&lt;br /&gt;
                &amp;quot;author&amp;quot;: {&lt;br /&gt;
                  &amp;quot;email&amp;quot;: &amp;quot;61797592+Atharva7007@users.noreply.github.com&amp;quot;,&lt;br /&gt;
                  &amp;quot;name&amp;quot;: &amp;quot;Atharva Pansare&amp;quot;,&lt;br /&gt;
                  &amp;quot;user&amp;quot;: {&lt;br /&gt;
                    &amp;quot;login&amp;quot;: &amp;quot;Atharva7007&amp;quot;&lt;br /&gt;
                  }&lt;br /&gt;
                }&lt;br /&gt;
              }&lt;br /&gt;
            ],&lt;br /&gt;
            &amp;quot;pageInfo&amp;quot;: {&lt;br /&gt;
              &amp;quot;endCursor&amp;quot;: &amp;quot;98ba34a6c62ff6fe7c4d4de5c342a194f72d66e4 0&amp;quot;,&lt;br /&gt;
              &amp;quot;hasNextPage&amp;quot;: true&lt;br /&gt;
            },&lt;br /&gt;
            &amp;quot;totalCount&amp;quot;: 6&lt;br /&gt;
          }&lt;br /&gt;
        }&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
==REST API Endpoints==&lt;br /&gt;
Get current user login:&lt;br /&gt;
 /api/rest/current-user-login-rest&lt;br /&gt;
&lt;br /&gt;
This endpoint retrieves the login information of the currently authenticated user. It fetches the user's profile data from the GitHub API and returns details such as their username, avatar URL, and other relevant information.&lt;br /&gt;
&lt;br /&gt;
Sample Output:&lt;br /&gt;
 {&lt;br /&gt;
   &amp;quot;avatar_url&amp;quot;: &amp;quot;https://avatars.githubusercontent.com/u/61797592?v=4&amp;quot;,&lt;br /&gt;
   &amp;quot;bio&amp;quot;: null,&lt;br /&gt;
   &amp;quot;blog&amp;quot;: &amp;quot;&amp;quot;,&lt;br /&gt;
   &amp;quot;company&amp;quot;: null,&lt;br /&gt;
   &amp;quot;created_at&amp;quot;: &amp;quot;2020-03-04T16:49:06Z&amp;quot;,&lt;br /&gt;
   &amp;quot;email&amp;quot;: null,&lt;br /&gt;
   &amp;quot;events_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/events{/privacy}&amp;quot;,&lt;br /&gt;
   &amp;quot;followers&amp;quot;: 1,&lt;br /&gt;
   &amp;quot;followers_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/followers&amp;quot;,&lt;br /&gt;
   &amp;quot;following&amp;quot;: 3,&lt;br /&gt;
   &amp;quot;following_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/following{/other_user}&amp;quot;,&lt;br /&gt;
   &amp;quot;gists_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/gists{/gist_id}&amp;quot;,&lt;br /&gt;
   &amp;quot;gravatar_id&amp;quot;: &amp;quot;&amp;quot;,&lt;br /&gt;
   &amp;quot;hireable&amp;quot;: null,&lt;br /&gt;
   &amp;quot;html_url&amp;quot;: &amp;quot;https://github.com/Atharva7007&amp;quot;,&lt;br /&gt;
   &amp;quot;id&amp;quot;: 61797592,&lt;br /&gt;
   &amp;quot;location&amp;quot;: null,&lt;br /&gt;
   &amp;quot;login&amp;quot;: &amp;quot;Atharva7007&amp;quot;,&lt;br /&gt;
   &amp;quot;name&amp;quot;: &amp;quot;Atharva Pansare&amp;quot;,&lt;br /&gt;
   &amp;quot;node_id&amp;quot;: &amp;quot;MDQ6VXNlcjYxNzk3NTky&amp;quot;,&lt;br /&gt;
   &amp;quot;organizations_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/orgs&amp;quot;,&lt;br /&gt;
   &amp;quot;public_gists&amp;quot;: 0,&lt;br /&gt;
   &amp;quot;public_repos&amp;quot;: 11,&lt;br /&gt;
   &amp;quot;received_events_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/received_events&amp;quot;,&lt;br /&gt;
   &amp;quot;repos_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/repos&amp;quot;,&lt;br /&gt;
   &amp;quot;site_admin&amp;quot;: false,&lt;br /&gt;
   &amp;quot;starred_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/starred{/owner}{/repo}&amp;quot;,&lt;br /&gt;
   &amp;quot;subscriptions_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/subscriptions&amp;quot;,&lt;br /&gt;
   &amp;quot;twitter_username&amp;quot;: null,&lt;br /&gt;
   &amp;quot;type&amp;quot;: &amp;quot;User&amp;quot;,&lt;br /&gt;
   &amp;quot;updated_at&amp;quot;: &amp;quot;2024-03-14T19:03:46Z&amp;quot;,&lt;br /&gt;
   &amp;quot;url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007&amp;quot;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Get list of all commits in a repo:&lt;br /&gt;
 /api/rest/specific-user-commits/&amp;lt;owner&amp;gt;/&amp;lt;repo_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This endpoint retrieves a list of all commits made to a specific repository. It takes the repository owner and repository name as parameters. The endpoint fetches the commit history from the GitHub API and returns details about each commit, such as the author, commit message, and changes made.&lt;br /&gt;
&lt;br /&gt;
Sample Output:&lt;br /&gt;
 [&lt;br /&gt;
   {&lt;br /&gt;
     &amp;quot;repository&amp;quot;: {&lt;br /&gt;
       &amp;quot;defaultBranchRef&amp;quot;: {&lt;br /&gt;
         &amp;quot;target&amp;quot;: {&lt;br /&gt;
           &amp;quot;history&amp;quot;: {&lt;br /&gt;
             &amp;quot;nodes&amp;quot;: [&lt;br /&gt;
               {&lt;br /&gt;
                 &amp;quot;additions&amp;quot;: 0,&lt;br /&gt;
                 &amp;quot;author&amp;quot;: {&lt;br /&gt;
                   &amp;quot;email&amp;quot;: &amp;quot;61797592+Atharva7007@users.noreply.github.com&amp;quot;,&lt;br /&gt;
                   &amp;quot;name&amp;quot;: &amp;quot;Atharva Pansare&amp;quot;,&lt;br /&gt;
                   &amp;quot;user&amp;quot;: {&lt;br /&gt;
                     &amp;quot;login&amp;quot;: &amp;quot;Atharva7007&amp;quot;&lt;br /&gt;
                   }&lt;br /&gt;
                 },&lt;br /&gt;
                 &amp;quot;authoredDate&amp;quot;: &amp;quot;2020-04-03T09:30:17Z&amp;quot;,&lt;br /&gt;
                 &amp;quot;changedFilesIfAvailable&amp;quot;: 1,&lt;br /&gt;
                 &amp;quot;deletions&amp;quot;: 0,&lt;br /&gt;
                 &amp;quot;message&amp;quot;: &amp;quot;Add files via upload&amp;quot;,&lt;br /&gt;
                 &amp;quot;parents&amp;quot;: {&lt;br /&gt;
                   &amp;quot;totalCount&amp;quot;: 1&lt;br /&gt;
                 }&lt;br /&gt;
               }&lt;br /&gt;
             ],&lt;br /&gt;
             &amp;quot;pageInfo&amp;quot;: {&lt;br /&gt;
               &amp;quot;endCursor&amp;quot;: &amp;quot;98ba34a6c62ff6fe7c4d4de5c342a194f72d66e4 0&amp;quot;,&lt;br /&gt;
               &amp;quot;hasNextPage&amp;quot;: true&lt;br /&gt;
             },&lt;br /&gt;
             &amp;quot;totalCount&amp;quot;: 6&lt;br /&gt;
           }&lt;br /&gt;
         }&lt;br /&gt;
       }&lt;br /&gt;
     }&lt;br /&gt;
   }&lt;br /&gt;
 ]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Get details of all contributors in a repo:&lt;br /&gt;
 /api/rest/repository-contributors/&amp;lt;owner&amp;gt;/&amp;lt;repo_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This endpoint fetches the details of all contributors to a specific repository. It takes the repository owner and repository name as parameters. The endpoint retrieves the list of contributors from the GitHub API and returns information about each contributor, such as their username, avatar URL, and permissions within the repository.&lt;br /&gt;
&lt;br /&gt;
Sample Output:&lt;br /&gt;
[&lt;br /&gt;
  {&lt;br /&gt;
    &amp;quot;avatar_url&amp;quot;: &amp;quot;https://avatars.githubusercontent.com/u/61797592?v=4&amp;quot;,&lt;br /&gt;
    &amp;quot;events_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/events{/privacy}&amp;quot;,&lt;br /&gt;
    &amp;quot;followers_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/followers&amp;quot;,&lt;br /&gt;
    &amp;quot;following_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/following{/other_user}&amp;quot;,&lt;br /&gt;
    &amp;quot;gists_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/gists{/gist_id}&amp;quot;,&lt;br /&gt;
    &amp;quot;gravatar_id&amp;quot;: &amp;quot;&amp;quot;,&lt;br /&gt;
    &amp;quot;html_url&amp;quot;: &amp;quot;https://github.com/Atharva7007&amp;quot;,&lt;br /&gt;
    &amp;quot;id&amp;quot;: 61797592,&lt;br /&gt;
    &amp;quot;login&amp;quot;: &amp;quot;Atharva7007&amp;quot;,&lt;br /&gt;
    &amp;quot;node_id&amp;quot;: &amp;quot;MDQ6VXNlcjYxNzk3NTky&amp;quot;,&lt;br /&gt;
    &amp;quot;organizations_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/orgs&amp;quot;,&lt;br /&gt;
    &amp;quot;permissions&amp;quot;: {&lt;br /&gt;
      &amp;quot;admin&amp;quot;: true,&lt;br /&gt;
      &amp;quot;maintain&amp;quot;: true,&lt;br /&gt;
      &amp;quot;pull&amp;quot;: true,&lt;br /&gt;
      &amp;quot;push&amp;quot;: true,&lt;br /&gt;
      &amp;quot;triage&amp;quot;: true&lt;br /&gt;
    },&lt;br /&gt;
    &amp;quot;received_events_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/received_events&amp;quot;,&lt;br /&gt;
    &amp;quot;repos_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/repos&amp;quot;,&lt;br /&gt;
    &amp;quot;role_name&amp;quot;: &amp;quot;admin&amp;quot;,&lt;br /&gt;
    &amp;quot;site_admin&amp;quot;: false,&lt;br /&gt;
    &amp;quot;starred_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/starred{/owner}{/repo}&amp;quot;,&lt;br /&gt;
    &amp;quot;subscriptions_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/subscriptions&amp;quot;,&lt;br /&gt;
    &amp;quot;type&amp;quot;: &amp;quot;User&amp;quot;,&lt;br /&gt;
    &amp;quot;url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Implementation Details==&lt;br /&gt;
The GitHub Miner project consists of two main components: the backend API and the frontend user interface.&lt;br /&gt;
&lt;br /&gt;
The backend API is implemented using Flask, a lightweight Python web framework. It exposes two sets of endpoints: one for GraphQL queries and another for REST API queries. Flask Blueprints are used to route requests to the appropriate endpoints based on the URL path.&lt;br /&gt;
&lt;br /&gt;
The GraphQL implementation utilizes the `graphene` library, which provides a way to define GraphQL schemas and resolvers. The resolvers are responsible for fetching data from the GitHub API using the `pygithub` library.&lt;br /&gt;
&lt;br /&gt;
The REST implementation uses the `requests` library to make HTTP requests to the GitHub API and process the responses.&lt;br /&gt;
&lt;br /&gt;
To ensure reliability and robustness, comprehensive testing strategies, including unit tests and integration tests, have been implemented. These tests validate the functionality of the API endpoints across different scenarios, ensuring the system's correctness and stability.&lt;br /&gt;
&lt;br /&gt;
== Implementation Details == &lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
In the API, we have 2 separate endpoints to retrieve the same data: one for REST and the other using GraphQL queries. To manage this, we have made use of Flask Blueprints where all the &amp;quot;api/graphql&amp;quot; requests get routed to the graphql variants and the &amp;quot;api/rest&amp;quot; requests get routed to the REST variants.&lt;br /&gt;
&lt;br /&gt;
=== Design Patterns used ===&lt;br /&gt;
# The REST API Client '''/backend/app/services/github_query/github_rest/client.py''' is a Singleton.&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
To ensure the reliability and robustness of the GitHub Miner, comprehensive testing strategies, including unit tests and integration tests, have been implemented. These tests validate the functionality of the API endpoints across different scenarios, ensuring the system's correctness and stability. The testing suite covers the following areas:&lt;br /&gt;
&lt;br /&gt;
=== Unit Tests ===&lt;br /&gt;
&lt;br /&gt;
Unit tests have been developed to test individual components in isolation, ensuring that each part functions correctly on its own. This includes testing the initialization, argument formatting, field formatting, string representation, and equality of query nodes, as well as the correct behavior of the query builders and authenticators. Examples of unit tests include:&lt;br /&gt;
&lt;br /&gt;
- **TestQueryNode**: Validates the initialization, argument formatting, and field formatting of query nodes.&lt;br /&gt;
&lt;br /&gt;
- **TestQuery**: Ensures correct query initialization, argument substitution, and time formatting.&lt;br /&gt;
&lt;br /&gt;
- **TestQueryNodePaginator**: Tests the functionality of the paginator, including initialization, updating, and resetting.&lt;br /&gt;
&lt;br /&gt;
- **TestPaginatedQuery**: Validates the initialization and execution of paginated queries.&lt;br /&gt;
&lt;br /&gt;
=== Integration Tests ===&lt;br /&gt;
&lt;br /&gt;
Integration tests verify the interaction between different components of the system, ensuring that they work together as expected. This includes testing the behavior of the client when making actual requests to the GitHub API, handling authentication, executing queries, and processing paginated responses. Examples of integration tests include:&lt;br /&gt;
&lt;br /&gt;
- **TestClient**: Tests the GitHub client's initialization, header generation, retry logic, query execution, and handling of paginated queries.&lt;br /&gt;
- **Authentication Tests**: Validate the generation of correct authorization headers and the handling of personal access tokens.&lt;br /&gt;
&lt;br /&gt;
These tests collectively ensure that the GitHub Miner operates reliably, providing accurate and timely data from GitHub's APIs. By covering a wide range of scenarios, from successful queries to error handling and rate limiting, the tests ensure that the application can be used confidently in production environments.&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
Atharva Pansare&lt;br /&gt;
&lt;br /&gt;
Sumedh Limburkar&lt;br /&gt;
&lt;br /&gt;
Viraj Sanap&lt;br /&gt;
&lt;br /&gt;
Mengning Li&lt;br /&gt;
&lt;br /&gt;
Mentor: Jialin Cui&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
GitHub REST API documentation - https://docs.github.com/en/rest?apiVersion=2022-11-28&lt;/div&gt;</summary>
		<author><name>Slimbur</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_G2402_Implement_REST_client,_REST_API,_and_Graphql_API_endpoint_for_repositories_-_Part_2&amp;diff=155606</id>
		<title>CSC/ECE 517 Spring 2024 - G2402 Implement REST client, REST API, and Graphql API endpoint for repositories - Part 2</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_G2402_Implement_REST_client,_REST_API,_and_Graphql_API_endpoint_for_repositories_-_Part_2&amp;diff=155606"/>
		<updated>2024-04-09T06:20:50Z</updated>

		<summary type="html">&lt;p&gt;Slimbur: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
== GitHub Miner ==&lt;br /&gt;
This is a convenient tool to query a user's GitHub metrics. The project aims to develop API endpoints for GitHub GraphQL queries and GitHub REST queries using Python Flask. It involves integrating existing code with Flask to expose GraphQL queries as API endpoints, developing a REST client, and creating REST endpoints for querying the same data sets. The project also includes thorough testing and documentation of the endpoints.&lt;br /&gt;
&lt;br /&gt;
==Live Demo &amp;amp; Source Code==&lt;br /&gt;
http://152.7.177.239:5000/auth/login Link]&lt;br /&gt;
(Please login using your personal GitHub accounts, not NCSU accounts)&lt;br /&gt;
&lt;br /&gt;
[https://github.ncsu.edu/slimbur/GH_Miner Source Code]&lt;br /&gt;
&lt;br /&gt;
==Below is the MVC architecture of our GitHub project:==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:MVC2.drawio.png|900px|Image : 900 pixels]]&lt;br /&gt;
&lt;br /&gt;
==Plan of Work==&lt;br /&gt;
In the second phase of the project, we will focus on developing a robust and user-friendly frontend using React. The frontend will serve as an intuitive interface for displaying and interacting with the data retrieved from the GitHub API endpoints implemented in the first phase.&lt;br /&gt;
&lt;br /&gt;
The plan includes the following key steps:&lt;br /&gt;
&lt;br /&gt;
1. **Setup React Environment**: We will set up a modern React development environment, including the necessary tooling, dependencies, and libraries required for building a performant and scalable frontend application.&lt;br /&gt;
&lt;br /&gt;
2. **Design UI Components**: We will design and develop reusable UI components to present the data from the API endpoints in a visually appealing and organized manner. These components will follow best practices for React component development, ensuring modularity, reusability, and maintainability.&lt;br /&gt;
&lt;br /&gt;
3. **Integrate with API Endpoints**: The React frontend will integrate seamlessly with the existing API endpoints. We will implement efficient HTTP request handling mechanisms to fetch data from the endpoints and update the UI components accordingly.&lt;br /&gt;
&lt;br /&gt;
4. **Implement Pagination**: For endpoints that return paginated data, we will implement intuitive pagination functionality in the React UI. This will allow users to navigate through the results smoothly, enhancing the overall user experience.&lt;br /&gt;
&lt;br /&gt;
5. **Enhance User Experience**: We will focus on improving the user experience by adding features such as search functionality, filtering, sorting, and other relevant enhancements based on the data being displayed. These enhancements will empower users to interact with the data more effectively and derive valuable insights.&lt;br /&gt;
&lt;br /&gt;
6. **Test and Debug**: Thorough testing and debugging will be a critical part of the development process. We will implement unit tests and end-to-end tests to ensure the React frontend functions correctly and consistently across different browsers and devices.&lt;br /&gt;
&lt;br /&gt;
7. **Deploy and Document**: Finally, we will deploy the React frontend to a hosting platform, ensuring it is accessible and easily usable by end-users. Comprehensive documentation will be provided, including instructions for setup, usage, and any relevant information for future maintenance and development.&lt;br /&gt;
&lt;br /&gt;
==GraphQL Endpoints==&lt;br /&gt;
&lt;br /&gt;
Get current user login:&lt;br /&gt;
 /api/graphql/current-user-login&lt;br /&gt;
&lt;br /&gt;
Sample Output:&lt;br /&gt;
 {&lt;br /&gt;
   &amp;quot;viewer&amp;quot;: {&lt;br /&gt;
     &amp;quot;login&amp;quot;: &amp;quot;&amp;lt;your-username&amp;gt;&amp;quot;&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Get specific user login:&lt;br /&gt;
 /api/graphql/user-login/&amp;lt;username&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get list of all commits in a repo:&lt;br /&gt;
 /api/graphql/specific-user-commits/&amp;lt;owner&amp;gt;/&amp;lt;repo_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sample Output:&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;repository&amp;quot;: {&lt;br /&gt;
      &amp;quot;defaultBranchRef&amp;quot;: {&lt;br /&gt;
        &amp;quot;target&amp;quot;: {&lt;br /&gt;
          &amp;quot;history&amp;quot;: {&lt;br /&gt;
            &amp;quot;nodes&amp;quot;: [&lt;br /&gt;
              {&lt;br /&gt;
                &amp;quot;additions&amp;quot;: 0,&lt;br /&gt;
                &amp;quot;author&amp;quot;: {&lt;br /&gt;
                  &amp;quot;email&amp;quot;: &amp;quot;61797592+Atharva7007@users.noreply.github.com&amp;quot;,&lt;br /&gt;
                  &amp;quot;name&amp;quot;: &amp;quot;Atharva Pansare&amp;quot;,&lt;br /&gt;
                  &amp;quot;user&amp;quot;: {&lt;br /&gt;
                    &amp;quot;login&amp;quot;: &amp;quot;Atharva7007&amp;quot;&lt;br /&gt;
                  }&lt;br /&gt;
                },&lt;br /&gt;
                &amp;quot;authoredDate&amp;quot;: &amp;quot;2020-04-03T09:30:17Z&amp;quot;,&lt;br /&gt;
                &amp;quot;changedFilesIfAvailable&amp;quot;: 1,&lt;br /&gt;
                &amp;quot;deletions&amp;quot;: 0,&lt;br /&gt;
                &amp;quot;message&amp;quot;: &amp;quot;Add files via upload&amp;quot;,&lt;br /&gt;
                &amp;quot;parents&amp;quot;: {&lt;br /&gt;
                  &amp;quot;totalCount&amp;quot;: 1&lt;br /&gt;
                }&lt;br /&gt;
              }&lt;br /&gt;
            ],&lt;br /&gt;
            &amp;quot;pageInfo&amp;quot;: {&lt;br /&gt;
              &amp;quot;endCursor&amp;quot;: &amp;quot;98ba34a6c62ff6fe7c4d4de5c342a194f72d66e4 0&amp;quot;,&lt;br /&gt;
              &amp;quot;hasNextPage&amp;quot;: true&lt;br /&gt;
            },&lt;br /&gt;
            &amp;quot;totalCount&amp;quot;: 6&lt;br /&gt;
          }&lt;br /&gt;
        }&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
Get details of all contributors in a repo:&lt;br /&gt;
 /api/graphql/repository-contributors/&amp;lt;owner&amp;gt;/&amp;lt;repo_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sample Output:&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;repository&amp;quot;: {&lt;br /&gt;
      &amp;quot;defaultBranchRef&amp;quot;: {&lt;br /&gt;
        &amp;quot;target&amp;quot;: {&lt;br /&gt;
          &amp;quot;history&amp;quot;: {&lt;br /&gt;
            &amp;quot;nodes&amp;quot;: [&lt;br /&gt;
              {&lt;br /&gt;
                &amp;quot;author&amp;quot;: {&lt;br /&gt;
                  &amp;quot;email&amp;quot;: &amp;quot;61797592+Atharva7007@users.noreply.github.com&amp;quot;,&lt;br /&gt;
                  &amp;quot;name&amp;quot;: &amp;quot;Atharva Pansare&amp;quot;,&lt;br /&gt;
                  &amp;quot;user&amp;quot;: {&lt;br /&gt;
                    &amp;quot;login&amp;quot;: &amp;quot;Atharva7007&amp;quot;&lt;br /&gt;
                  }&lt;br /&gt;
                }&lt;br /&gt;
              }&lt;br /&gt;
            ],&lt;br /&gt;
            &amp;quot;pageInfo&amp;quot;: {&lt;br /&gt;
              &amp;quot;endCursor&amp;quot;: &amp;quot;98ba34a6c62ff6fe7c4d4de5c342a194f72d66e4 0&amp;quot;,&lt;br /&gt;
              &amp;quot;hasNextPage&amp;quot;: true&lt;br /&gt;
            },&lt;br /&gt;
            &amp;quot;totalCount&amp;quot;: 6&lt;br /&gt;
          }&lt;br /&gt;
        }&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
==REST API Endpoints==&lt;br /&gt;
Get current user login:&lt;br /&gt;
 /api/rest/current-user-login-rest&lt;br /&gt;
&lt;br /&gt;
This endpoint retrieves the login information of the currently authenticated user. It fetches the user's profile data from the GitHub API and returns details such as their username, avatar URL, and other relevant information.&lt;br /&gt;
&lt;br /&gt;
Sample Output:&lt;br /&gt;
 {&lt;br /&gt;
   &amp;quot;avatar_url&amp;quot;: &amp;quot;https://avatars.githubusercontent.com/u/61797592?v=4&amp;quot;,&lt;br /&gt;
   &amp;quot;bio&amp;quot;: null,&lt;br /&gt;
   &amp;quot;blog&amp;quot;: &amp;quot;&amp;quot;,&lt;br /&gt;
   &amp;quot;company&amp;quot;: null,&lt;br /&gt;
   &amp;quot;created_at&amp;quot;: &amp;quot;2020-03-04T16:49:06Z&amp;quot;,&lt;br /&gt;
   &amp;quot;email&amp;quot;: null,&lt;br /&gt;
   &amp;quot;events_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/events{/privacy}&amp;quot;,&lt;br /&gt;
   &amp;quot;followers&amp;quot;: 1,&lt;br /&gt;
   &amp;quot;followers_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/followers&amp;quot;,&lt;br /&gt;
   &amp;quot;following&amp;quot;: 3,&lt;br /&gt;
   &amp;quot;following_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/following{/other_user}&amp;quot;,&lt;br /&gt;
   &amp;quot;gists_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/gists{/gist_id}&amp;quot;,&lt;br /&gt;
   &amp;quot;gravatar_id&amp;quot;: &amp;quot;&amp;quot;,&lt;br /&gt;
   &amp;quot;hireable&amp;quot;: null,&lt;br /&gt;
   &amp;quot;html_url&amp;quot;: &amp;quot;https://github.com/Atharva7007&amp;quot;,&lt;br /&gt;
   &amp;quot;id&amp;quot;: 61797592,&lt;br /&gt;
   &amp;quot;location&amp;quot;: null,&lt;br /&gt;
   &amp;quot;login&amp;quot;: &amp;quot;Atharva7007&amp;quot;,&lt;br /&gt;
   &amp;quot;name&amp;quot;: &amp;quot;Atharva Pansare&amp;quot;,&lt;br /&gt;
   &amp;quot;node_id&amp;quot;: &amp;quot;MDQ6VXNlcjYxNzk3NTky&amp;quot;,&lt;br /&gt;
   &amp;quot;organizations_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/orgs&amp;quot;,&lt;br /&gt;
   &amp;quot;public_gists&amp;quot;: 0,&lt;br /&gt;
   &amp;quot;public_repos&amp;quot;: 11,&lt;br /&gt;
   &amp;quot;received_events_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/received_events&amp;quot;,&lt;br /&gt;
   &amp;quot;repos_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/repos&amp;quot;,&lt;br /&gt;
   &amp;quot;site_admin&amp;quot;: false,&lt;br /&gt;
   &amp;quot;starred_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/starred{/owner}{/repo}&amp;quot;,&lt;br /&gt;
   &amp;quot;subscriptions_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/subscriptions&amp;quot;,&lt;br /&gt;
   &amp;quot;twitter_username&amp;quot;: null,&lt;br /&gt;
   &amp;quot;type&amp;quot;: &amp;quot;User&amp;quot;,&lt;br /&gt;
   &amp;quot;updated_at&amp;quot;: &amp;quot;2024-03-14T19:03:46Z&amp;quot;,&lt;br /&gt;
   &amp;quot;url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007&amp;quot;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Get list of all commits in a repo:&lt;br /&gt;
 /api/rest/specific-user-commits/&amp;lt;owner&amp;gt;/&amp;lt;repo_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This endpoint retrieves a list of all commits made to a specific repository. It takes the repository owner and repository name as parameters. The endpoint fetches the commit history from the GitHub API and returns details about each commit, such as the author, commit message, and changes made.&lt;br /&gt;
&lt;br /&gt;
Sample Output:&lt;br /&gt;
 [&lt;br /&gt;
   {&lt;br /&gt;
     &amp;quot;repository&amp;quot;: {&lt;br /&gt;
       &amp;quot;defaultBranchRef&amp;quot;: {&lt;br /&gt;
         &amp;quot;target&amp;quot;: {&lt;br /&gt;
           &amp;quot;history&amp;quot;: {&lt;br /&gt;
             &amp;quot;nodes&amp;quot;: [&lt;br /&gt;
               {&lt;br /&gt;
                 &amp;quot;additions&amp;quot;: 0,&lt;br /&gt;
                 &amp;quot;author&amp;quot;: {&lt;br /&gt;
                   &amp;quot;email&amp;quot;: &amp;quot;61797592+Atharva7007@users.noreply.github.com&amp;quot;,&lt;br /&gt;
                   &amp;quot;name&amp;quot;: &amp;quot;Atharva Pansare&amp;quot;,&lt;br /&gt;
                   &amp;quot;user&amp;quot;: {&lt;br /&gt;
                     &amp;quot;login&amp;quot;: &amp;quot;Atharva7007&amp;quot;&lt;br /&gt;
                   }&lt;br /&gt;
                 },&lt;br /&gt;
                 &amp;quot;authoredDate&amp;quot;: &amp;quot;2020-04-03T09:30:17Z&amp;quot;,&lt;br /&gt;
                 &amp;quot;changedFilesIfAvailable&amp;quot;: 1,&lt;br /&gt;
                 &amp;quot;deletions&amp;quot;: 0,&lt;br /&gt;
                 &amp;quot;message&amp;quot;: &amp;quot;Add files via upload&amp;quot;,&lt;br /&gt;
                 &amp;quot;parents&amp;quot;: {&lt;br /&gt;
                   &amp;quot;totalCount&amp;quot;: 1&lt;br /&gt;
                 }&lt;br /&gt;
               }&lt;br /&gt;
             ],&lt;br /&gt;
             &amp;quot;pageInfo&amp;quot;: {&lt;br /&gt;
               &amp;quot;endCursor&amp;quot;: &amp;quot;98ba34a6c62ff6fe7c4d4de5c342a194f72d66e4 0&amp;quot;,&lt;br /&gt;
               &amp;quot;hasNextPage&amp;quot;: true&lt;br /&gt;
             },&lt;br /&gt;
             &amp;quot;totalCount&amp;quot;: 6&lt;br /&gt;
           }&lt;br /&gt;
         }&lt;br /&gt;
       }&lt;br /&gt;
     }&lt;br /&gt;
   }&lt;br /&gt;
 ]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Get details of all contributors in a repo:&lt;br /&gt;
 /api/rest/repository-contributors/&amp;lt;owner&amp;gt;/&amp;lt;repo_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This endpoint fetches the details of all contributors to a specific repository. It takes the repository owner and repository name as parameters. The endpoint retrieves the list of contributors from the GitHub API and returns information about each contributor, such as their username, avatar URL, and permissions within the repository.&lt;br /&gt;
&lt;br /&gt;
Sample Output:&lt;br /&gt;
[&lt;br /&gt;
  {&lt;br /&gt;
    &amp;quot;avatar_url&amp;quot;: &amp;quot;https://avatars.githubusercontent.com/u/61797592?v=4&amp;quot;,&lt;br /&gt;
    &amp;quot;events_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/events{/privacy}&amp;quot;,&lt;br /&gt;
    &amp;quot;followers_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/followers&amp;quot;,&lt;br /&gt;
    &amp;quot;following_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/following{/other_user}&amp;quot;,&lt;br /&gt;
    &amp;quot;gists_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/gists{/gist_id}&amp;quot;,&lt;br /&gt;
    &amp;quot;gravatar_id&amp;quot;: &amp;quot;&amp;quot;,&lt;br /&gt;
    &amp;quot;html_url&amp;quot;: &amp;quot;https://github.com/Atharva7007&amp;quot;,&lt;br /&gt;
    &amp;quot;id&amp;quot;: 61797592,&lt;br /&gt;
    &amp;quot;login&amp;quot;: &amp;quot;Atharva7007&amp;quot;,&lt;br /&gt;
    &amp;quot;node_id&amp;quot;: &amp;quot;MDQ6VXNlcjYxNzk3NTky&amp;quot;,&lt;br /&gt;
    &amp;quot;organizations_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/orgs&amp;quot;,&lt;br /&gt;
    &amp;quot;permissions&amp;quot;: {&lt;br /&gt;
      &amp;quot;admin&amp;quot;: true,&lt;br /&gt;
      &amp;quot;maintain&amp;quot;: true,&lt;br /&gt;
      &amp;quot;pull&amp;quot;: true,&lt;br /&gt;
      &amp;quot;push&amp;quot;: true,&lt;br /&gt;
      &amp;quot;triage&amp;quot;: true&lt;br /&gt;
    },&lt;br /&gt;
    &amp;quot;received_events_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/received_events&amp;quot;,&lt;br /&gt;
    &amp;quot;repos_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/repos&amp;quot;,&lt;br /&gt;
    &amp;quot;role_name&amp;quot;: &amp;quot;admin&amp;quot;,&lt;br /&gt;
    &amp;quot;site_admin&amp;quot;: false,&lt;br /&gt;
    &amp;quot;starred_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/starred{/owner}{/repo}&amp;quot;,&lt;br /&gt;
    &amp;quot;subscriptions_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/subscriptions&amp;quot;,&lt;br /&gt;
    &amp;quot;type&amp;quot;: &amp;quot;User&amp;quot;,&lt;br /&gt;
    &amp;quot;url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Implementation Details==&lt;br /&gt;
The GitHub Miner project consists of two main components: the backend API and the frontend user interface.&lt;br /&gt;
&lt;br /&gt;
The backend API is implemented using Flask, a lightweight Python web framework. It exposes two sets of endpoints: one for GraphQL queries and another for REST API queries. Flask Blueprints are used to route requests to the appropriate endpoints based on the URL path.&lt;br /&gt;
&lt;br /&gt;
The GraphQL implementation utilizes the `graphene` library, which provides a way to define GraphQL schemas and resolvers. The resolvers are responsible for fetching data from the GitHub API using the `pygithub` library.&lt;br /&gt;
&lt;br /&gt;
The REST implementation uses the `requests` library to make HTTP requests to the GitHub API and process the responses.&lt;br /&gt;
&lt;br /&gt;
To ensure reliability and robustness, comprehensive testing strategies, including unit tests and integration tests, have been implemented. These tests validate the functionality of the API endpoints across different scenarios, ensuring the system's correctness and stability.&lt;br /&gt;
&lt;br /&gt;
== Implementation Details == &lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
In the API, we have 2 separate endpoints to retrieve the same data: one for REST and the other using GraphQL queries. To manage this, we have made use of Flask Blueprints where all the &amp;quot;api/graphql&amp;quot; requests get routed to the graphql variants and the &amp;quot;api/rest&amp;quot; requests get routed to the REST variants.&lt;br /&gt;
&lt;br /&gt;
=== Design Patterns used ===&lt;br /&gt;
# The REST API Client '''/backend/app/services/github_query/github_rest/client.py''' is a Singleton.&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
To ensure the reliability and robustness of the GitHub Miner, comprehensive testing strategies, including unit tests and integration tests, have been implemented. These tests validate the functionality of the API endpoints across different scenarios, ensuring the system's correctness and stability. The testing suite covers the following areas:&lt;br /&gt;
&lt;br /&gt;
=== Unit Tests ===&lt;br /&gt;
&lt;br /&gt;
Unit tests have been developed to test individual components in isolation, ensuring that each part functions correctly on its own. This includes testing the initialization, argument formatting, field formatting, string representation, and equality of query nodes, as well as the correct behavior of the query builders and authenticators. Examples of unit tests include:&lt;br /&gt;
&lt;br /&gt;
- **TestQueryNode**: Validates the initialization, argument formatting, and field formatting of query nodes.&lt;br /&gt;
&lt;br /&gt;
- **TestQuery**: Ensures correct query initialization, argument substitution, and time formatting.&lt;br /&gt;
&lt;br /&gt;
- **TestQueryNodePaginator**: Tests the functionality of the paginator, including initialization, updating, and resetting.&lt;br /&gt;
&lt;br /&gt;
- **TestPaginatedQuery**: Validates the initialization and execution of paginated queries.&lt;br /&gt;
&lt;br /&gt;
=== Integration Tests ===&lt;br /&gt;
&lt;br /&gt;
Integration tests verify the interaction between different components of the system, ensuring that they work together as expected. This includes testing the behavior of the client when making actual requests to the GitHub API, handling authentication, executing queries, and processing paginated responses. Examples of integration tests include:&lt;br /&gt;
&lt;br /&gt;
- **TestClient**: Tests the GitHub client's initialization, header generation, retry logic, query execution, and handling of paginated queries.&lt;br /&gt;
- **Authentication Tests**: Validate the generation of correct authorization headers and the handling of personal access tokens.&lt;br /&gt;
&lt;br /&gt;
These tests collectively ensure that the GitHub Miner operates reliably, providing accurate and timely data from GitHub's APIs. By covering a wide range of scenarios, from successful queries to error handling and rate limiting, the tests ensure that the application can be used confidently in production environments.&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
Atharva Pansare&lt;br /&gt;
&lt;br /&gt;
Sumedh Limburkar&lt;br /&gt;
&lt;br /&gt;
Viraj Sanap&lt;br /&gt;
&lt;br /&gt;
Mengning Li&lt;br /&gt;
&lt;br /&gt;
Mentor: Jialin Cui&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
GitHub REST API documentation - https://docs.github.com/en/rest?apiVersion=2022-11-28&lt;/div&gt;</summary>
		<author><name>Slimbur</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_G2402_Implement_REST_client,_REST_API,_and_Graphql_API_endpoint_for_repositories_-_Part_2&amp;diff=155605</id>
		<title>CSC/ECE 517 Spring 2024 - G2402 Implement REST client, REST API, and Graphql API endpoint for repositories - Part 2</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_G2402_Implement_REST_client,_REST_API,_and_Graphql_API_endpoint_for_repositories_-_Part_2&amp;diff=155605"/>
		<updated>2024-04-09T06:19:18Z</updated>

		<summary type="html">&lt;p&gt;Slimbur: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
== GitHub Miner ==&lt;br /&gt;
This is a convenient tool to query a user's GitHub metrics. The project aims to develop API endpoints for GitHub GraphQL queries and GitHub REST queries using Python Flask. It involves integrating existing code with Flask to expose GraphQL queries as API endpoints, developing a REST client, and creating REST endpoints for querying the same data sets. The project also includes thorough testing and documentation of the endpoints.&lt;br /&gt;
&lt;br /&gt;
==Live Demo &amp;amp; Source Code==&lt;br /&gt;
http://152.7.177.239:5000/auth/login Link]&lt;br /&gt;
(Please login using your personal GitHub accounts, not NCSU accounts)&lt;br /&gt;
&lt;br /&gt;
[https://github.ncsu.edu/slimbur/GH_Miner Source Code]&lt;br /&gt;
&lt;br /&gt;
==Below is the MVC architecture of our GitHub project:==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:MVC2.drawio.png|900px|Image : 900 pixels]]&lt;br /&gt;
&lt;br /&gt;
==GraphQL Endpoints==&lt;br /&gt;
&lt;br /&gt;
Get current user login:&lt;br /&gt;
 /api/graphql/current-user-login&lt;br /&gt;
&lt;br /&gt;
Sample Output:&lt;br /&gt;
 {&lt;br /&gt;
   &amp;quot;viewer&amp;quot;: {&lt;br /&gt;
     &amp;quot;login&amp;quot;: &amp;quot;&amp;lt;your-username&amp;gt;&amp;quot;&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Get specific user login:&lt;br /&gt;
 /api/graphql/user-login/&amp;lt;username&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get list of all commits in a repo:&lt;br /&gt;
 /api/graphql/specific-user-commits/&amp;lt;owner&amp;gt;/&amp;lt;repo_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sample Output:&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;repository&amp;quot;: {&lt;br /&gt;
      &amp;quot;defaultBranchRef&amp;quot;: {&lt;br /&gt;
        &amp;quot;target&amp;quot;: {&lt;br /&gt;
          &amp;quot;history&amp;quot;: {&lt;br /&gt;
            &amp;quot;nodes&amp;quot;: [&lt;br /&gt;
              {&lt;br /&gt;
                &amp;quot;additions&amp;quot;: 0,&lt;br /&gt;
                &amp;quot;author&amp;quot;: {&lt;br /&gt;
                  &amp;quot;email&amp;quot;: &amp;quot;61797592+Atharva7007@users.noreply.github.com&amp;quot;,&lt;br /&gt;
                  &amp;quot;name&amp;quot;: &amp;quot;Atharva Pansare&amp;quot;,&lt;br /&gt;
                  &amp;quot;user&amp;quot;: {&lt;br /&gt;
                    &amp;quot;login&amp;quot;: &amp;quot;Atharva7007&amp;quot;&lt;br /&gt;
                  }&lt;br /&gt;
                },&lt;br /&gt;
                &amp;quot;authoredDate&amp;quot;: &amp;quot;2020-04-03T09:30:17Z&amp;quot;,&lt;br /&gt;
                &amp;quot;changedFilesIfAvailable&amp;quot;: 1,&lt;br /&gt;
                &amp;quot;deletions&amp;quot;: 0,&lt;br /&gt;
                &amp;quot;message&amp;quot;: &amp;quot;Add files via upload&amp;quot;,&lt;br /&gt;
                &amp;quot;parents&amp;quot;: {&lt;br /&gt;
                  &amp;quot;totalCount&amp;quot;: 1&lt;br /&gt;
                }&lt;br /&gt;
              }&lt;br /&gt;
            ],&lt;br /&gt;
            &amp;quot;pageInfo&amp;quot;: {&lt;br /&gt;
              &amp;quot;endCursor&amp;quot;: &amp;quot;98ba34a6c62ff6fe7c4d4de5c342a194f72d66e4 0&amp;quot;,&lt;br /&gt;
              &amp;quot;hasNextPage&amp;quot;: true&lt;br /&gt;
            },&lt;br /&gt;
            &amp;quot;totalCount&amp;quot;: 6&lt;br /&gt;
          }&lt;br /&gt;
        }&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
Get details of all contributors in a repo:&lt;br /&gt;
 /api/graphql/repository-contributors/&amp;lt;owner&amp;gt;/&amp;lt;repo_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sample Output:&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;repository&amp;quot;: {&lt;br /&gt;
      &amp;quot;defaultBranchRef&amp;quot;: {&lt;br /&gt;
        &amp;quot;target&amp;quot;: {&lt;br /&gt;
          &amp;quot;history&amp;quot;: {&lt;br /&gt;
            &amp;quot;nodes&amp;quot;: [&lt;br /&gt;
              {&lt;br /&gt;
                &amp;quot;author&amp;quot;: {&lt;br /&gt;
                  &amp;quot;email&amp;quot;: &amp;quot;61797592+Atharva7007@users.noreply.github.com&amp;quot;,&lt;br /&gt;
                  &amp;quot;name&amp;quot;: &amp;quot;Atharva Pansare&amp;quot;,&lt;br /&gt;
                  &amp;quot;user&amp;quot;: {&lt;br /&gt;
                    &amp;quot;login&amp;quot;: &amp;quot;Atharva7007&amp;quot;&lt;br /&gt;
                  }&lt;br /&gt;
                }&lt;br /&gt;
              }&lt;br /&gt;
            ],&lt;br /&gt;
            &amp;quot;pageInfo&amp;quot;: {&lt;br /&gt;
              &amp;quot;endCursor&amp;quot;: &amp;quot;98ba34a6c62ff6fe7c4d4de5c342a194f72d66e4 0&amp;quot;,&lt;br /&gt;
              &amp;quot;hasNextPage&amp;quot;: true&lt;br /&gt;
            },&lt;br /&gt;
            &amp;quot;totalCount&amp;quot;: 6&lt;br /&gt;
          }&lt;br /&gt;
        }&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
==REST API Endpoints==&lt;br /&gt;
Get current user login:&lt;br /&gt;
 /api/rest/current-user-login-rest&lt;br /&gt;
&lt;br /&gt;
This endpoint retrieves the login information of the currently authenticated user. It fetches the user's profile data from the GitHub API and returns details such as their username, avatar URL, and other relevant information.&lt;br /&gt;
&lt;br /&gt;
Sample Output:&lt;br /&gt;
 {&lt;br /&gt;
   &amp;quot;avatar_url&amp;quot;: &amp;quot;https://avatars.githubusercontent.com/u/61797592?v=4&amp;quot;,&lt;br /&gt;
   &amp;quot;bio&amp;quot;: null,&lt;br /&gt;
   &amp;quot;blog&amp;quot;: &amp;quot;&amp;quot;,&lt;br /&gt;
   &amp;quot;company&amp;quot;: null,&lt;br /&gt;
   &amp;quot;created_at&amp;quot;: &amp;quot;2020-03-04T16:49:06Z&amp;quot;,&lt;br /&gt;
   &amp;quot;email&amp;quot;: null,&lt;br /&gt;
   &amp;quot;events_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/events{/privacy}&amp;quot;,&lt;br /&gt;
   &amp;quot;followers&amp;quot;: 1,&lt;br /&gt;
   &amp;quot;followers_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/followers&amp;quot;,&lt;br /&gt;
   &amp;quot;following&amp;quot;: 3,&lt;br /&gt;
   &amp;quot;following_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/following{/other_user}&amp;quot;,&lt;br /&gt;
   &amp;quot;gists_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/gists{/gist_id}&amp;quot;,&lt;br /&gt;
   &amp;quot;gravatar_id&amp;quot;: &amp;quot;&amp;quot;,&lt;br /&gt;
   &amp;quot;hireable&amp;quot;: null,&lt;br /&gt;
   &amp;quot;html_url&amp;quot;: &amp;quot;https://github.com/Atharva7007&amp;quot;,&lt;br /&gt;
   &amp;quot;id&amp;quot;: 61797592,&lt;br /&gt;
   &amp;quot;location&amp;quot;: null,&lt;br /&gt;
   &amp;quot;login&amp;quot;: &amp;quot;Atharva7007&amp;quot;,&lt;br /&gt;
   &amp;quot;name&amp;quot;: &amp;quot;Atharva Pansare&amp;quot;,&lt;br /&gt;
   &amp;quot;node_id&amp;quot;: &amp;quot;MDQ6VXNlcjYxNzk3NTky&amp;quot;,&lt;br /&gt;
   &amp;quot;organizations_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/orgs&amp;quot;,&lt;br /&gt;
   &amp;quot;public_gists&amp;quot;: 0,&lt;br /&gt;
   &amp;quot;public_repos&amp;quot;: 11,&lt;br /&gt;
   &amp;quot;received_events_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/received_events&amp;quot;,&lt;br /&gt;
   &amp;quot;repos_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/repos&amp;quot;,&lt;br /&gt;
   &amp;quot;site_admin&amp;quot;: false,&lt;br /&gt;
   &amp;quot;starred_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/starred{/owner}{/repo}&amp;quot;,&lt;br /&gt;
   &amp;quot;subscriptions_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/subscriptions&amp;quot;,&lt;br /&gt;
   &amp;quot;twitter_username&amp;quot;: null,&lt;br /&gt;
   &amp;quot;type&amp;quot;: &amp;quot;User&amp;quot;,&lt;br /&gt;
   &amp;quot;updated_at&amp;quot;: &amp;quot;2024-03-14T19:03:46Z&amp;quot;,&lt;br /&gt;
   &amp;quot;url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007&amp;quot;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Get list of all commits in a repo:&lt;br /&gt;
 /api/rest/specific-user-commits/&amp;lt;owner&amp;gt;/&amp;lt;repo_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This endpoint retrieves a list of all commits made to a specific repository. It takes the repository owner and repository name as parameters. The endpoint fetches the commit history from the GitHub API and returns details about each commit, such as the author, commit message, and changes made.&lt;br /&gt;
&lt;br /&gt;
Sample Output:&lt;br /&gt;
 [&lt;br /&gt;
   {&lt;br /&gt;
     &amp;quot;repository&amp;quot;: {&lt;br /&gt;
       &amp;quot;defaultBranchRef&amp;quot;: {&lt;br /&gt;
         &amp;quot;target&amp;quot;: {&lt;br /&gt;
           &amp;quot;history&amp;quot;: {&lt;br /&gt;
             &amp;quot;nodes&amp;quot;: [&lt;br /&gt;
               {&lt;br /&gt;
                 &amp;quot;additions&amp;quot;: 0,&lt;br /&gt;
                 &amp;quot;author&amp;quot;: {&lt;br /&gt;
                   &amp;quot;email&amp;quot;: &amp;quot;61797592+Atharva7007@users.noreply.github.com&amp;quot;,&lt;br /&gt;
                   &amp;quot;name&amp;quot;: &amp;quot;Atharva Pansare&amp;quot;,&lt;br /&gt;
                   &amp;quot;user&amp;quot;: {&lt;br /&gt;
                     &amp;quot;login&amp;quot;: &amp;quot;Atharva7007&amp;quot;&lt;br /&gt;
                   }&lt;br /&gt;
                 },&lt;br /&gt;
                 &amp;quot;authoredDate&amp;quot;: &amp;quot;2020-04-03T09:30:17Z&amp;quot;,&lt;br /&gt;
                 &amp;quot;changedFilesIfAvailable&amp;quot;: 1,&lt;br /&gt;
                 &amp;quot;deletions&amp;quot;: 0,&lt;br /&gt;
                 &amp;quot;message&amp;quot;: &amp;quot;Add files via upload&amp;quot;,&lt;br /&gt;
                 &amp;quot;parents&amp;quot;: {&lt;br /&gt;
                   &amp;quot;totalCount&amp;quot;: 1&lt;br /&gt;
                 }&lt;br /&gt;
               }&lt;br /&gt;
             ],&lt;br /&gt;
             &amp;quot;pageInfo&amp;quot;: {&lt;br /&gt;
               &amp;quot;endCursor&amp;quot;: &amp;quot;98ba34a6c62ff6fe7c4d4de5c342a194f72d66e4 0&amp;quot;,&lt;br /&gt;
               &amp;quot;hasNextPage&amp;quot;: true&lt;br /&gt;
             },&lt;br /&gt;
             &amp;quot;totalCount&amp;quot;: 6&lt;br /&gt;
           }&lt;br /&gt;
         }&lt;br /&gt;
       }&lt;br /&gt;
     }&lt;br /&gt;
   }&lt;br /&gt;
 ]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Get details of all contributors in a repo:&lt;br /&gt;
 /api/rest/repository-contributors/&amp;lt;owner&amp;gt;/&amp;lt;repo_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This endpoint fetches the details of all contributors to a specific repository. It takes the repository owner and repository name as parameters. The endpoint retrieves the list of contributors from the GitHub API and returns information about each contributor, such as their username, avatar URL, and permissions within the repository.&lt;br /&gt;
&lt;br /&gt;
Sample Output:&lt;br /&gt;
[&lt;br /&gt;
  {&lt;br /&gt;
    &amp;quot;avatar_url&amp;quot;: &amp;quot;https://avatars.githubusercontent.com/u/61797592?v=4&amp;quot;,&lt;br /&gt;
    &amp;quot;events_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/events{/privacy}&amp;quot;,&lt;br /&gt;
    &amp;quot;followers_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/followers&amp;quot;,&lt;br /&gt;
    &amp;quot;following_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/following{/other_user}&amp;quot;,&lt;br /&gt;
    &amp;quot;gists_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/gists{/gist_id}&amp;quot;,&lt;br /&gt;
    &amp;quot;gravatar_id&amp;quot;: &amp;quot;&amp;quot;,&lt;br /&gt;
    &amp;quot;html_url&amp;quot;: &amp;quot;https://github.com/Atharva7007&amp;quot;,&lt;br /&gt;
    &amp;quot;id&amp;quot;: 61797592,&lt;br /&gt;
    &amp;quot;login&amp;quot;: &amp;quot;Atharva7007&amp;quot;,&lt;br /&gt;
    &amp;quot;node_id&amp;quot;: &amp;quot;MDQ6VXNlcjYxNzk3NTky&amp;quot;,&lt;br /&gt;
    &amp;quot;organizations_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/orgs&amp;quot;,&lt;br /&gt;
    &amp;quot;permissions&amp;quot;: {&lt;br /&gt;
      &amp;quot;admin&amp;quot;: true,&lt;br /&gt;
      &amp;quot;maintain&amp;quot;: true,&lt;br /&gt;
      &amp;quot;pull&amp;quot;: true,&lt;br /&gt;
      &amp;quot;push&amp;quot;: true,&lt;br /&gt;
      &amp;quot;triage&amp;quot;: true&lt;br /&gt;
    },&lt;br /&gt;
    &amp;quot;received_events_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/received_events&amp;quot;,&lt;br /&gt;
    &amp;quot;repos_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/repos&amp;quot;,&lt;br /&gt;
    &amp;quot;role_name&amp;quot;: &amp;quot;admin&amp;quot;,&lt;br /&gt;
    &amp;quot;site_admin&amp;quot;: false,&lt;br /&gt;
    &amp;quot;starred_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/starred{/owner}{/repo}&amp;quot;,&lt;br /&gt;
    &amp;quot;subscriptions_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/subscriptions&amp;quot;,&lt;br /&gt;
    &amp;quot;type&amp;quot;: &amp;quot;User&amp;quot;,&lt;br /&gt;
    &amp;quot;url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
]&lt;br /&gt;
==Plan of Work==&lt;br /&gt;
In the second phase of the project, we will focus on developing a robust and user-friendly frontend using React. The frontend will serve as an intuitive interface for displaying and interacting with the data retrieved from the GitHub API endpoints implemented in the first phase.&lt;br /&gt;
&lt;br /&gt;
The plan includes the following key steps:&lt;br /&gt;
&lt;br /&gt;
1. **Setup React Environment**: We will set up a modern React development environment, including the necessary tooling, dependencies, and libraries required for building a performant and scalable frontend application.&lt;br /&gt;
&lt;br /&gt;
2. **Design UI Components**: We will design and develop reusable UI components to present the data from the API endpoints in a visually appealing and organized manner. These components will follow best practices for React component development, ensuring modularity, reusability, and maintainability.&lt;br /&gt;
&lt;br /&gt;
3. **Integrate with API Endpoints**: The React frontend will integrate seamlessly with the existing API endpoints. We will implement efficient HTTP request handling mechanisms to fetch data from the endpoints and update the UI components accordingly.&lt;br /&gt;
&lt;br /&gt;
4. **Implement Pagination**: For endpoints that return paginated data, we will implement intuitive pagination functionality in the React UI. This will allow users to navigate through the results smoothly, enhancing the overall user experience.&lt;br /&gt;
&lt;br /&gt;
5. **Enhance User Experience**: We will focus on improving the user experience by adding features such as search functionality, filtering, sorting, and other relevant enhancements based on the data being displayed. These enhancements will empower users to interact with the data more effectively and derive valuable insights.&lt;br /&gt;
&lt;br /&gt;
6. **Test and Debug**: Thorough testing and debugging will be a critical part of the development process. We will implement unit tests and end-to-end tests to ensure the React frontend functions correctly and consistently across different browsers and devices.&lt;br /&gt;
&lt;br /&gt;
7. **Deploy and Document**: Finally, we will deploy the React frontend to a hosting platform, ensuring it is accessible and easily usable by end-users. Comprehensive documentation will be provided, including instructions for setup, usage, and any relevant information for future maintenance and development.&lt;br /&gt;
&lt;br /&gt;
==Implementation Details==&lt;br /&gt;
The GitHub Miner project consists of two main components: the backend API and the frontend user interface.&lt;br /&gt;
&lt;br /&gt;
The backend API is implemented using Flask, a lightweight Python web framework. It exposes two sets of endpoints: one for GraphQL queries and another for REST API queries. Flask Blueprints are used to route requests to the appropriate endpoints based on the URL path.&lt;br /&gt;
&lt;br /&gt;
The GraphQL implementation utilizes the `graphene` library, which provides a way to define GraphQL schemas and resolvers. The resolvers are responsible for fetching data from the GitHub API using the `pygithub` library.&lt;br /&gt;
&lt;br /&gt;
The REST implementation uses the `requests` library to make HTTP requests to the GitHub API and process the responses.&lt;br /&gt;
&lt;br /&gt;
To ensure reliability and robustness, comprehensive testing strategies, including unit tests and integration tests, have been implemented. These tests validate the functionality of the API endpoints across different scenarios, ensuring the system's correctness and stability.&lt;br /&gt;
&lt;br /&gt;
== Implementation Details == &lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
In the API, we have 2 separate endpoints to retrieve the same data: one for REST and the other using GraphQL queries. To manage this, we have made use of Flask Blueprints where all the &amp;quot;api/graphql&amp;quot; requests get routed to the graphql variants and the &amp;quot;api/rest&amp;quot; requests get routed to the REST variants.&lt;br /&gt;
&lt;br /&gt;
=== Design Patterns used ===&lt;br /&gt;
# The REST API Client '''/backend/app/services/github_query/github_rest/client.py''' is a Singleton.&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
To ensure the reliability and robustness of the GitHub Miner, comprehensive testing strategies, including unit tests and integration tests, have been implemented. These tests validate the functionality of the API endpoints across different scenarios, ensuring the system's correctness and stability. The testing suite covers the following areas:&lt;br /&gt;
&lt;br /&gt;
=== Unit Tests ===&lt;br /&gt;
&lt;br /&gt;
Unit tests have been developed to test individual components in isolation, ensuring that each part functions correctly on its own. This includes testing the initialization, argument formatting, field formatting, string representation, and equality of query nodes, as well as the correct behavior of the query builders and authenticators. Examples of unit tests include:&lt;br /&gt;
&lt;br /&gt;
- **TestQueryNode**: Validates the initialization, argument formatting, and field formatting of query nodes.&lt;br /&gt;
&lt;br /&gt;
- **TestQuery**: Ensures correct query initialization, argument substitution, and time formatting.&lt;br /&gt;
&lt;br /&gt;
- **TestQueryNodePaginator**: Tests the functionality of the paginator, including initialization, updating, and resetting.&lt;br /&gt;
&lt;br /&gt;
- **TestPaginatedQuery**: Validates the initialization and execution of paginated queries.&lt;br /&gt;
&lt;br /&gt;
=== Integration Tests ===&lt;br /&gt;
&lt;br /&gt;
Integration tests verify the interaction between different components of the system, ensuring that they work together as expected. This includes testing the behavior of the client when making actual requests to the GitHub API, handling authentication, executing queries, and processing paginated responses. Examples of integration tests include:&lt;br /&gt;
&lt;br /&gt;
- **TestClient**: Tests the GitHub client's initialization, header generation, retry logic, query execution, and handling of paginated queries.&lt;br /&gt;
- **Authentication Tests**: Validate the generation of correct authorization headers and the handling of personal access tokens.&lt;br /&gt;
&lt;br /&gt;
These tests collectively ensure that the GitHub Miner operates reliably, providing accurate and timely data from GitHub's APIs. By covering a wide range of scenarios, from successful queries to error handling and rate limiting, the tests ensure that the application can be used confidently in production environments.&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
Atharva Pansare&lt;br /&gt;
&lt;br /&gt;
Sumedh Limburkar&lt;br /&gt;
&lt;br /&gt;
Viraj Sanap&lt;br /&gt;
&lt;br /&gt;
Mengning Li&lt;br /&gt;
&lt;br /&gt;
Mentor: Jialin Cui&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
GitHub REST API documentation - https://docs.github.com/en/rest?apiVersion=2022-11-28&lt;/div&gt;</summary>
		<author><name>Slimbur</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_G2402_Implement_REST_client,_REST_API,_and_Graphql_API_endpoint_for_repositories_-_Part_2&amp;diff=155604</id>
		<title>CSC/ECE 517 Spring 2024 - G2402 Implement REST client, REST API, and Graphql API endpoint for repositories - Part 2</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_G2402_Implement_REST_client,_REST_API,_and_Graphql_API_endpoint_for_repositories_-_Part_2&amp;diff=155604"/>
		<updated>2024-04-09T06:18:45Z</updated>

		<summary type="html">&lt;p&gt;Slimbur: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
== GitHub Miner ==&lt;br /&gt;
This is a convenient tool to query a user's GitHub metrics. The project aims to develop API endpoints for GitHub GraphQL queries and GitHub REST queries using Python Flask. It involves integrating existing code with Flask to expose GraphQL queries as API endpoints, developing a REST client, and creating REST endpoints for querying the same data sets. The project also includes thorough testing and documentation of the endpoints.&lt;br /&gt;
&lt;br /&gt;
==Live Demo &amp;amp; Source Code==&lt;br /&gt;
http://152.7.177.239:5000/auth/login Link]&lt;br /&gt;
(Please login using your personal GitHub accounts, not NCSU accounts)&lt;br /&gt;
&lt;br /&gt;
[https://github.ncsu.edu/slimbur/GH_Miner Source Code]&lt;br /&gt;
&lt;br /&gt;
Below is the MVC architecture of our GitHub project:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:MVC2.drawio.png|900px|Image : 900 pixels]]&lt;br /&gt;
&lt;br /&gt;
==GraphQL Endpoints==&lt;br /&gt;
&lt;br /&gt;
Get current user login:&lt;br /&gt;
 /api/graphql/current-user-login&lt;br /&gt;
&lt;br /&gt;
Sample Output:&lt;br /&gt;
 {&lt;br /&gt;
   &amp;quot;viewer&amp;quot;: {&lt;br /&gt;
     &amp;quot;login&amp;quot;: &amp;quot;&amp;lt;your-username&amp;gt;&amp;quot;&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Get specific user login:&lt;br /&gt;
 /api/graphql/user-login/&amp;lt;username&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get list of all commits in a repo:&lt;br /&gt;
 /api/graphql/specific-user-commits/&amp;lt;owner&amp;gt;/&amp;lt;repo_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sample Output:&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;repository&amp;quot;: {&lt;br /&gt;
      &amp;quot;defaultBranchRef&amp;quot;: {&lt;br /&gt;
        &amp;quot;target&amp;quot;: {&lt;br /&gt;
          &amp;quot;history&amp;quot;: {&lt;br /&gt;
            &amp;quot;nodes&amp;quot;: [&lt;br /&gt;
              {&lt;br /&gt;
                &amp;quot;additions&amp;quot;: 0,&lt;br /&gt;
                &amp;quot;author&amp;quot;: {&lt;br /&gt;
                  &amp;quot;email&amp;quot;: &amp;quot;61797592+Atharva7007@users.noreply.github.com&amp;quot;,&lt;br /&gt;
                  &amp;quot;name&amp;quot;: &amp;quot;Atharva Pansare&amp;quot;,&lt;br /&gt;
                  &amp;quot;user&amp;quot;: {&lt;br /&gt;
                    &amp;quot;login&amp;quot;: &amp;quot;Atharva7007&amp;quot;&lt;br /&gt;
                  }&lt;br /&gt;
                },&lt;br /&gt;
                &amp;quot;authoredDate&amp;quot;: &amp;quot;2020-04-03T09:30:17Z&amp;quot;,&lt;br /&gt;
                &amp;quot;changedFilesIfAvailable&amp;quot;: 1,&lt;br /&gt;
                &amp;quot;deletions&amp;quot;: 0,&lt;br /&gt;
                &amp;quot;message&amp;quot;: &amp;quot;Add files via upload&amp;quot;,&lt;br /&gt;
                &amp;quot;parents&amp;quot;: {&lt;br /&gt;
                  &amp;quot;totalCount&amp;quot;: 1&lt;br /&gt;
                }&lt;br /&gt;
              }&lt;br /&gt;
            ],&lt;br /&gt;
            &amp;quot;pageInfo&amp;quot;: {&lt;br /&gt;
              &amp;quot;endCursor&amp;quot;: &amp;quot;98ba34a6c62ff6fe7c4d4de5c342a194f72d66e4 0&amp;quot;,&lt;br /&gt;
              &amp;quot;hasNextPage&amp;quot;: true&lt;br /&gt;
            },&lt;br /&gt;
            &amp;quot;totalCount&amp;quot;: 6&lt;br /&gt;
          }&lt;br /&gt;
        }&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
Get details of all contributors in a repo:&lt;br /&gt;
 /api/graphql/repository-contributors/&amp;lt;owner&amp;gt;/&amp;lt;repo_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sample Output:&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;repository&amp;quot;: {&lt;br /&gt;
      &amp;quot;defaultBranchRef&amp;quot;: {&lt;br /&gt;
        &amp;quot;target&amp;quot;: {&lt;br /&gt;
          &amp;quot;history&amp;quot;: {&lt;br /&gt;
            &amp;quot;nodes&amp;quot;: [&lt;br /&gt;
              {&lt;br /&gt;
                &amp;quot;author&amp;quot;: {&lt;br /&gt;
                  &amp;quot;email&amp;quot;: &amp;quot;61797592+Atharva7007@users.noreply.github.com&amp;quot;,&lt;br /&gt;
                  &amp;quot;name&amp;quot;: &amp;quot;Atharva Pansare&amp;quot;,&lt;br /&gt;
                  &amp;quot;user&amp;quot;: {&lt;br /&gt;
                    &amp;quot;login&amp;quot;: &amp;quot;Atharva7007&amp;quot;&lt;br /&gt;
                  }&lt;br /&gt;
                }&lt;br /&gt;
              }&lt;br /&gt;
            ],&lt;br /&gt;
            &amp;quot;pageInfo&amp;quot;: {&lt;br /&gt;
              &amp;quot;endCursor&amp;quot;: &amp;quot;98ba34a6c62ff6fe7c4d4de5c342a194f72d66e4 0&amp;quot;,&lt;br /&gt;
              &amp;quot;hasNextPage&amp;quot;: true&lt;br /&gt;
            },&lt;br /&gt;
            &amp;quot;totalCount&amp;quot;: 6&lt;br /&gt;
          }&lt;br /&gt;
        }&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
==REST API Endpoints==&lt;br /&gt;
Get current user login:&lt;br /&gt;
 /api/rest/current-user-login-rest&lt;br /&gt;
&lt;br /&gt;
This endpoint retrieves the login information of the currently authenticated user. It fetches the user's profile data from the GitHub API and returns details such as their username, avatar URL, and other relevant information.&lt;br /&gt;
&lt;br /&gt;
Sample Output:&lt;br /&gt;
 {&lt;br /&gt;
   &amp;quot;avatar_url&amp;quot;: &amp;quot;https://avatars.githubusercontent.com/u/61797592?v=4&amp;quot;,&lt;br /&gt;
   &amp;quot;bio&amp;quot;: null,&lt;br /&gt;
   &amp;quot;blog&amp;quot;: &amp;quot;&amp;quot;,&lt;br /&gt;
   &amp;quot;company&amp;quot;: null,&lt;br /&gt;
   &amp;quot;created_at&amp;quot;: &amp;quot;2020-03-04T16:49:06Z&amp;quot;,&lt;br /&gt;
   &amp;quot;email&amp;quot;: null,&lt;br /&gt;
   &amp;quot;events_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/events{/privacy}&amp;quot;,&lt;br /&gt;
   &amp;quot;followers&amp;quot;: 1,&lt;br /&gt;
   &amp;quot;followers_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/followers&amp;quot;,&lt;br /&gt;
   &amp;quot;following&amp;quot;: 3,&lt;br /&gt;
   &amp;quot;following_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/following{/other_user}&amp;quot;,&lt;br /&gt;
   &amp;quot;gists_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/gists{/gist_id}&amp;quot;,&lt;br /&gt;
   &amp;quot;gravatar_id&amp;quot;: &amp;quot;&amp;quot;,&lt;br /&gt;
   &amp;quot;hireable&amp;quot;: null,&lt;br /&gt;
   &amp;quot;html_url&amp;quot;: &amp;quot;https://github.com/Atharva7007&amp;quot;,&lt;br /&gt;
   &amp;quot;id&amp;quot;: 61797592,&lt;br /&gt;
   &amp;quot;location&amp;quot;: null,&lt;br /&gt;
   &amp;quot;login&amp;quot;: &amp;quot;Atharva7007&amp;quot;,&lt;br /&gt;
   &amp;quot;name&amp;quot;: &amp;quot;Atharva Pansare&amp;quot;,&lt;br /&gt;
   &amp;quot;node_id&amp;quot;: &amp;quot;MDQ6VXNlcjYxNzk3NTky&amp;quot;,&lt;br /&gt;
   &amp;quot;organizations_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/orgs&amp;quot;,&lt;br /&gt;
   &amp;quot;public_gists&amp;quot;: 0,&lt;br /&gt;
   &amp;quot;public_repos&amp;quot;: 11,&lt;br /&gt;
   &amp;quot;received_events_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/received_events&amp;quot;,&lt;br /&gt;
   &amp;quot;repos_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/repos&amp;quot;,&lt;br /&gt;
   &amp;quot;site_admin&amp;quot;: false,&lt;br /&gt;
   &amp;quot;starred_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/starred{/owner}{/repo}&amp;quot;,&lt;br /&gt;
   &amp;quot;subscriptions_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/subscriptions&amp;quot;,&lt;br /&gt;
   &amp;quot;twitter_username&amp;quot;: null,&lt;br /&gt;
   &amp;quot;type&amp;quot;: &amp;quot;User&amp;quot;,&lt;br /&gt;
   &amp;quot;updated_at&amp;quot;: &amp;quot;2024-03-14T19:03:46Z&amp;quot;,&lt;br /&gt;
   &amp;quot;url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007&amp;quot;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Get list of all commits in a repo:&lt;br /&gt;
 /api/rest/specific-user-commits/&amp;lt;owner&amp;gt;/&amp;lt;repo_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This endpoint retrieves a list of all commits made to a specific repository. It takes the repository owner and repository name as parameters. The endpoint fetches the commit history from the GitHub API and returns details about each commit, such as the author, commit message, and changes made.&lt;br /&gt;
&lt;br /&gt;
Sample Output:&lt;br /&gt;
 [&lt;br /&gt;
   {&lt;br /&gt;
     &amp;quot;repository&amp;quot;: {&lt;br /&gt;
       &amp;quot;defaultBranchRef&amp;quot;: {&lt;br /&gt;
         &amp;quot;target&amp;quot;: {&lt;br /&gt;
           &amp;quot;history&amp;quot;: {&lt;br /&gt;
             &amp;quot;nodes&amp;quot;: [&lt;br /&gt;
               {&lt;br /&gt;
                 &amp;quot;additions&amp;quot;: 0,&lt;br /&gt;
                 &amp;quot;author&amp;quot;: {&lt;br /&gt;
                   &amp;quot;email&amp;quot;: &amp;quot;61797592+Atharva7007@users.noreply.github.com&amp;quot;,&lt;br /&gt;
                   &amp;quot;name&amp;quot;: &amp;quot;Atharva Pansare&amp;quot;,&lt;br /&gt;
                   &amp;quot;user&amp;quot;: {&lt;br /&gt;
                     &amp;quot;login&amp;quot;: &amp;quot;Atharva7007&amp;quot;&lt;br /&gt;
                   }&lt;br /&gt;
                 },&lt;br /&gt;
                 &amp;quot;authoredDate&amp;quot;: &amp;quot;2020-04-03T09:30:17Z&amp;quot;,&lt;br /&gt;
                 &amp;quot;changedFilesIfAvailable&amp;quot;: 1,&lt;br /&gt;
                 &amp;quot;deletions&amp;quot;: 0,&lt;br /&gt;
                 &amp;quot;message&amp;quot;: &amp;quot;Add files via upload&amp;quot;,&lt;br /&gt;
                 &amp;quot;parents&amp;quot;: {&lt;br /&gt;
                   &amp;quot;totalCount&amp;quot;: 1&lt;br /&gt;
                 }&lt;br /&gt;
               }&lt;br /&gt;
             ],&lt;br /&gt;
             &amp;quot;pageInfo&amp;quot;: {&lt;br /&gt;
               &amp;quot;endCursor&amp;quot;: &amp;quot;98ba34a6c62ff6fe7c4d4de5c342a194f72d66e4 0&amp;quot;,&lt;br /&gt;
               &amp;quot;hasNextPage&amp;quot;: true&lt;br /&gt;
             },&lt;br /&gt;
             &amp;quot;totalCount&amp;quot;: 6&lt;br /&gt;
           }&lt;br /&gt;
         }&lt;br /&gt;
       }&lt;br /&gt;
     }&lt;br /&gt;
   }&lt;br /&gt;
 ]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Get details of all contributors in a repo:&lt;br /&gt;
 /api/rest/repository-contributors/&amp;lt;owner&amp;gt;/&amp;lt;repo_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This endpoint fetches the details of all contributors to a specific repository. It takes the repository owner and repository name as parameters. The endpoint retrieves the list of contributors from the GitHub API and returns information about each contributor, such as their username, avatar URL, and permissions within the repository.&lt;br /&gt;
&lt;br /&gt;
Sample Output:&lt;br /&gt;
[&lt;br /&gt;
  {&lt;br /&gt;
    &amp;quot;avatar_url&amp;quot;: &amp;quot;https://avatars.githubusercontent.com/u/61797592?v=4&amp;quot;,&lt;br /&gt;
    &amp;quot;events_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/events{/privacy}&amp;quot;,&lt;br /&gt;
    &amp;quot;followers_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/followers&amp;quot;,&lt;br /&gt;
    &amp;quot;following_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/following{/other_user}&amp;quot;,&lt;br /&gt;
    &amp;quot;gists_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/gists{/gist_id}&amp;quot;,&lt;br /&gt;
    &amp;quot;gravatar_id&amp;quot;: &amp;quot;&amp;quot;,&lt;br /&gt;
    &amp;quot;html_url&amp;quot;: &amp;quot;https://github.com/Atharva7007&amp;quot;,&lt;br /&gt;
    &amp;quot;id&amp;quot;: 61797592,&lt;br /&gt;
    &amp;quot;login&amp;quot;: &amp;quot;Atharva7007&amp;quot;,&lt;br /&gt;
    &amp;quot;node_id&amp;quot;: &amp;quot;MDQ6VXNlcjYxNzk3NTky&amp;quot;,&lt;br /&gt;
    &amp;quot;organizations_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/orgs&amp;quot;,&lt;br /&gt;
    &amp;quot;permissions&amp;quot;: {&lt;br /&gt;
      &amp;quot;admin&amp;quot;: true,&lt;br /&gt;
      &amp;quot;maintain&amp;quot;: true,&lt;br /&gt;
      &amp;quot;pull&amp;quot;: true,&lt;br /&gt;
      &amp;quot;push&amp;quot;: true,&lt;br /&gt;
      &amp;quot;triage&amp;quot;: true&lt;br /&gt;
    },&lt;br /&gt;
    &amp;quot;received_events_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/received_events&amp;quot;,&lt;br /&gt;
    &amp;quot;repos_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/repos&amp;quot;,&lt;br /&gt;
    &amp;quot;role_name&amp;quot;: &amp;quot;admin&amp;quot;,&lt;br /&gt;
    &amp;quot;site_admin&amp;quot;: false,&lt;br /&gt;
    &amp;quot;starred_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/starred{/owner}{/repo}&amp;quot;,&lt;br /&gt;
    &amp;quot;subscriptions_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/subscriptions&amp;quot;,&lt;br /&gt;
    &amp;quot;type&amp;quot;: &amp;quot;User&amp;quot;,&lt;br /&gt;
    &amp;quot;url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
]&lt;br /&gt;
==Plan of Work==&lt;br /&gt;
In the second phase of the project, we will focus on developing a robust and user-friendly frontend using React. The frontend will serve as an intuitive interface for displaying and interacting with the data retrieved from the GitHub API endpoints implemented in the first phase.&lt;br /&gt;
&lt;br /&gt;
The plan includes the following key steps:&lt;br /&gt;
&lt;br /&gt;
1. **Setup React Environment**: We will set up a modern React development environment, including the necessary tooling, dependencies, and libraries required for building a performant and scalable frontend application.&lt;br /&gt;
&lt;br /&gt;
2. **Design UI Components**: We will design and develop reusable UI components to present the data from the API endpoints in a visually appealing and organized manner. These components will follow best practices for React component development, ensuring modularity, reusability, and maintainability.&lt;br /&gt;
&lt;br /&gt;
3. **Integrate with API Endpoints**: The React frontend will integrate seamlessly with the existing API endpoints. We will implement efficient HTTP request handling mechanisms to fetch data from the endpoints and update the UI components accordingly.&lt;br /&gt;
&lt;br /&gt;
4. **Implement Pagination**: For endpoints that return paginated data, we will implement intuitive pagination functionality in the React UI. This will allow users to navigate through the results smoothly, enhancing the overall user experience.&lt;br /&gt;
&lt;br /&gt;
5. **Enhance User Experience**: We will focus on improving the user experience by adding features such as search functionality, filtering, sorting, and other relevant enhancements based on the data being displayed. These enhancements will empower users to interact with the data more effectively and derive valuable insights.&lt;br /&gt;
&lt;br /&gt;
6. **Test and Debug**: Thorough testing and debugging will be a critical part of the development process. We will implement unit tests and end-to-end tests to ensure the React frontend functions correctly and consistently across different browsers and devices.&lt;br /&gt;
&lt;br /&gt;
7. **Deploy and Document**: Finally, we will deploy the React frontend to a hosting platform, ensuring it is accessible and easily usable by end-users. Comprehensive documentation will be provided, including instructions for setup, usage, and any relevant information for future maintenance and development.&lt;br /&gt;
&lt;br /&gt;
==Implementation Details==&lt;br /&gt;
The GitHub Miner project consists of two main components: the backend API and the frontend user interface.&lt;br /&gt;
&lt;br /&gt;
The backend API is implemented using Flask, a lightweight Python web framework. It exposes two sets of endpoints: one for GraphQL queries and another for REST API queries. Flask Blueprints are used to route requests to the appropriate endpoints based on the URL path.&lt;br /&gt;
&lt;br /&gt;
The GraphQL implementation utilizes the `graphene` library, which provides a way to define GraphQL schemas and resolvers. The resolvers are responsible for fetching data from the GitHub API using the `pygithub` library.&lt;br /&gt;
&lt;br /&gt;
The REST implementation uses the `requests` library to make HTTP requests to the GitHub API and process the responses.&lt;br /&gt;
&lt;br /&gt;
To ensure reliability and robustness, comprehensive testing strategies, including unit tests and integration tests, have been implemented. These tests validate the functionality of the API endpoints across different scenarios, ensuring the system's correctness and stability.&lt;br /&gt;
&lt;br /&gt;
== Implementation Details == &lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
In the API, we have 2 separate endpoints to retrieve the same data: one for REST and the other using GraphQL queries. To manage this, we have made use of Flask Blueprints where all the &amp;quot;api/graphql&amp;quot; requests get routed to the graphql variants and the &amp;quot;api/rest&amp;quot; requests get routed to the REST variants.&lt;br /&gt;
&lt;br /&gt;
=== Design Patterns used ===&lt;br /&gt;
# The REST API Client '''/backend/app/services/github_query/github_rest/client.py''' is a Singleton.&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
To ensure the reliability and robustness of the GitHub Miner, comprehensive testing strategies, including unit tests and integration tests, have been implemented. These tests validate the functionality of the API endpoints across different scenarios, ensuring the system's correctness and stability. The testing suite covers the following areas:&lt;br /&gt;
&lt;br /&gt;
=== Unit Tests ===&lt;br /&gt;
&lt;br /&gt;
Unit tests have been developed to test individual components in isolation, ensuring that each part functions correctly on its own. This includes testing the initialization, argument formatting, field formatting, string representation, and equality of query nodes, as well as the correct behavior of the query builders and authenticators. Examples of unit tests include:&lt;br /&gt;
&lt;br /&gt;
- **TestQueryNode**: Validates the initialization, argument formatting, and field formatting of query nodes.&lt;br /&gt;
&lt;br /&gt;
- **TestQuery**: Ensures correct query initialization, argument substitution, and time formatting.&lt;br /&gt;
&lt;br /&gt;
- **TestQueryNodePaginator**: Tests the functionality of the paginator, including initialization, updating, and resetting.&lt;br /&gt;
&lt;br /&gt;
- **TestPaginatedQuery**: Validates the initialization and execution of paginated queries.&lt;br /&gt;
&lt;br /&gt;
=== Integration Tests ===&lt;br /&gt;
&lt;br /&gt;
Integration tests verify the interaction between different components of the system, ensuring that they work together as expected. This includes testing the behavior of the client when making actual requests to the GitHub API, handling authentication, executing queries, and processing paginated responses. Examples of integration tests include:&lt;br /&gt;
&lt;br /&gt;
- **TestClient**: Tests the GitHub client's initialization, header generation, retry logic, query execution, and handling of paginated queries.&lt;br /&gt;
- **Authentication Tests**: Validate the generation of correct authorization headers and the handling of personal access tokens.&lt;br /&gt;
&lt;br /&gt;
These tests collectively ensure that the GitHub Miner operates reliably, providing accurate and timely data from GitHub's APIs. By covering a wide range of scenarios, from successful queries to error handling and rate limiting, the tests ensure that the application can be used confidently in production environments.&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
Atharva Pansare&lt;br /&gt;
&lt;br /&gt;
Sumedh Limburkar&lt;br /&gt;
&lt;br /&gt;
Viraj Sanap&lt;br /&gt;
&lt;br /&gt;
Mengning Li&lt;br /&gt;
&lt;br /&gt;
Mentor: Jialin Cui&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
GitHub REST API documentation - https://docs.github.com/en/rest?apiVersion=2022-11-28&lt;/div&gt;</summary>
		<author><name>Slimbur</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_G2402_Implement_REST_client,_REST_API,_and_Graphql_API_endpoint_for_repositories_-_Part_2&amp;diff=155603</id>
		<title>CSC/ECE 517 Spring 2024 - G2402 Implement REST client, REST API, and Graphql API endpoint for repositories - Part 2</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_G2402_Implement_REST_client,_REST_API,_and_Graphql_API_endpoint_for_repositories_-_Part_2&amp;diff=155603"/>
		<updated>2024-04-09T06:17:50Z</updated>

		<summary type="html">&lt;p&gt;Slimbur: Added MVC arch image&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
== GitHub Miner ==&lt;br /&gt;
This is a convenient tool to query a user's GitHub metrics. The project aims to develop API endpoints for GitHub GraphQL queries and GitHub REST queries using Python Flask. It involves integrating existing code with Flask to expose GraphQL queries as API endpoints, developing a REST client, and creating REST endpoints for querying the same data sets. The project also includes thorough testing and documentation of the endpoints.&lt;br /&gt;
&lt;br /&gt;
==Live Demo &amp;amp; Source Code==&lt;br /&gt;
http://152.7.177.239:5000/auth/login Link]&lt;br /&gt;
(Please login using your personal GitHub accounts, not NCSU accounts)&lt;br /&gt;
&lt;br /&gt;
[https://github.ncsu.edu/slimbur/GH_Miner Source Code]&lt;br /&gt;
&lt;br /&gt;
==Installation==&lt;br /&gt;
&lt;br /&gt;
We recommend using virtual environment. Steps to set up virtual environment:&lt;br /&gt;
&lt;br /&gt;
 cd path/to/your/project/directory&lt;br /&gt;
 python -m venv venv&lt;br /&gt;
&lt;br /&gt;
On macOS and Linux:&lt;br /&gt;
 source venv/bin/activate&lt;br /&gt;
&lt;br /&gt;
On Windows (Command Prompt):&lt;br /&gt;
 .\venv\Scripts\activate&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On Windows (PowerShell):&lt;br /&gt;
 .\venv\Scripts\Activate.ps1&lt;br /&gt;
&lt;br /&gt;
Next, install all the necessary libraries:&lt;br /&gt;
 pip -r requirements.txt&lt;br /&gt;
&lt;br /&gt;
Next, set the PYTHONPATH to&lt;br /&gt;
&lt;br /&gt;
On Windows&lt;br /&gt;
 set PYTHONPATH=%PYTHONPATH%;path/to/your/project&lt;br /&gt;
 set PYTHONPATH=%PYTHONPATH%;path/to/your/project/backend&lt;br /&gt;
&lt;br /&gt;
On Unix or MacOS&lt;br /&gt;
 export PYTHONPATH=$PYTHONPATH:/path/to/your/project&lt;br /&gt;
 export PYTHONPATH=%PYTHONPATH%;path/to/your/project/backend&lt;br /&gt;
&lt;br /&gt;
You can run the app from your terminal by executing the following command:&lt;br /&gt;
 python backend\run.py&lt;br /&gt;
&lt;br /&gt;
Below is the MVC architecture of our GitHub project:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:MVC2.drawio.png|900px|Image : 900 pixels]]&lt;br /&gt;
&lt;br /&gt;
==GraphQL Endpoints==&lt;br /&gt;
&lt;br /&gt;
Get current user login:&lt;br /&gt;
 /api/graphql/current-user-login&lt;br /&gt;
&lt;br /&gt;
Sample Output:&lt;br /&gt;
 {&lt;br /&gt;
   &amp;quot;viewer&amp;quot;: {&lt;br /&gt;
     &amp;quot;login&amp;quot;: &amp;quot;&amp;lt;your-username&amp;gt;&amp;quot;&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Get specific user login:&lt;br /&gt;
 /api/graphql/user-login/&amp;lt;username&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get list of all commits in a repo:&lt;br /&gt;
 /api/graphql/specific-user-commits/&amp;lt;owner&amp;gt;/&amp;lt;repo_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sample Output:&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;repository&amp;quot;: {&lt;br /&gt;
      &amp;quot;defaultBranchRef&amp;quot;: {&lt;br /&gt;
        &amp;quot;target&amp;quot;: {&lt;br /&gt;
          &amp;quot;history&amp;quot;: {&lt;br /&gt;
            &amp;quot;nodes&amp;quot;: [&lt;br /&gt;
              {&lt;br /&gt;
                &amp;quot;additions&amp;quot;: 0,&lt;br /&gt;
                &amp;quot;author&amp;quot;: {&lt;br /&gt;
                  &amp;quot;email&amp;quot;: &amp;quot;61797592+Atharva7007@users.noreply.github.com&amp;quot;,&lt;br /&gt;
                  &amp;quot;name&amp;quot;: &amp;quot;Atharva Pansare&amp;quot;,&lt;br /&gt;
                  &amp;quot;user&amp;quot;: {&lt;br /&gt;
                    &amp;quot;login&amp;quot;: &amp;quot;Atharva7007&amp;quot;&lt;br /&gt;
                  }&lt;br /&gt;
                },&lt;br /&gt;
                &amp;quot;authoredDate&amp;quot;: &amp;quot;2020-04-03T09:30:17Z&amp;quot;,&lt;br /&gt;
                &amp;quot;changedFilesIfAvailable&amp;quot;: 1,&lt;br /&gt;
                &amp;quot;deletions&amp;quot;: 0,&lt;br /&gt;
                &amp;quot;message&amp;quot;: &amp;quot;Add files via upload&amp;quot;,&lt;br /&gt;
                &amp;quot;parents&amp;quot;: {&lt;br /&gt;
                  &amp;quot;totalCount&amp;quot;: 1&lt;br /&gt;
                }&lt;br /&gt;
              }&lt;br /&gt;
            ],&lt;br /&gt;
            &amp;quot;pageInfo&amp;quot;: {&lt;br /&gt;
              &amp;quot;endCursor&amp;quot;: &amp;quot;98ba34a6c62ff6fe7c4d4de5c342a194f72d66e4 0&amp;quot;,&lt;br /&gt;
              &amp;quot;hasNextPage&amp;quot;: true&lt;br /&gt;
            },&lt;br /&gt;
            &amp;quot;totalCount&amp;quot;: 6&lt;br /&gt;
          }&lt;br /&gt;
        }&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
Get details of all contributors in a repo:&lt;br /&gt;
 /api/graphql/repository-contributors/&amp;lt;owner&amp;gt;/&amp;lt;repo_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sample Output:&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;repository&amp;quot;: {&lt;br /&gt;
      &amp;quot;defaultBranchRef&amp;quot;: {&lt;br /&gt;
        &amp;quot;target&amp;quot;: {&lt;br /&gt;
          &amp;quot;history&amp;quot;: {&lt;br /&gt;
            &amp;quot;nodes&amp;quot;: [&lt;br /&gt;
              {&lt;br /&gt;
                &amp;quot;author&amp;quot;: {&lt;br /&gt;
                  &amp;quot;email&amp;quot;: &amp;quot;61797592+Atharva7007@users.noreply.github.com&amp;quot;,&lt;br /&gt;
                  &amp;quot;name&amp;quot;: &amp;quot;Atharva Pansare&amp;quot;,&lt;br /&gt;
                  &amp;quot;user&amp;quot;: {&lt;br /&gt;
                    &amp;quot;login&amp;quot;: &amp;quot;Atharva7007&amp;quot;&lt;br /&gt;
                  }&lt;br /&gt;
                }&lt;br /&gt;
              }&lt;br /&gt;
            ],&lt;br /&gt;
            &amp;quot;pageInfo&amp;quot;: {&lt;br /&gt;
              &amp;quot;endCursor&amp;quot;: &amp;quot;98ba34a6c62ff6fe7c4d4de5c342a194f72d66e4 0&amp;quot;,&lt;br /&gt;
              &amp;quot;hasNextPage&amp;quot;: true&lt;br /&gt;
            },&lt;br /&gt;
            &amp;quot;totalCount&amp;quot;: 6&lt;br /&gt;
          }&lt;br /&gt;
        }&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
==REST API Endpoints==&lt;br /&gt;
Get current user login:&lt;br /&gt;
 /api/rest/current-user-login-rest&lt;br /&gt;
&lt;br /&gt;
This endpoint retrieves the login information of the currently authenticated user. It fetches the user's profile data from the GitHub API and returns details such as their username, avatar URL, and other relevant information.&lt;br /&gt;
&lt;br /&gt;
Sample Output:&lt;br /&gt;
 {&lt;br /&gt;
   &amp;quot;avatar_url&amp;quot;: &amp;quot;https://avatars.githubusercontent.com/u/61797592?v=4&amp;quot;,&lt;br /&gt;
   &amp;quot;bio&amp;quot;: null,&lt;br /&gt;
   &amp;quot;blog&amp;quot;: &amp;quot;&amp;quot;,&lt;br /&gt;
   &amp;quot;company&amp;quot;: null,&lt;br /&gt;
   &amp;quot;created_at&amp;quot;: &amp;quot;2020-03-04T16:49:06Z&amp;quot;,&lt;br /&gt;
   &amp;quot;email&amp;quot;: null,&lt;br /&gt;
   &amp;quot;events_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/events{/privacy}&amp;quot;,&lt;br /&gt;
   &amp;quot;followers&amp;quot;: 1,&lt;br /&gt;
   &amp;quot;followers_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/followers&amp;quot;,&lt;br /&gt;
   &amp;quot;following&amp;quot;: 3,&lt;br /&gt;
   &amp;quot;following_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/following{/other_user}&amp;quot;,&lt;br /&gt;
   &amp;quot;gists_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/gists{/gist_id}&amp;quot;,&lt;br /&gt;
   &amp;quot;gravatar_id&amp;quot;: &amp;quot;&amp;quot;,&lt;br /&gt;
   &amp;quot;hireable&amp;quot;: null,&lt;br /&gt;
   &amp;quot;html_url&amp;quot;: &amp;quot;https://github.com/Atharva7007&amp;quot;,&lt;br /&gt;
   &amp;quot;id&amp;quot;: 61797592,&lt;br /&gt;
   &amp;quot;location&amp;quot;: null,&lt;br /&gt;
   &amp;quot;login&amp;quot;: &amp;quot;Atharva7007&amp;quot;,&lt;br /&gt;
   &amp;quot;name&amp;quot;: &amp;quot;Atharva Pansare&amp;quot;,&lt;br /&gt;
   &amp;quot;node_id&amp;quot;: &amp;quot;MDQ6VXNlcjYxNzk3NTky&amp;quot;,&lt;br /&gt;
   &amp;quot;organizations_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/orgs&amp;quot;,&lt;br /&gt;
   &amp;quot;public_gists&amp;quot;: 0,&lt;br /&gt;
   &amp;quot;public_repos&amp;quot;: 11,&lt;br /&gt;
   &amp;quot;received_events_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/received_events&amp;quot;,&lt;br /&gt;
   &amp;quot;repos_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/repos&amp;quot;,&lt;br /&gt;
   &amp;quot;site_admin&amp;quot;: false,&lt;br /&gt;
   &amp;quot;starred_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/starred{/owner}{/repo}&amp;quot;,&lt;br /&gt;
   &amp;quot;subscriptions_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/subscriptions&amp;quot;,&lt;br /&gt;
   &amp;quot;twitter_username&amp;quot;: null,&lt;br /&gt;
   &amp;quot;type&amp;quot;: &amp;quot;User&amp;quot;,&lt;br /&gt;
   &amp;quot;updated_at&amp;quot;: &amp;quot;2024-03-14T19:03:46Z&amp;quot;,&lt;br /&gt;
   &amp;quot;url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007&amp;quot;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Get list of all commits in a repo:&lt;br /&gt;
 /api/rest/specific-user-commits/&amp;lt;owner&amp;gt;/&amp;lt;repo_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This endpoint retrieves a list of all commits made to a specific repository. It takes the repository owner and repository name as parameters. The endpoint fetches the commit history from the GitHub API and returns details about each commit, such as the author, commit message, and changes made.&lt;br /&gt;
&lt;br /&gt;
Sample Output:&lt;br /&gt;
 [&lt;br /&gt;
   {&lt;br /&gt;
     &amp;quot;repository&amp;quot;: {&lt;br /&gt;
       &amp;quot;defaultBranchRef&amp;quot;: {&lt;br /&gt;
         &amp;quot;target&amp;quot;: {&lt;br /&gt;
           &amp;quot;history&amp;quot;: {&lt;br /&gt;
             &amp;quot;nodes&amp;quot;: [&lt;br /&gt;
               {&lt;br /&gt;
                 &amp;quot;additions&amp;quot;: 0,&lt;br /&gt;
                 &amp;quot;author&amp;quot;: {&lt;br /&gt;
                   &amp;quot;email&amp;quot;: &amp;quot;61797592+Atharva7007@users.noreply.github.com&amp;quot;,&lt;br /&gt;
                   &amp;quot;name&amp;quot;: &amp;quot;Atharva Pansare&amp;quot;,&lt;br /&gt;
                   &amp;quot;user&amp;quot;: {&lt;br /&gt;
                     &amp;quot;login&amp;quot;: &amp;quot;Atharva7007&amp;quot;&lt;br /&gt;
                   }&lt;br /&gt;
                 },&lt;br /&gt;
                 &amp;quot;authoredDate&amp;quot;: &amp;quot;2020-04-03T09:30:17Z&amp;quot;,&lt;br /&gt;
                 &amp;quot;changedFilesIfAvailable&amp;quot;: 1,&lt;br /&gt;
                 &amp;quot;deletions&amp;quot;: 0,&lt;br /&gt;
                 &amp;quot;message&amp;quot;: &amp;quot;Add files via upload&amp;quot;,&lt;br /&gt;
                 &amp;quot;parents&amp;quot;: {&lt;br /&gt;
                   &amp;quot;totalCount&amp;quot;: 1&lt;br /&gt;
                 }&lt;br /&gt;
               }&lt;br /&gt;
             ],&lt;br /&gt;
             &amp;quot;pageInfo&amp;quot;: {&lt;br /&gt;
               &amp;quot;endCursor&amp;quot;: &amp;quot;98ba34a6c62ff6fe7c4d4de5c342a194f72d66e4 0&amp;quot;,&lt;br /&gt;
               &amp;quot;hasNextPage&amp;quot;: true&lt;br /&gt;
             },&lt;br /&gt;
             &amp;quot;totalCount&amp;quot;: 6&lt;br /&gt;
           }&lt;br /&gt;
         }&lt;br /&gt;
       }&lt;br /&gt;
     }&lt;br /&gt;
   }&lt;br /&gt;
 ]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Get details of all contributors in a repo:&lt;br /&gt;
 /api/rest/repository-contributors/&amp;lt;owner&amp;gt;/&amp;lt;repo_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This endpoint fetches the details of all contributors to a specific repository. It takes the repository owner and repository name as parameters. The endpoint retrieves the list of contributors from the GitHub API and returns information about each contributor, such as their username, avatar URL, and permissions within the repository.&lt;br /&gt;
&lt;br /&gt;
Sample Output:&lt;br /&gt;
[&lt;br /&gt;
  {&lt;br /&gt;
    &amp;quot;avatar_url&amp;quot;: &amp;quot;https://avatars.githubusercontent.com/u/61797592?v=4&amp;quot;,&lt;br /&gt;
    &amp;quot;events_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/events{/privacy}&amp;quot;,&lt;br /&gt;
    &amp;quot;followers_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/followers&amp;quot;,&lt;br /&gt;
    &amp;quot;following_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/following{/other_user}&amp;quot;,&lt;br /&gt;
    &amp;quot;gists_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/gists{/gist_id}&amp;quot;,&lt;br /&gt;
    &amp;quot;gravatar_id&amp;quot;: &amp;quot;&amp;quot;,&lt;br /&gt;
    &amp;quot;html_url&amp;quot;: &amp;quot;https://github.com/Atharva7007&amp;quot;,&lt;br /&gt;
    &amp;quot;id&amp;quot;: 61797592,&lt;br /&gt;
    &amp;quot;login&amp;quot;: &amp;quot;Atharva7007&amp;quot;,&lt;br /&gt;
    &amp;quot;node_id&amp;quot;: &amp;quot;MDQ6VXNlcjYxNzk3NTky&amp;quot;,&lt;br /&gt;
    &amp;quot;organizations_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/orgs&amp;quot;,&lt;br /&gt;
    &amp;quot;permissions&amp;quot;: {&lt;br /&gt;
      &amp;quot;admin&amp;quot;: true,&lt;br /&gt;
      &amp;quot;maintain&amp;quot;: true,&lt;br /&gt;
      &amp;quot;pull&amp;quot;: true,&lt;br /&gt;
      &amp;quot;push&amp;quot;: true,&lt;br /&gt;
      &amp;quot;triage&amp;quot;: true&lt;br /&gt;
    },&lt;br /&gt;
    &amp;quot;received_events_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/received_events&amp;quot;,&lt;br /&gt;
    &amp;quot;repos_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/repos&amp;quot;,&lt;br /&gt;
    &amp;quot;role_name&amp;quot;: &amp;quot;admin&amp;quot;,&lt;br /&gt;
    &amp;quot;site_admin&amp;quot;: false,&lt;br /&gt;
    &amp;quot;starred_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/starred{/owner}{/repo}&amp;quot;,&lt;br /&gt;
    &amp;quot;subscriptions_url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007/subscriptions&amp;quot;,&lt;br /&gt;
    &amp;quot;type&amp;quot;: &amp;quot;User&amp;quot;,&lt;br /&gt;
    &amp;quot;url&amp;quot;: &amp;quot;https://api.github.com/users/Atharva7007&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
]&lt;br /&gt;
==Plan of Work==&lt;br /&gt;
In the second phase of the project, we will focus on developing a robust and user-friendly frontend using React. The frontend will serve as an intuitive interface for displaying and interacting with the data retrieved from the GitHub API endpoints implemented in the first phase.&lt;br /&gt;
&lt;br /&gt;
The plan includes the following key steps:&lt;br /&gt;
&lt;br /&gt;
1. **Setup React Environment**: We will set up a modern React development environment, including the necessary tooling, dependencies, and libraries required for building a performant and scalable frontend application.&lt;br /&gt;
&lt;br /&gt;
2. **Design UI Components**: We will design and develop reusable UI components to present the data from the API endpoints in a visually appealing and organized manner. These components will follow best practices for React component development, ensuring modularity, reusability, and maintainability.&lt;br /&gt;
&lt;br /&gt;
3. **Integrate with API Endpoints**: The React frontend will integrate seamlessly with the existing API endpoints. We will implement efficient HTTP request handling mechanisms to fetch data from the endpoints and update the UI components accordingly.&lt;br /&gt;
&lt;br /&gt;
4. **Implement Pagination**: For endpoints that return paginated data, we will implement intuitive pagination functionality in the React UI. This will allow users to navigate through the results smoothly, enhancing the overall user experience.&lt;br /&gt;
&lt;br /&gt;
5. **Enhance User Experience**: We will focus on improving the user experience by adding features such as search functionality, filtering, sorting, and other relevant enhancements based on the data being displayed. These enhancements will empower users to interact with the data more effectively and derive valuable insights.&lt;br /&gt;
&lt;br /&gt;
6. **Test and Debug**: Thorough testing and debugging will be a critical part of the development process. We will implement unit tests and end-to-end tests to ensure the React frontend functions correctly and consistently across different browsers and devices.&lt;br /&gt;
&lt;br /&gt;
7. **Deploy and Document**: Finally, we will deploy the React frontend to a hosting platform, ensuring it is accessible and easily usable by end-users. Comprehensive documentation will be provided, including instructions for setup, usage, and any relevant information for future maintenance and development.&lt;br /&gt;
&lt;br /&gt;
==Implementation Details==&lt;br /&gt;
The GitHub Miner project consists of two main components: the backend API and the frontend user interface.&lt;br /&gt;
&lt;br /&gt;
The backend API is implemented using Flask, a lightweight Python web framework. It exposes two sets of endpoints: one for GraphQL queries and another for REST API queries. Flask Blueprints are used to route requests to the appropriate endpoints based on the URL path.&lt;br /&gt;
&lt;br /&gt;
The GraphQL implementation utilizes the `graphene` library, which provides a way to define GraphQL schemas and resolvers. The resolvers are responsible for fetching data from the GitHub API using the `pygithub` library.&lt;br /&gt;
&lt;br /&gt;
The REST implementation uses the `requests` library to make HTTP requests to the GitHub API and process the responses.&lt;br /&gt;
&lt;br /&gt;
To ensure reliability and robustness, comprehensive testing strategies, including unit tests and integration tests, have been implemented. These tests validate the functionality of the API endpoints across different scenarios, ensuring the system's correctness and stability.&lt;br /&gt;
&lt;br /&gt;
== Implementation Details == &lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
In the API, we have 2 separate endpoints to retrieve the same data: one for REST and the other using GraphQL queries. To manage this, we have made use of Flask Blueprints where all the &amp;quot;api/graphql&amp;quot; requests get routed to the graphql variants and the &amp;quot;api/rest&amp;quot; requests get routed to the REST variants.&lt;br /&gt;
&lt;br /&gt;
=== Design Patterns used ===&lt;br /&gt;
# The REST API Client '''/backend/app/services/github_query/github_rest/client.py''' is a Singleton.&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
To ensure the reliability and robustness of the GitHub Miner, comprehensive testing strategies, including unit tests and integration tests, have been implemented. These tests validate the functionality of the API endpoints across different scenarios, ensuring the system's correctness and stability. The testing suite covers the following areas:&lt;br /&gt;
&lt;br /&gt;
=== Unit Tests ===&lt;br /&gt;
&lt;br /&gt;
Unit tests have been developed to test individual components in isolation, ensuring that each part functions correctly on its own. This includes testing the initialization, argument formatting, field formatting, string representation, and equality of query nodes, as well as the correct behavior of the query builders and authenticators. Examples of unit tests include:&lt;br /&gt;
&lt;br /&gt;
- **TestQueryNode**: Validates the initialization, argument formatting, and field formatting of query nodes.&lt;br /&gt;
&lt;br /&gt;
- **TestQuery**: Ensures correct query initialization, argument substitution, and time formatting.&lt;br /&gt;
&lt;br /&gt;
- **TestQueryNodePaginator**: Tests the functionality of the paginator, including initialization, updating, and resetting.&lt;br /&gt;
&lt;br /&gt;
- **TestPaginatedQuery**: Validates the initialization and execution of paginated queries.&lt;br /&gt;
&lt;br /&gt;
=== Integration Tests ===&lt;br /&gt;
&lt;br /&gt;
Integration tests verify the interaction between different components of the system, ensuring that they work together as expected. This includes testing the behavior of the client when making actual requests to the GitHub API, handling authentication, executing queries, and processing paginated responses. Examples of integration tests include:&lt;br /&gt;
&lt;br /&gt;
- **TestClient**: Tests the GitHub client's initialization, header generation, retry logic, query execution, and handling of paginated queries.&lt;br /&gt;
- **Authentication Tests**: Validate the generation of correct authorization headers and the handling of personal access tokens.&lt;br /&gt;
&lt;br /&gt;
These tests collectively ensure that the GitHub Miner operates reliably, providing accurate and timely data from GitHub's APIs. By covering a wide range of scenarios, from successful queries to error handling and rate limiting, the tests ensure that the application can be used confidently in production environments.&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
Atharva Pansare&lt;br /&gt;
&lt;br /&gt;
Sumedh Limburkar&lt;br /&gt;
&lt;br /&gt;
Viraj Sanap&lt;br /&gt;
&lt;br /&gt;
Mengning Li&lt;br /&gt;
&lt;br /&gt;
Mentor: Jialin Cui&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
GitHub REST API documentation - https://docs.github.com/en/rest?apiVersion=2022-11-28&lt;/div&gt;</summary>
		<author><name>Slimbur</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:MVC2.drawio.png&amp;diff=155602</id>
		<title>File:MVC2.drawio.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:MVC2.drawio.png&amp;diff=155602"/>
		<updated>2024-04-09T06:15:14Z</updated>

		<summary type="html">&lt;p&gt;Slimbur: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Slimbur</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_G2402_Implement_REST_client,_REST_API,_and_Graphql_API_endpoint_for_repositories&amp;diff=154724</id>
		<title>CSC/ECE 517 Spring 2024 - G2402 Implement REST client, REST API, and Graphql API endpoint for repositories</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_G2402_Implement_REST_client,_REST_API,_and_Graphql_API_endpoint_for_repositories&amp;diff=154724"/>
		<updated>2024-03-27T13:46:47Z</updated>

		<summary type="html">&lt;p&gt;Slimbur: Added description&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
== GitHub Miner ==&lt;br /&gt;
This is a convenient tool to query a user's GitHub metrics. The project aims to develop API endpoints for GitHub GraphQL queries and GitHub REST queries using Python Flask. It involves integrating existing code with Flask to expose GraphQL queries as API endpoints, developing a REST client, and creating REST endpoints for querying the same data sets. The project also includes thorough testing and documentation of the endpoints.&lt;br /&gt;
&lt;br /&gt;
==Live Demo &amp;amp; Source Code==&lt;br /&gt;
http://152.7.177.239:5000/ Link]&lt;br /&gt;
&lt;br /&gt;
[https://github.ncsu.edu/slimbur/GH_Miner Source Code]&lt;br /&gt;
&lt;br /&gt;
==Installation==&lt;br /&gt;
&lt;br /&gt;
We recommend using virtual environment. Steps to setup virtual environment:&lt;br /&gt;
&lt;br /&gt;
 cd path/to/your/project/directory&lt;br /&gt;
 python -m venv venv&lt;br /&gt;
&lt;br /&gt;
On macOS and Linux:&lt;br /&gt;
 source venv/bin/activate&lt;br /&gt;
&lt;br /&gt;
On Windows (Command Prompt):&lt;br /&gt;
 .\venv\Scripts\activate&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On Windows (PowerShell):&lt;br /&gt;
 .\venv\Scripts\Activate.ps1&lt;br /&gt;
&lt;br /&gt;
Next, install all the necessary libraries:&lt;br /&gt;
 pip -r requirements.txt&lt;br /&gt;
&lt;br /&gt;
Next, set the PYTHONPATH to&lt;br /&gt;
&lt;br /&gt;
On Windows&lt;br /&gt;
 set PYTHONPATH=%PYTHONPATH%;path/to/your/project&lt;br /&gt;
 set PYTHONPATH=%PYTHONPATH%;path/to/your/project/backend&lt;br /&gt;
&lt;br /&gt;
On Unix or MacOS&lt;br /&gt;
 export PYTHONPATH=$PYTHONPATH:/path/to/your/project&lt;br /&gt;
 export PYTHONPATH=%PYTHONPATH%;path/to/your/project/backend&lt;br /&gt;
&lt;br /&gt;
You can run the app from your terminal by executing the following command:&lt;br /&gt;
 python backend\run.py&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==GraphQL Active Endpoints==&lt;br /&gt;
&lt;br /&gt;
Get current user login:&lt;br /&gt;
 /api/graphql/current-user-login&lt;br /&gt;
&lt;br /&gt;
Get specific user login:&lt;br /&gt;
 /api/graphql/user-login/&amp;lt;username&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get list of all commits in a repo:&lt;br /&gt;
 /api/graphql/specific-user-commits/&amp;lt;owner&amp;gt;/&amp;lt;repo_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get details of all contributors in a repo:&lt;br /&gt;
 /api/graphql/repository-contributors/&amp;lt;owner&amp;gt;/&amp;lt;repo_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==REST API Endpoints==&lt;br /&gt;
Get current user login:&lt;br /&gt;
 /api/rest/current-user-login-rest&lt;br /&gt;
&lt;br /&gt;
Get list of all commits in a repo:&lt;br /&gt;
 /api/rest/specific-user-commits/&amp;lt;owner&amp;gt;/&amp;lt;repo_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get details of all contributors in a repo:&lt;br /&gt;
 /api/rest/repository-contributors/&amp;lt;owner&amp;gt;/&amp;lt;repo_name&amp;gt;&lt;/div&gt;</summary>
		<author><name>Slimbur</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_G2402_Implement_REST_client,_REST_API,_and_Graphql_API_endpoint_for_repositories&amp;diff=154723</id>
		<title>CSC/ECE 517 Spring 2024 - G2402 Implement REST client, REST API, and Graphql API endpoint for repositories</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_G2402_Implement_REST_client,_REST_API,_and_Graphql_API_endpoint_for_repositories&amp;diff=154723"/>
		<updated>2024-03-27T13:44:14Z</updated>

		<summary type="html">&lt;p&gt;Slimbur: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
== GitHub Miner ==&lt;br /&gt;
This is a convenient tool to query a user's GitHub metrics.&lt;br /&gt;
&lt;br /&gt;
==Live Demo &amp;amp; Source Code==&lt;br /&gt;
http://152.7.177.239:5000/ Link]&lt;br /&gt;
&lt;br /&gt;
[https://github.ncsu.edu/slimbur/GH_Miner Source Code]&lt;br /&gt;
&lt;br /&gt;
==Installation==&lt;br /&gt;
&lt;br /&gt;
We recommend using virtual environment. Steps to setup virtual environment:&lt;br /&gt;
&lt;br /&gt;
 cd path/to/your/project/directory&lt;br /&gt;
 python -m venv venv&lt;br /&gt;
&lt;br /&gt;
On macOS and Linux:&lt;br /&gt;
 source venv/bin/activate&lt;br /&gt;
&lt;br /&gt;
On Windows (Command Prompt):&lt;br /&gt;
 .\venv\Scripts\activate&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On Windows (PowerShell):&lt;br /&gt;
 .\venv\Scripts\Activate.ps1&lt;br /&gt;
&lt;br /&gt;
Next, install all the necessary libraries:&lt;br /&gt;
 pip -r requirements.txt&lt;br /&gt;
&lt;br /&gt;
Next, set the PYTHONPATH to&lt;br /&gt;
&lt;br /&gt;
On Windows&lt;br /&gt;
 set PYTHONPATH=%PYTHONPATH%;path/to/your/project&lt;br /&gt;
 set PYTHONPATH=%PYTHONPATH%;path/to/your/project/backend&lt;br /&gt;
&lt;br /&gt;
On Unix or MacOS&lt;br /&gt;
 export PYTHONPATH=$PYTHONPATH:/path/to/your/project&lt;br /&gt;
 export PYTHONPATH=%PYTHONPATH%;path/to/your/project/backend&lt;br /&gt;
&lt;br /&gt;
You can run the app from your terminal by executing the following command:&lt;br /&gt;
 python backend\run.py&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==GraphQL Active Endpoints==&lt;br /&gt;
&lt;br /&gt;
Get current user login:&lt;br /&gt;
 /api/graphql/current-user-login&lt;br /&gt;
&lt;br /&gt;
Get specific user login:&lt;br /&gt;
 /api/graphql/user-login/&amp;lt;username&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get list of all commits in a repo:&lt;br /&gt;
 /api/graphql/specific-user-commits/&amp;lt;owner&amp;gt;/&amp;lt;repo_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get details of all contributors in a repo:&lt;br /&gt;
 /api/graphql/repository-contributors/&amp;lt;owner&amp;gt;/&amp;lt;repo_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==REST API Endpoints==&lt;br /&gt;
Get current user login:&lt;br /&gt;
 /api/rest/current-user-login-rest&lt;br /&gt;
&lt;br /&gt;
Get list of all commits in a repo:&lt;br /&gt;
 /api/rest/specific-user-commits/&amp;lt;owner&amp;gt;/&amp;lt;repo_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get details of all contributors in a repo:&lt;br /&gt;
 /api/rest/repository-contributors/&amp;lt;owner&amp;gt;/&amp;lt;repo_name&amp;gt;&lt;/div&gt;</summary>
		<author><name>Slimbur</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_G2402_Implement_REST_client,_REST_API,_and_Graphql_API_endpoint_for_repositories&amp;diff=154722</id>
		<title>CSC/ECE 517 Spring 2024 - G2402 Implement REST client, REST API, and Graphql API endpoint for repositories</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_G2402_Implement_REST_client,_REST_API,_and_Graphql_API_endpoint_for_repositories&amp;diff=154722"/>
		<updated>2024-03-27T13:43:48Z</updated>

		<summary type="html">&lt;p&gt;Slimbur: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
== GitHub Miner ==&lt;br /&gt;
This is a convenient tool to query a user's GitHub metrics.&lt;br /&gt;
&lt;br /&gt;
==Live Demo &amp;amp; Source Code==&lt;br /&gt;
http://152.7.177.239:5000/ Link]&lt;br /&gt;
&lt;br /&gt;
[https://github.ncsu.edu/slimbur/GH_Miner Source Code]&lt;br /&gt;
&lt;br /&gt;
# Installation&lt;br /&gt;
&lt;br /&gt;
We recommend using virtual environment. Steps to setup virtual environment:&lt;br /&gt;
&lt;br /&gt;
 cd path/to/your/project/directory&lt;br /&gt;
 python -m venv venv&lt;br /&gt;
&lt;br /&gt;
On macOS and Linux:&lt;br /&gt;
 source venv/bin/activate&lt;br /&gt;
&lt;br /&gt;
On Windows (Command Prompt):&lt;br /&gt;
 .\venv\Scripts\activate&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On Windows (PowerShell):&lt;br /&gt;
 .\venv\Scripts\Activate.ps1&lt;br /&gt;
&lt;br /&gt;
Next, install all the necessary libraries:&lt;br /&gt;
 pip -r requirements.txt&lt;br /&gt;
&lt;br /&gt;
Next, set the PYTHONPATH to&lt;br /&gt;
&lt;br /&gt;
On Windows&lt;br /&gt;
 set PYTHONPATH=%PYTHONPATH%;path/to/your/project&lt;br /&gt;
 set PYTHONPATH=%PYTHONPATH%;path/to/your/project/backend&lt;br /&gt;
&lt;br /&gt;
On Unix or MacOS&lt;br /&gt;
 export PYTHONPATH=$PYTHONPATH:/path/to/your/project&lt;br /&gt;
 export PYTHONPATH=%PYTHONPATH%;path/to/your/project/backend&lt;br /&gt;
&lt;br /&gt;
You can run the app from your terminal by executing the following command:&lt;br /&gt;
 python backend\run.py&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==GraphQL Active Endpoints==&lt;br /&gt;
&lt;br /&gt;
Get current user login:&lt;br /&gt;
 /api/graphql/current-user-login&lt;br /&gt;
&lt;br /&gt;
Get specific user login:&lt;br /&gt;
 /api/graphql/user-login/&amp;lt;username&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get list of all commits in a repo:&lt;br /&gt;
 /api/graphql/specific-user-commits/&amp;lt;owner&amp;gt;/&amp;lt;repo_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get details of all contributors in a repo:&lt;br /&gt;
 /api/graphql/repository-contributors/&amp;lt;owner&amp;gt;/&amp;lt;repo_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==REST API Endpoints==&lt;br /&gt;
Get current user login:&lt;br /&gt;
 /api/rest/current-user-login-rest&lt;br /&gt;
&lt;br /&gt;
Get list of all commits in a repo:&lt;br /&gt;
 /api/rest/specific-user-commits/&amp;lt;owner&amp;gt;/&amp;lt;repo_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get details of all contributors in a repo:&lt;br /&gt;
 /api/rest/repository-contributors/&amp;lt;owner&amp;gt;/&amp;lt;repo_name&amp;gt;&lt;/div&gt;</summary>
		<author><name>Slimbur</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_G2402_Implement_REST_client,_REST_API,_and_Graphql_API_endpoint_for_repositories&amp;diff=154721</id>
		<title>CSC/ECE 517 Spring 2024 - G2402 Implement REST client, REST API, and Graphql API endpoint for repositories</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_G2402_Implement_REST_client,_REST_API,_and_Graphql_API_endpoint_for_repositories&amp;diff=154721"/>
		<updated>2024-03-27T13:43:33Z</updated>

		<summary type="html">&lt;p&gt;Slimbur: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
== GitHub Miner ==&lt;br /&gt;
This is a convenient tool to query a user's GitHub metrics.&lt;br /&gt;
&lt;br /&gt;
==Live Demo &amp;amp; Source Code=&lt;br /&gt;
http://152.7.177.239:5000/ Link]&lt;br /&gt;
&lt;br /&gt;
[https://github.ncsu.edu/slimbur/GH_Miner Source Code]&lt;br /&gt;
&lt;br /&gt;
# Installation&lt;br /&gt;
&lt;br /&gt;
We recommend using virtual environment. Steps to setup virtual environment:&lt;br /&gt;
&lt;br /&gt;
 cd path/to/your/project/directory&lt;br /&gt;
 python -m venv venv&lt;br /&gt;
&lt;br /&gt;
On macOS and Linux:&lt;br /&gt;
 source venv/bin/activate&lt;br /&gt;
&lt;br /&gt;
On Windows (Command Prompt):&lt;br /&gt;
 .\venv\Scripts\activate&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On Windows (PowerShell):&lt;br /&gt;
 .\venv\Scripts\Activate.ps1&lt;br /&gt;
&lt;br /&gt;
Next, install all the necessary libraries:&lt;br /&gt;
 pip -r requirements.txt&lt;br /&gt;
&lt;br /&gt;
Next, set the PYTHONPATH to&lt;br /&gt;
&lt;br /&gt;
On Windows&lt;br /&gt;
 set PYTHONPATH=%PYTHONPATH%;path/to/your/project&lt;br /&gt;
 set PYTHONPATH=%PYTHONPATH%;path/to/your/project/backend&lt;br /&gt;
&lt;br /&gt;
On Unix or MacOS&lt;br /&gt;
 export PYTHONPATH=$PYTHONPATH:/path/to/your/project&lt;br /&gt;
 export PYTHONPATH=%PYTHONPATH%;path/to/your/project/backend&lt;br /&gt;
&lt;br /&gt;
You can run the app from your terminal by executing the following command:&lt;br /&gt;
 python backend\run.py&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==GraphQL Active Endpoints==&lt;br /&gt;
&lt;br /&gt;
Get current user login:&lt;br /&gt;
 /api/graphql/current-user-login&lt;br /&gt;
&lt;br /&gt;
Get specific user login:&lt;br /&gt;
 /api/graphql/user-login/&amp;lt;username&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get list of all commits in a repo:&lt;br /&gt;
 /api/graphql/specific-user-commits/&amp;lt;owner&amp;gt;/&amp;lt;repo_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get details of all contributors in a repo:&lt;br /&gt;
 /api/graphql/repository-contributors/&amp;lt;owner&amp;gt;/&amp;lt;repo_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==REST API Endpoints==&lt;br /&gt;
Get current user login:&lt;br /&gt;
 /api/rest/current-user-login-rest&lt;br /&gt;
&lt;br /&gt;
Get list of all commits in a repo:&lt;br /&gt;
 /api/rest/specific-user-commits/&amp;lt;owner&amp;gt;/&amp;lt;repo_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get details of all contributors in a repo:&lt;br /&gt;
 /api/rest/repository-contributors/&amp;lt;owner&amp;gt;/&amp;lt;repo_name&amp;gt;&lt;/div&gt;</summary>
		<author><name>Slimbur</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_G2402_Implement_REST_client,_REST_API,_and_Graphql_API_endpoint_for_repositories&amp;diff=154720</id>
		<title>CSC/ECE 517 Spring 2024 - G2402 Implement REST client, REST API, and Graphql API endpoint for repositories</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_G2402_Implement_REST_client,_REST_API,_and_Graphql_API_endpoint_for_repositories&amp;diff=154720"/>
		<updated>2024-03-27T13:40:00Z</updated>

		<summary type="html">&lt;p&gt;Slimbur: Added links for GitHub repo and deployed application&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
== GitHub Miner ==&lt;br /&gt;
This is a convenient tool to query a user's GitHub metrics.&lt;br /&gt;
&lt;br /&gt;
=Live Demo &amp;amp; Source Code=&lt;br /&gt;
http://152.7.177.239:5000/ Link]&lt;br /&gt;
&lt;br /&gt;
[https://github.ncsu.edu/slimbur/GH_Miner Source Code]&lt;br /&gt;
&lt;br /&gt;
# Installation&lt;br /&gt;
&lt;br /&gt;
We recommend using virtual environment. Steps to setup virtual environment:&lt;br /&gt;
&lt;br /&gt;
 cd path/to/your/project/directory&lt;br /&gt;
 python -m venv venv&lt;br /&gt;
&lt;br /&gt;
On macOS and Linux:&lt;br /&gt;
 source venv/bin/activate&lt;br /&gt;
&lt;br /&gt;
On Windows (Command Prompt):&lt;br /&gt;
 .\venv\Scripts\activate&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On Windows (PowerShell):&lt;br /&gt;
 .\venv\Scripts\Activate.ps1&lt;br /&gt;
&lt;br /&gt;
Next, install all the necessary libraries:&lt;br /&gt;
 pip -r requirements.txt&lt;br /&gt;
&lt;br /&gt;
Next, set the PYTHONPATH to&lt;br /&gt;
&lt;br /&gt;
On Windows&lt;br /&gt;
 set PYTHONPATH=%PYTHONPATH%;path/to/your/project&lt;br /&gt;
 set PYTHONPATH=%PYTHONPATH%;path/to/your/project/backend&lt;br /&gt;
&lt;br /&gt;
On Unix or MacOS&lt;br /&gt;
 export PYTHONPATH=$PYTHONPATH:/path/to/your/project&lt;br /&gt;
 export PYTHONPATH=%PYTHONPATH%;path/to/your/project/backend&lt;br /&gt;
&lt;br /&gt;
You can run the app from your terminal by executing the following command:&lt;br /&gt;
 python backend\run.py&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==GraphQL Active Endpoints==&lt;br /&gt;
&lt;br /&gt;
Get current user login:&lt;br /&gt;
 /api/graphql/current-user-login&lt;br /&gt;
&lt;br /&gt;
Get specific user login:&lt;br /&gt;
 /api/graphql/user-login/&amp;lt;username&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get list of all commits in a repo:&lt;br /&gt;
 /api/graphql/specific-user-commits/&amp;lt;owner&amp;gt;/&amp;lt;repo_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get details of all contributors in a repo:&lt;br /&gt;
 /api/graphql/repository-contributors/&amp;lt;owner&amp;gt;/&amp;lt;repo_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==REST API Endpoints==&lt;br /&gt;
Get current user login:&lt;br /&gt;
 /api/rest/current-user-login-rest&lt;br /&gt;
&lt;br /&gt;
Get list of all commits in a repo:&lt;br /&gt;
 /api/rest/specific-user-commits/&amp;lt;owner&amp;gt;/&amp;lt;repo_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get details of all contributors in a repo:&lt;br /&gt;
 /api/rest/repository-contributors/&amp;lt;owner&amp;gt;/&amp;lt;repo_name&amp;gt;&lt;/div&gt;</summary>
		<author><name>Slimbur</name></author>
	</entry>
</feed>