This project was bootstrapped with Create React App.
User can use this project to search users on github, then get repositories information of searched user.
- Infinite Scroll
- react-router-dom
- styled-components
- Github REST API
Use Intersection Observer Web API
to achieve infinite scroll and only load more repositories while scrolling to current bottom boundary.
Use <HashRouter>
to achieve SPA and use useNavigate
and useParams
to request data of searched user and repositories.
Use styled-components to manage all CSS code in js files.
Follow information of Repositories provided by Github REST API, Using axios
to send request and render components by response.
In the project directory, you can do:
At Home page, you can enter username that want to search in the search bar, then
Click search button or press Enter to search user on Github.
https://shanyujung.github.io/github-repository-searcher/#/users/{username}/repos
After click search button,project will lead user's repository page.
At this page,you can get 10 repositories of searched user. Once scrolling to bottom, will load 10 more repositories, until all repositories is loaded.
https://shanyujung.github.io/github-repository-searcher/#/users/{username}/repos/{repoName}
You can click each repository ,then project will lead to selected repository page.
At this page
,you can get more information of selected repository, include repo's full name, description, stargazers and a link to selected repository on github.
Intersection Observer Web API
- Replace add eventListener to scroll event to get better performance.
- Fix the problem that send multiple requests when holding scroll bar at bottom before previous response data render.
Loading Screen
- Add
loadingSpinner
while request data and placeholder of user avatar to upgrade user experience User's Repositories page.
styled-components
- Updated all css with styled-components, delete all css module.
User's Repositories
- Update components and css files.
- Searched user information include bio, location, email, blog and twitter will be showed if it is available.
- Number of public repositories will be showed.
- Main Language ,stargazers and last update date of each repository will be showed.
Single Repository
- Update components and css files.
- Selected repository information include description, license, stargazers, forks and main Language will be showed.
- Remove github icon(link to repository on Github), now user can click repository full name to open a new tab that link to selected repository on Github.