Git Product home page Git Product logo

repo-searcher's Introduction

Repos searcher

Search for repositories on GitHub

Vercel Demo β€” Report Bug β€” Request Feature

🌟 Challenge

Develop an application that is a GitHub repository search πŸ”. On the main page, the application should render an input and a table with the search results. Its structure should look like this:

Name Owner Stars Created at
yrogovich/repo-searcher yrogovich 1 2016-10-29

Please add the following features (as many as you can) in the following order:

  • Caching the search results, so we don't have to make an API call if the results were fetched before.
  • Presenting a simple loading/error state
  • Sorting the table by columns, pagination, and changing the number of rows displayed (locally).
  • Updating the current URL on query change or table sort, so we get the same results when the page gets refreshed.
  • Removing a "search" button and firing API requests only when the user stopped typing (please be aware of GitHub rate limits).

And adding anything else that will be useful for the user...

πŸš€ Planned enhancements

  • WCAG: Add proper ARIA attributes to form elements for screen reader compatibility.
  • Error Handling: Adding a user-friendly error display mechanism in the UI for a better experience.
  • UI: Incorporate visual loading indicators while the form submits and searches.
  • Skeleton Loading: Implement a skeleton loading state for the table while the data is being fetched.
  • Caching: Introduce a more robust caching system (e.g., Redis or an in-memory cache) to complement React Query's caching. This will significantly enhance repeated query performance.
  • Redux for complex form state management.
  • Now pagination works only locally (on client side) as it was described in the challenge. But it would be better to implement server side pagination. It will be more efficient and will allow to get more data from the server.

πŸ”§ Installation and Setup

  1. Clone the repository

    git clone https://github.com/yrogovich/repo-searcher.git
  2. Navigate to the project directory

    cd repo-searcher
  3. Install dependencies

    recommended methodπŸ‘‡πŸΎ

    pmpm install

    or old school method πŸ‘΄πŸΎ

    npm install
  4. Add .env.local file to the root of the project from the .env.example file and add your GitHub token to the file.

  5. Start the development server

     pnpm run dev

πŸ’¬ Commit Messages

This project uses Conventional Commits for commit messages. This convention makes it easier to understand the changes in a project and to automate the versioning process.

πŸ™ GitHub APIs

Full documentation for GitHub's Search APIs can be found here:

A sample query to find repos with "tetris" can be found below:

curl https://api.github.com/search/repositories?q=tetris&sort=stars&order=desc

You should be able to modify this to suit your needs.

Please note that GitHub requests are rate limited as follows:

The Search API has a custom rate limit. For requests using Basic Authentication, OAuth, or client ID and secret, you can make up to 30 requests per minute. For unauthenticated requests, the rate limit allows you to make up to 10 requests per minute.

πŸ”— Relevant Links

πŸ“œ License

This project is licensed under the MIT License.

repo-searcher's People

Contributors

yrogovich avatar

Stargazers

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