This project is a React Application built with class components. It fetches your information from Github thanks to the running tests and outputs it in a layout that is very similar to the one found in the Profile Section in Github.
This project is composed of 5 components:
- App
- Navbar
- Profile
- RepositoriesList
- SingleRepository
This project is sending 2 requests to Github API:
- GET
/userto get the user info - GET
/user/reposto get the user repos
Fork the repository from Github and clone it locally using:
$ git clone link_to_your_repository
- Install the dependencies and start the project
$ npm install
$ npm start
This project needs the user's Github token in order to successfuly fetch the data from the API. The token needs to be stored in the .env file as an environment variable.
To add your token, you should:
- Get your token from Github. You can find the steps online.
- Copy the file called
.env.exampleand rename it to.env - Paste your token there
- Restart the sever
We want to migrate this project to use React Hooks in Functional Components to be more scalable in the future.
You should start doing your work in a seperate branch to not mess the existing code. Go ahead and create a new branch following this command:
$ git checkout -b hooks
Go ahead and enjoy refactoring the project to use Hooks following these steps:
- Substitute the Class components with Functional components
- Refactor the state variables using
useStatehook - Refactor the lifecycle methods using
useEffecthook
After finishing, don't forget to push your changes and make a Pull Request