diff --git a/README.md b/README.md index 9c708959..ec41e8e6 100644 --- a/README.md +++ b/README.md @@ -5,27 +5,26 @@ This is a small project for a react interview. Create a React application that retrieves and displays the user repositories and organisations in Github. ## UX/UI -Up to you, probably it should include an input to enter the username, one area to display the repositories of the user and another area to display the organisations +Up to you, probably it should include an input to enter the username, one area to display the repositories of the user and another area to display the organisations. ## Retrieving data -To make things easier we have commited a github-api.js file with the REST APIs needed to retrieve the information. +Use the GitHub v4 GraphQL API: https://developer.github.com/v4/ +We recommend using Apollo Client. ## Bootstrapping the project Up to you, we recommend [create-react-app](https://github.com/facebook/create-react-app). ## Submitting the solution -Copy this repository to a repository on your name and add the solution there. It should be clear how to build and run the project locally. +Copy this repository to a repository on your own github account and add the solution there. Show good branching and committing strategy, open a pull request with the solution, and add Sean as a reviewer (@seanmctex). It should be clear how to build and run the project locally. ## Bonus (don't need to be in the below specific order) * Use ES6 syntax including arrow functions, destructuring and async/await -* Adding types with Flow or Typescript * Adding a spinner when information is loading * Deal with errors coming from the backend * Some sort of Unit Test * Some sort of Integration Test * Having a nice UI using a components library (Bootstrap?) * Divide the application in different pages and use a router -* Adding state management (additional Bonus if using Mobx or Mobx-State-Tree instead of Redux) * Show common tools used for you daily development environment (linters, code formatter, git workflow, docker and so on) * Deploy the project somewhere diff --git a/github-api.js b/github-api.js deleted file mode 100644 index c0d58cf1..00000000 --- a/github-api.js +++ /dev/null @@ -1,23 +0,0 @@ -import axios from "axios"; - -// Documentation is at https://developer.github.com/v3/ -const BASE_URL = "https://api.github.com/"; - -export { getRepos, getUserData }; - -function getRepos(username) { - const url = `${BASE_URL}/users/${username}/repos?per_page=250`; - return axios.get(url).then(response => response.data); -} - -function getUserData(username) { - return axios - .all([ - axios.get(`${BASE_URL}/users/${username}`), - axios.get(`${BASE_URL}/users/${username}/orgs`) - ]) - .then(([user, orgs]) => ({ - user: user.data, - orgs: orgs.data - })); -}