This project was bootstrapped with Create React App.
Libraries and packages used:
- React 18 + Hooks
- SASS
- Context API
- Octokit
Features:
- Shows loader while fetching data
- Shows empty state if user doesn't have any repository
- Shows empty state (error) if user doesn't exist
- Responsive layout for 320px+ width
- Server-side pagiantion written from scratch
- Code is split into components
- Utility function for trimming the number of followers and following if there are more than a 1000
Known issues:
- Double re-render while fetching data
- User section dissapears and appears with repo section (app shows loading spinner at that moment) before and after loading repos, even user is already fetched (the con of server-side pagination)
Bug with the number of repository pages (sometimes it just shows a blank page on the last one)Fixed: see lines 92-97 in context.js
Yeah, I know, the app is not as ideal as it could be, but its just a test task, not the commercial project. I had so much fun writing it. The best thing I've found about programming is the fact that some time after you've build the application you can find yourself sitting and thinking how would you build the app now. And there is always a different approach than the one you've chosen.
P.S. I tried to follow DRY and KISS principles but now I uderstand that even such a small app requires a structure.So, if I needed to complete this task now, I would rather used Redux or at least useReducer() hook with ContextAPI. :)
In the project directory, you can run:
Runs the app in the development mode.
Open http://localhost:3000 to view it in your browser.
The page will reload when you make changes.
You may also see any lint errors in the console.
Launches the test runner in the interactive watch mode.
See the section about running tests for more information.
Builds the app for production to the build
folder.
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.
Your app is ready to be deployed!
See the section about deployment for more information.
Note: this is a one-way operation. Once you eject
, you can't go back!
If you aren't satisfied with the build tool and configuration choices, you can eject
at any time. This command will remove the single build dependency from your project.
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except eject
will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.
You don't have to ever use eject
. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.