├── src ├── Error │ ├── index.js │ └── style.css ├── Input │ ├── index.js │ └── style.css ├── Issue │ ├── index.js │ ├── IssueItem │ │ ├── index.js │ │ └── style.css │ └── IssueList │ │ ├── index.js │ │ └── style.css ├── Link │ ├── index.js │ └── style.css ├── Button │ ├── index.js │ └── style.css ├── FetchMore │ ├── index.js │ └── style.css ├── Loading │ ├── index.js │ └── style.css ├── Profile │ ├── index.js │ └── style.css ├── Repository │ ├── index.js │ ├── RepositoryItem │ │ ├── index.js │ │ └── style.css │ ├── RepositoryList │ │ ├── index.js │ │ └── style.css │ └── style.css ├── TextArea │ ├── index.js │ └── style.css ├── constants │ └── routes.js ├── App │ ├── Navigation │ │ ├── index.js │ │ └── style.css │ ├── index.js │ ├── Footer │ │ ├── style.css │ │ └── index.js │ └── style.css ├── Organization │ ├── index.js │ └── style.css ├── index.js ├── style.css └── registerServiceWorker.js ├── public ├── favicon.ico ├── manifest.json └── index.html ├── .travis.yml ├── .gitignore ├── package.json ├── .github └── FUNDING.yml └── README.md /src/Error/index.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/Input/index.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/Issue/index.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/Link/index.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/Link/style.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/Button/index.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/FetchMore/index.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/Loading/index.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/Profile/index.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/Profile/style.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/Repository/index.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/TextArea/index.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/constants/routes.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/App/Navigation/index.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/Issue/IssueItem/index.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/Issue/IssueList/index.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/Organization/index.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/Organization/style.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/Repository/RepositoryItem/index.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/Repository/RepositoryList/index.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/Repository/RepositoryItem/style.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/Repository/RepositoryList/style.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/Error/style.css: -------------------------------------------------------------------------------- 1 | .ErrorMessage { 2 | margin: 20px; 3 | display: flex; 4 | justify-content: center; 5 | } -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-road-to-graphql/react-graphql-github-apollo-starter-kit/HEAD/public/favicon.ico -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | 3 | node_js: 4 | - stable 5 | 6 | install: 7 | - npm install 8 | 9 | script: 10 | - npm test -------------------------------------------------------------------------------- /src/TextArea/style.css: -------------------------------------------------------------------------------- 1 | .TextArea { 2 | display: block; 3 | min-width: 200px; 4 | min-height: 75px; 5 | padding: 10px; 6 | margin-bottom: 10px; 7 | } -------------------------------------------------------------------------------- /src/FetchMore/style.css: -------------------------------------------------------------------------------- 1 | .FetchMore { 2 | display: flex; 3 | flex-direction: column; 4 | align-items: center; 5 | } 6 | 7 | .FetchMore-button { 8 | margin: 20px 0; 9 | } -------------------------------------------------------------------------------- /src/App/index.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | 3 | class App extends Component { 4 | render() { 5 | return
Hello World
; 6 | } 7 | } 8 | 9 | export default App; -------------------------------------------------------------------------------- /src/Loading/style.css: -------------------------------------------------------------------------------- 1 | .Loading { 2 | display: flex; 3 | flex-direction: column; 4 | align-items: center; 5 | margin: 20px 0; 6 | } 7 | 8 | .Loading_center { 9 | margin-top: 30%; 10 | } -------------------------------------------------------------------------------- /src/Issue/IssueItem/style.css: -------------------------------------------------------------------------------- 1 | .IssueItem { 2 | margin-bottom: 10px; 3 | display: flex; 4 | align-items: baseline; 5 | } 6 | 7 | .IssueItem-content { 8 | margin-left: 10px; 9 | padding-left: 10px; 10 | border-left: 1px solid #000; 11 | } -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | 4 | import registerServiceWorker from './registerServiceWorker'; 5 | import App from './App'; 6 | 7 | import './style.css'; 8 | 9 | ReactDOM.render( 10 | , 11 | document.getElementById('root') 12 | ); 13 | 14 | registerServiceWorker(); 15 | -------------------------------------------------------------------------------- /src/Input/style.css: -------------------------------------------------------------------------------- 1 | .Input { 2 | border: none; 3 | padding: 10px; 4 | background: none; 5 | outline: none; 6 | } 7 | 8 | .Input:focus { 9 | outline: none; 10 | } 11 | 12 | .Input_white { 13 | border-bottom: 1px solid #fff; 14 | color: #fff; 15 | } 16 | 17 | .Input_black { 18 | border-bottom: 1px solid #000; 19 | color: #000; 20 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | 6 | # testing 7 | /coverage 8 | 9 | # production 10 | /build 11 | 12 | # misc 13 | .DS_Store 14 | .env 15 | .env.local 16 | .env.development.local 17 | .env.test.local 18 | .env.production.local 19 | 20 | npm-debug.log* 21 | yarn-debug.log* 22 | yarn-error.log* 23 | -------------------------------------------------------------------------------- /public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | } 10 | ], 11 | "start_url": "./index.html", 12 | "display": "standalone", 13 | "theme_color": "#000000", 14 | "background_color": "#ffffff" 15 | } 16 | -------------------------------------------------------------------------------- /src/Issue/IssueList/style.css: -------------------------------------------------------------------------------- 1 | .Issues { 2 | display: flex; 3 | flex-direction: column; 4 | align-items: center; 5 | margin: 0 20px; 6 | } 7 | 8 | .Issues-content { 9 | margin-top: 20px; 10 | display: flex; 11 | flex-direction: column; 12 | } 13 | 14 | .IssueList { 15 | margin: 20px 0; 16 | } 17 | 18 | @media only screen and (max-device-width: 480px) { 19 | .Issues-content { 20 | align-items: center; 21 | } 22 | } -------------------------------------------------------------------------------- /src/App/Footer/style.css: -------------------------------------------------------------------------------- 1 | .Footer { 2 | display: flex; 3 | flex-direction: column; 4 | align-items: center; 5 | background-color: #24292e; 6 | padding: 20px; 7 | color: #ffffff; 8 | } 9 | 10 | @media only screen and (max-device-width: 480px) { 11 | .Footer { 12 | text-align: center; 13 | } 14 | } 15 | 16 | .Footer-text { 17 | opacity: 0.35; 18 | } 19 | 20 | .Footer-link { 21 | color: #ffffff; 22 | opacity: 1; 23 | } -------------------------------------------------------------------------------- /src/App/style.css: -------------------------------------------------------------------------------- 1 | .App { 2 | min-height: 100%; 3 | display: flex; 4 | flex-direction: column; 5 | } 6 | 7 | .App-main { 8 | flex: 1; 9 | } 10 | 11 | .App-content_large-header, 12 | .App-content_small-header { 13 | margin-top: 54px; 14 | } 15 | 16 | @media only screen and (max-device-width: 480px) { 17 | .App-content_large-header { 18 | margin-top: 123px; 19 | } 20 | 21 | .App-content_small-header { 22 | margin-top: 68px; 23 | } 24 | } -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-graphql-apollo-tutorial-boilerplate", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "react": "^16.6.0", 7 | "react-dom": "^16.6.0", 8 | "react-scripts": "3.1.0" 9 | }, 10 | "scripts": { 11 | "start": "react-scripts start", 12 | "build": "react-scripts build", 13 | "test": "react-scripts test --env=jsdom --passWithNoTests", 14 | "eject": "react-scripts eject" 15 | }, 16 | "browserslist": [ 17 | ">0.2%", 18 | "not dead", 19 | "not ie <= 11", 20 | "not op_mini all" 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: rwieruch 4 | patreon: # rwieruch 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | custom: # Replace with a single custom sponsorship URL 13 | -------------------------------------------------------------------------------- /src/style.css: -------------------------------------------------------------------------------- 1 | #root, 2 | html, 3 | body { 4 | height: 100%; 5 | } 6 | 7 | body { 8 | margin: 0; 9 | padding: 0; 10 | font-family: 'Source Sans Pro', sans-serif; 11 | font-weight: 200; 12 | text-rendering: optimizeLegibility; 13 | } 14 | 15 | h2 { 16 | font-size: 24px; 17 | font-weight: 600; 18 | line-height: 34px; 19 | margin: 5px 0; 20 | } 21 | 22 | h3 { 23 | font-size: 20px; 24 | font-weight: 400; 25 | line-height: 27px; 26 | margin: 5px 0; 27 | } 28 | 29 | ul, 30 | li { 31 | list-style: none; 32 | padding-left: 0; 33 | } 34 | 35 | a { 36 | text-decoration: none; 37 | color: #000; 38 | opacity: 1; 39 | transition: opacity 0.25s ease-in-out; 40 | } 41 | 42 | a:hover { 43 | opacity: 0.35; 44 | text-decoration: none; 45 | } 46 | 47 | a:active { 48 | text-decoration: none; 49 | } 50 | 51 | pre { 52 | white-space: pre-wrap; 53 | } -------------------------------------------------------------------------------- /src/Button/style.css: -------------------------------------------------------------------------------- 1 | .Button { 2 | padding: 10px; 3 | background: none; 4 | cursor: pointer; 5 | transition: color 0.25s ease-in-out; 6 | transition: background 0.25s ease-in-out; 7 | } 8 | 9 | .Button_white { 10 | border: 1px solid #fff; 11 | color: #fff; 12 | } 13 | 14 | .Button_white:hover { 15 | color: #000; 16 | background: #fff; 17 | } 18 | 19 | .Button_black { 20 | border: 1px solid #000; 21 | color: #000; 22 | } 23 | 24 | .Button_black:hover { 25 | color: #fff; 26 | background: #000; 27 | } 28 | 29 | .Button_unobtrusive { 30 | padding: 0; 31 | color: #000; 32 | background: none; 33 | border: none; 34 | cursor: pointer; 35 | opacity: 1; 36 | transition: opacity 0.25s ease-in-out; 37 | outline: none; 38 | } 39 | 40 | .Button_unobtrusive:hover { 41 | opacity: 0.35; 42 | } 43 | 44 | .Button_unobtrusive:focus { 45 | outline: none; 46 | } -------------------------------------------------------------------------------- /src/App/Navigation/style.css: -------------------------------------------------------------------------------- 1 | .Navigation { 2 | overflow: hidden; 3 | position: fixed; 4 | top: 0; 5 | width: 100%; 6 | z-index: 1; 7 | background-color: #24292e; 8 | display: flex; 9 | align-items: baseline; 10 | } 11 | 12 | @media only screen and (max-device-width: 480px) { 13 | .Navigation { 14 | flex-direction: column; 15 | justify-content: center; 16 | align-items: center; 17 | } 18 | } 19 | 20 | .Navigation-link { 21 | font-size: 12px; 22 | letter-spacing: 3.5px; 23 | font-weight: 500; 24 | text-transform: uppercase; 25 | padding: 20px; 26 | text-decoration: none; 27 | } 28 | 29 | .Navigation-link a { 30 | color: #ffffff; 31 | } 32 | 33 | .Navigation-search { 34 | padding: 0 10px; 35 | } 36 | 37 | @media only screen and (max-device-width: 480px) { 38 | .Navigation-link { 39 | padding: 10px; 40 | } 41 | 42 | .Navigation-search { 43 | padding: 10px 10px; 44 | } 45 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # react-graphql-github-apollo-starter-kit 2 | 3 | [![Build Status](https://travis-ci.org/the-road-to-graphql/react-graphql-github-apollo-starter-kit.svg?branch=master)](https://travis-ci.org/the-road-to-graphql/react-graphql-github-apollo-starter-kit) [![Slack](https://slack-the-road-to-learn-react.wieruch.com/badge.svg)](https://slack-the-road-to-learn-react.wieruch.com/) [![Greenkeeper badge](https://badges.greenkeeper.io/the-road-to-graphql/react-graphql-github-apollo-starter-kit.svg)](https://greenkeeper.io/) 4 | 5 | A boilerplate project for getting you started with [A complete React with Apollo and GraphQL Tutorial](https://www.robinwieruch.de/react-graphql-apollo-tutorial). 6 | 7 | ## Installation 8 | 9 | * `git clone git@github.com:the-road-to-graphql/react-graphql-github-apollo-starter-kit.git` 10 | * cd react-graphql-github-apollo-starter-kit 11 | * npm install 12 | * npm start 13 | * visit `http://localhost:3000` 14 | 15 | ## Want to learn more about React + GraphQL + Apollo? 16 | 17 | * Don't miss [upcoming Tutorials and Courses](https://www.getrevue.co/profile/rwieruch) 18 | * Check out current [React Courses](https://roadtoreact.com) 19 | -------------------------------------------------------------------------------- /src/App/Footer/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | import Link from '../../Link'; 4 | 5 | import './style.css'; 6 | 7 | const Footer = () => ( 8 |
9 |
10 | 11 | Built by{' '} 12 | 16 | Robin Wieruch 17 | {' '} 18 | with ♥ 19 | 20 |
21 |
22 | 23 | 24 | Interested in GraphQL, Apollo and React? 25 | {' '} 26 | 30 | Get updates 31 | {' '} 32 | 33 | about upcoming articles, books & 34 | {' '} 35 | 36 | courses 37 | 38 | . 39 | 40 |
41 |
42 | ); 43 | 44 | export default Footer; -------------------------------------------------------------------------------- /src/Repository/style.css: -------------------------------------------------------------------------------- 1 | .RepositoryItem { 2 | padding: 20px; 3 | border-bottom: 1px solid #000; 4 | } 5 | 6 | .RepositoryItem-title { 7 | display: flex; 8 | justify-content: space-between; 9 | align-items: baseline; 10 | } 11 | 12 | @media only screen and (max-device-width: 480px) { 13 | .RepositoryItem-title { 14 | flex-direction: column; 15 | align-items: center; 16 | } 17 | } 18 | 19 | .RepositoryItem-title-action { 20 | margin-left: 10px; 21 | } 22 | 23 | .RepositoryItem-description { 24 | margin: 10px 0; 25 | display: flex; 26 | justify-content: space-between; 27 | } 28 | 29 | @media only screen and (max-device-width: 480px) { 30 | .RepositoryItem-description { 31 | flex-direction: column; 32 | align-items: center; 33 | } 34 | } 35 | 36 | .RepositoryItem-description-info { 37 | margin-right: 20px; 38 | } 39 | 40 | @media only screen and (max-device-width: 480px) { 41 | .RepositoryItem-description-info { 42 | text-align: center; 43 | margin: 20px 0; 44 | } 45 | } 46 | 47 | .RepositoryItem-description-details { 48 | text-align: right; 49 | white-space: nowrap; 50 | } 51 | 52 | @media only screen and (max-device-width: 480px) { 53 | .RepositoryItem-description-details { 54 | text-align: center; 55 | } 56 | } -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 11 | 12 | 13 | 22 | React App 23 | 24 | 25 | 28 |
29 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /src/registerServiceWorker.js: -------------------------------------------------------------------------------- 1 | // In production, we register a service worker to serve assets from local cache. 2 | 3 | // This lets the app load faster on subsequent visits in production, and gives 4 | // it offline capabilities. However, it also means that developers (and users) 5 | // will only see deployed updates on the "N+1" visit to a page, since previously 6 | // cached resources are updated in the background. 7 | 8 | // To learn more about the benefits of this model, read https://goo.gl/KwvDNy. 9 | // This link also includes instructions on opting out of this behavior. 10 | 11 | const isLocalhost = Boolean( 12 | window.location.hostname === 'localhost' || 13 | // [::1] is the IPv6 localhost address. 14 | window.location.hostname === '[::1]' || 15 | // 127.0.0.1/8 is considered localhost for IPv4. 16 | window.location.hostname.match( 17 | /^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/ 18 | ) 19 | ); 20 | 21 | export default function register() { 22 | if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) { 23 | // The URL constructor is available in all browsers that support SW. 24 | const publicUrl = new URL(process.env.PUBLIC_URL, window.location); 25 | if (publicUrl.origin !== window.location.origin) { 26 | // Our service worker won't work if PUBLIC_URL is on a different origin 27 | // from what our page is served on. This might happen if a CDN is used to 28 | // serve assets; see https://github.com/facebookincubator/create-react-app/issues/2374 29 | return; 30 | } 31 | 32 | window.addEventListener('load', () => { 33 | const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`; 34 | 35 | if (isLocalhost) { 36 | // This is running on localhost. Lets check if a service worker still exists or not. 37 | checkValidServiceWorker(swUrl); 38 | 39 | // Add some additional logging to localhost, pointing developers to the 40 | // service worker/PWA documentation. 41 | navigator.serviceWorker.ready.then(() => { 42 | console.log( 43 | 'This web app is being served cache-first by a service ' + 44 | 'worker. To learn more, visit https://goo.gl/SC7cgQ' 45 | ); 46 | }); 47 | } else { 48 | // Is not local host. Just register service worker 49 | registerValidSW(swUrl); 50 | } 51 | }); 52 | } 53 | } 54 | 55 | function registerValidSW(swUrl) { 56 | navigator.serviceWorker 57 | .register(swUrl) 58 | .then(registration => { 59 | registration.onupdatefound = () => { 60 | const installingWorker = registration.installing; 61 | installingWorker.onstatechange = () => { 62 | if (installingWorker.state === 'installed') { 63 | if (navigator.serviceWorker.controller) { 64 | // At this point, the old content will have been purged and 65 | // the fresh content will have been added to the cache. 66 | // It's the perfect time to display a "New content is 67 | // available; please refresh." message in your web app. 68 | console.log('New content is available; please refresh.'); 69 | } else { 70 | // At this point, everything has been precached. 71 | // It's the perfect time to display a 72 | // "Content is cached for offline use." message. 73 | console.log('Content is cached for offline use.'); 74 | } 75 | } 76 | }; 77 | }; 78 | }) 79 | .catch(error => { 80 | console.error('Error during service worker registration:', error); 81 | }); 82 | } 83 | 84 | function checkValidServiceWorker(swUrl) { 85 | // Check if the service worker can be found. If it can't reload the page. 86 | fetch(swUrl) 87 | .then(response => { 88 | // Ensure service worker exists, and that we really are getting a JS file. 89 | if ( 90 | response.status === 404 || 91 | response.headers.get('content-type').indexOf('javascript') === -1 92 | ) { 93 | // No service worker found. Probably a different app. Reload the page. 94 | navigator.serviceWorker.ready.then(registration => { 95 | registration.unregister().then(() => { 96 | window.location.reload(); 97 | }); 98 | }); 99 | } else { 100 | // Service worker found. Proceed as normal. 101 | registerValidSW(swUrl); 102 | } 103 | }) 104 | .catch(() => { 105 | console.log( 106 | 'No internet connection found. App is running in offline mode.' 107 | ); 108 | }); 109 | } 110 | 111 | export function unregister() { 112 | if ('serviceWorker' in navigator) { 113 | navigator.serviceWorker.ready.then(registration => { 114 | registration.unregister(); 115 | }); 116 | } 117 | } 118 | --------------------------------------------------------------------------------