Giter Site home page Giter Site logo

abdulhadi806 / get-and-search-github-issues-using-github-api Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 233 KB

This app is used to search and find github issues using github API, App is created using ReactJS, Typescript, Tailwind css

Home Page: https://githubissues-flame.vercel.app

HTML 6.69% TypeScript 91.91% CSS 0.22% JavaScript 1.18%
context-api github-api reactjs rest-api tailwindcss typescript

get-and-search-github-issues-using-github-api's Introduction

GitHub Issues Viewer

Overview

GitHub Issues Viewer is a web application that enables users to retrieve and search GitHub issues using the GitHub API. It is built with ReactJS, Tailwind CSS, and TypeScript. View Project

Technologies Used

How to Run the App

To run the application locally, follow these steps:

  1. Clone the project repository:

    git clone https://github.com/AbdulHadi806/get-and-search-github-issues-using-github-api.git
  2. Install dependencies with npm:

    npm install
  3. Start the application:

    npm start
  4. Open Browser and search

    http://localhost:3000

UI

GitHub Issues Viewer UI

How the App Works

The GitHub Issues Viewer application is designed to facilitate the retrieval and search of GitHub issues through the GitHub API. Below is an overview of how the application functions:

Data Fetching from GitHub API

The core functionality of fetching GitHub issues is implemented through the fetchIssues function located in the GithubProvider.ts file. Here's a breakdown of its functionality:

  • The function takes two parameters: page, which represents the page number of the issues to fetch, and search, which represents the search query.
  • Upon invocation, it sets the loading state to true to indicate that data fetching is in progress.
  • If the search query has changed (prevSearch !== search), it resets the current page and total pages to ensure accurate pagination.
  • It then performs a preliminary fetch to determine the total number of issues matching the search query to calculate the total number of pages.
  • Subsequently, it fetches the issues for the specified page from the GitHub API.
  • Upon successful fetching of data, it updates the application state with the fetched issues, current page, and search query, and sets the loading state to false.
  • In case of an error during data fetching, it logs the error and sets the error state accordingly, resetting the current page and total pages.
image

Using Data

We are exporting the data from GitHubProvider.tsx and using it in respected Components,

image

API Rate Limit Handling

Due to using unauthenticated API there is a rate limit set on our API.

Package.json

{
  "name": "github_issues",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@testing-library/jest-dom": "^5.17.0",
    "@testing-library/react": "^13.4.0",
    "@testing-library/user-event": "^13.5.0",
    "@types/jest": "^27.5.2",
    "@types/node": "^16.18.77",
    "@types/react": "^18.2.48",
    "@types/react-dom": "^18.2.18",
    "date-fns": "^3.3.1",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "react-paginate": "^8.2.0",
    "react-scripts": "5.0.1",
    "react-spinners": "^0.13.8",
    "typescript": "^4.9.5",
    "web-vitals": "^2.1.4"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": [
      "react-app",
      "react-app/jest"
    ]
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  },
  "devDependencies": {
    "tailwindcss": "^3.4.1"
  }
}

get-and-search-github-issues-using-github-api's People

Contributors

abdulhadi806 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.