In this project we are going to be accessing the GitHub API and building a social card based on the data we get back. The goal is to create a component based on the data we get when we send a GET request to the GitHub API (requesting your own data at first). The CSS and the base HTML is already done for you, you simply need to create the component function and connect the pieces.
- Adding dependencies to a project:
- Via script element
- Using npm
- JavaScript:
- Creating DOM components with Javascript Functions
- Utilizing 3rd party libraries (Axios)
- Promises, .then & .catch
- HTTP GET requests
- Array Methods
- DOM
- Element selection
- Basic DOM manipulation
- Events and event listeners
Follow these steps to set up and work on your project:
- Create a forked copy of this project.
- Add your team lead as collaborator on Github.
- Clone your OWN version of the repository (Not Lambda's by mistake!).
- Create a new branch: git checkout -b
<firstName-lastName>
. - Implement the project on your newly created
<firstName-lastName>
branch, committing changes regularly. - Push commits: git push origin
<firstName-lastName>
.
Follow these steps for completing your project.
- Submit a Pull-Request to merge
<firstName-lastName>
Branch intomain
(student's Repo). Please don't merge your own pull request
- Navigate to the root of the project with your command line.
- Run
npm install
to download any dependencies listed in thepackage.json
file. - Run
npm start
to compile your project and launch a development server.
- Include the script element linking the
axios
library in your HTML. - If you do not remember the code you can find it here.
- Navigate to the root of the project with your command line.
- Run
npm install axios
to download the dependency (it will be added to thepackage.json
file). - At the top of the
GitHubCard/index.js
file, typeimport axios from 'axios';
- Follow the instructions found in the
GitHubCard/index.js
file to request data from the GitHub API.
- Once you are receiving data from the GitHub API, take some time to study the data and the information it is giving you. You will create the HTML template you see in the GitHubCard/index.js file and plugging in the dynamic data you are getting from the GitHub API.
- Once you complete the component, create a component based on your profile and add it to the DOM.
- After you have successfully added your own card to the DOM, we will get a list of your followers and programmatically add cards for them as well. Follow the instructions in GitHubCard/index.js.
-
Instead of manually creating a list of followers, do it programmatically. Create a function that requests the followers data from the API after it has received your data and create a card for each of your followers. Hint: you can chain promises.
-
Look into adding more info as an expanding card. You will need to create some new CSS and a button that expands and contracts the card.
-
Look into adding your GitHub contribution graph. There are a number of different ways of doing this, this Stack Overflow discussion will get you started.
Note: Just a reminder the stretch goals are just extra practice using the tools we have learned. These are not required. Only parts 1-3 are required portions of the project. If you do not get to the stretch goals, don't worry.