This is a small application that allows you to search for repositories on GitHub.
- Search for repositories by text query
- Sort and order by Stars or Updated column
- Simple pagination support (next and previous page)
- Change the number of results per page
- Results are cached in memory for 1 minute
- Loading and error states are displayed when necessary
I have added husky and commitlint to enforce commit message format. I have also added lint-staged to run linters on staged files before commit.
I have decided to use RTK Query because there was Redux requirement and I thought that It would be better choice than Tanstack Query because I added Redux Toolkit also. Usually I would use Tanstack Query for this kind of application.
Btw, I have used Redux Toolkit Query for the first time so I might have not used it in the best way.
- Unit tests
- No React Context was used
- State is not hold in the URL, so if you refresh the page, the state is lost (If I had more time I would move the searchParams state from redux to URL query params)
- GitHuB API rate limits are not handled
- Search, Next, Prev buttons have no loading state (I would disable them while the request is being made and display a loading spinner inside)
This project uses pnpm as package manager, so you need to install it before running the project.
# Install pnpm
$ npm install -g pnpm
# Install the dependencies
$ pnpm install
# Run production build
$ pnpm build
$ pnpm start
# or
# Run development build
$ pnpm dev