Coder Social home page Coder Social logo

github-user-scroll's Introduction

Introduction:

Simple web application built using React.js to search GitHub repositories โ˜•๏ธ

Built with:

Structure:

[app]
    public/                     # favicon, robots.txt, etc.
    src/
        contexts/               # state management of the application
        hooks/                  # custom react hooks
        types/                  # typescript types of the objects
        App.css                 # styles specific to App.tsx
        App.test.tsx            # test cases specific to App.tsx
        App.tsx                 # main react component
        index.tsx               # entry point to the react application
        react-app.env.d.ts      # typescript type declarations specific to project
        reportWebVitals.ts      # used to measure react application performance
        setupTests.ts           # jest test runner
.gitignore                      # git ignored files list
package.json                    # dependencies of the project
tsconfig.json                   # typescript configuration
yarn.lock                       # autogenerated file to keep track of yarn packages

How to run the project:

  1. Clone the repo (via GitHub CLI)

    gh repo clone akashennn/dcard-scroll
  2. Go to the project directory /dcard-scroll and install node modules

    yarn i
  3. Run the project

    yarn start

FAQ:

  1. Why useDebounce hook is being used?
  • In order to prevent backend endpoints calls being made upon every keystroke of the user's search query, now it will call the API only after user has not typed anything for 500 milliseconds.
  1. How does the infinite scroll works?
  • Number of results per page is 30 (default), therefore 30 * pageNumber covers all the results appeared on the search until now. If that's less than the total_count, more results are available to fetch so the API call will be made when user scrolls down / reach the last element of the current search result page.

Screenshots:

  • Search results for dcard

screencapture-localhost-3000-2022-12-26-17_41_00

github-user-scroll's People

Contributors

akashennn avatar

Watchers

uvacoder 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.