YO
YongYuH/github-repo-list
show Github repositories in infinite scrolling list
Live demo
https://adoring-jennings-f809ce.netlify.app/

How to run this project in local environment
- install Node.js package manager
yarnornpm - install dependencies through
yarnornpm
yarn
or
npm install
- start development server
yarn dev
or
npm run dev
- build and start production server
yarn build
yarn start
or
npm run build
npm start
Flow Chart
Description
Folder structure
- Define components, hooks, and util functions in a folder as a module.
- Reusable components, hooks, and util functions would be defined in the sibling folders of other module folders.
Reusable components
- Use
styled-systemto unify style property name of reusable components.
Type safe
- Generate types of github api through
openapi-typescriptto ensure type safety when access data of github api responses. - Exhaustive match through
ts-patternto ensure all input types would be handled in compile time.
Styling
- Use one of the css-in-js solutions,
styled-componentsto add style to components to avoid css class name naming collision and polyfill styled cross different browsers.
Debounce
- Reduce the update frequency of fetch urls to avoid too many requests sent in a short time.
Infinite scroll
- Update trigger condition of the github next page repositories through IntersectionObserver apis.
License
On this page
Languages
TypeScript99.9%JavaScript0.0%Shell0.0%
Contributors
MIT License
Created August 25, 2021
Updated September 6, 2021


