Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 6eee6a7
Showing
24 changed files
with
7,752 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/node_modules | ||
/public |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"root": true, | ||
"extends": ["airbnb", "prettier"], | ||
"env": { | ||
"browser": true | ||
}, | ||
"globals": { | ||
"graphql": true, | ||
"$": true, | ||
"it": true | ||
}, | ||
"settings": { | ||
"import/core-modules": ["apollo-link-http", "apollo-client", "apollo-cache-inmemory"] | ||
}, | ||
"rules": { | ||
"jsx-a11y/anchor-is-valid": [ | ||
"error", | ||
{ | ||
"components": ["Link"], | ||
"specialLink": ["to"], | ||
"aspects": ["noHref", "invalidHref", "preferButton"] | ||
} | ||
], | ||
"react/jsx-filename-extension": 0, | ||
"react/prop-types": 0, | ||
"react/no-danger": 0, | ||
"class-methods-use-this": 0, | ||
"react/prefer-stateless-function": 0, | ||
"jsx-a11y/no-redundant-roles": 0 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# See https://help.github.com/ignore-files/ for more about ignoring files. | ||
|
||
# dependencies | ||
/node_modules | ||
|
||
# testing | ||
/coverage | ||
|
||
# production | ||
/build | ||
|
||
# misc | ||
.DS_Store | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
|
||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"printWidth": 80, | ||
"singleQuote": true, | ||
"trailingComma": "all" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2018 Parminder Klair | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of | ||
this software and associated documentation files (the "Software"), to deal in | ||
the Software without restriction, including without limitation the rights to | ||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of | ||
the Software, and to permit persons to whom the Software is furnished to do so, | ||
subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS | ||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR | ||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER | ||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# Kickoff React | ||
|
||
> An boilerplate for frontend apps using ReactJs with batteries included. | ||
|
||
[DEMO](http://kickoff-react.surge.sh/) | ||
|
||
## Requirements | ||
```bash | ||
- [Node](https://nodejs.org) 4.x or better | ||
``` | ||
|
||
## Stack | ||
```bash | ||
- [React](http://facebook.github.io/react) | ||
- [create-react-app](https://github.com/facebook/create-react-app | ||
``` | ||
## Installation | ||
Close this repository locally by: | ||
```sh | ||
git clone https://github.com/perminder-klair/kickoff-react.git app | ||
``` | ||
Start by installing dependencies: | ||
```sh | ||
yarn install | ||
``` | ||
## Running | ||
Once dependencies are installed, run with: | ||
```sh | ||
yarn start | ||
``` | ||
## Configuration | ||
Configuration file is located at `./utils/config.js` | ||
## Build | ||
To build for production | ||
```sh | ||
yarn run build | ||
``` | ||
## Tests | ||
Running jest tests | ||
```sh | ||
yarn run test | ||
``` | ||
To write tests follow: [http://facebook.github.io/jest/docs/api.html](http://facebook.github.io/jest/docs/api.html) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[build] | ||
publish = "build" | ||
command = "npm run build" | ||
[build.environment] | ||
YARN_VERSION = "1.3.2" | ||
YARN_FLAGS = "--no-ignore-optional" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"name": "kickoff-react", | ||
"version": "0.1.0", | ||
"private": true, | ||
"scripts": { | ||
"start": "react-scripts start", | ||
"build": "react-scripts build", | ||
"test": "react-scripts test --env=jsdom", | ||
"eject": "react-scripts eject" | ||
}, | ||
"dependencies": { | ||
"apollo-client-preset": "^1.0.8", | ||
"graphql": "^0.13.0", | ||
"graphql-tag": "^2.7.3", | ||
"react": "^16.2.0", | ||
"react-apollo": "^2.0.4", | ||
"react-dom": "^16.2.0", | ||
"react-helmet": "^5.2.0", | ||
"react-router-dom": "^4.2.2", | ||
"react-scripts": "1.1.1", | ||
"styled-components": "^3.1.6" | ||
}, | ||
"devDependencies": { | ||
"eslint": "^4.17.0", | ||
"eslint-config-airbnb": "^16.1.0", | ||
"eslint-config-prettier": "^2.9.0", | ||
"eslint-plugin-import": "^2.8.0", | ||
"eslint-plugin-jsx-a11y": "^6.0.3", | ||
"eslint-plugin-prettier": "^2.6.0", | ||
"eslint-plugin-react": "^7.6.1", | ||
"prettier-eslint-cli": "^4.7.0" | ||
} | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<meta name="theme-color" content="#000000"> | ||
<!-- | ||
manifest.json provides metadata used when your web app is added to the | ||
homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/ | ||
--> | ||
<link rel="manifest" href="%PUBLIC_URL%/manifest.json"> | ||
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico"> | ||
<!-- | ||
Notice the use of %PUBLIC_URL% in the tags above. | ||
It will be replaced with the URL of the `public` folder during the build. | ||
Only files inside the `public` folder can be referenced from the HTML. | ||
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will | ||
work correctly both with client-side routing and a non-root public URL. | ||
Learn how to configure a non-root public URL by running `npm run build`. | ||
--> | ||
<title>React App</title> | ||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.6.2/css/bulma.min.css" /> | ||
</head> | ||
<body> | ||
<noscript> | ||
You need to enable JavaScript to run this app. | ||
</noscript> | ||
<div id="root"></div> | ||
<!-- | ||
This HTML file is a template. | ||
If you open it directly in the browser, you will see an empty page. | ||
You can add webfonts, meta tags, or analytics to this file. | ||
The build step will place the bundled scripts into the <body> tag. | ||
To begin the development, run `npm start` or `yarn start`. | ||
To create a production bundle, use `npm run build` or `yarn build`. | ||
--> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"short_name": "React App", | ||
"name": "Create React App Sample", | ||
"icons": [ | ||
{ | ||
"src": "favicon.ico", | ||
"sizes": "64x64 32x32 24x24 16x16", | ||
"type": "image/x-icon" | ||
} | ||
], | ||
"start_url": "./index.html", | ||
"display": "standalone", | ||
"theme_color": "#000000", | ||
"background_color": "#ffffff" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import React from 'react'; | ||
import { Link } from 'react-router-dom'; | ||
|
||
import config from '../utils/config'; | ||
|
||
export default () => ( | ||
<nav className="navbar is-transparent" role="navigation" aria-label="dropdown navigation"> | ||
<Link className="navbar-item" to="/"> | ||
{config.siteName} | ||
</Link> | ||
<Link className="navbar-item" to="/">Home</Link> | ||
<Link className="navbar-item" to="/about">About</Link> | ||
<Link className="navbar-item" to="/contact">Contact</Link> | ||
<Link className="navbar-item" to="/cars">Cars</Link> | ||
</nav> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import React from 'react'; | ||
import Helmet from 'react-helmet'; | ||
|
||
import Header from './Header'; | ||
import config from '../utils/config'; | ||
|
||
export default ({ children}) => ( | ||
<div className="container"> | ||
<Helmet title={config.siteName} /> | ||
<Header /> | ||
{children} | ||
</div> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
body { | ||
margin: 0; | ||
padding: 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import { BrowserRouter as Router, Route } from 'react-router-dom'; | ||
import { ApolloProvider } from 'react-apollo'; | ||
import { ThemeProvider } from 'styled-components'; | ||
|
||
import './index.css'; | ||
import theme from './utils/theme'; | ||
import apolloClient from './utils/apolloClient'; | ||
import registerServiceWorker from './utils/registerServiceWorker'; | ||
|
||
import Layout from './components/Layout'; | ||
import Home from './pages/Home'; | ||
import About from './pages/About'; | ||
import Contact from './pages/Contact'; | ||
import Cars from './pages/Cars'; | ||
|
||
const App = () => ( | ||
<ApolloProvider client={apolloClient}> | ||
<ThemeProvider theme={theme}> | ||
<Router> | ||
<Layout> | ||
<Route exact path="/" component={Home} /> | ||
<Route path="/about" component={About} /> | ||
<Route path="/contact" component={Contact} /> | ||
<Route path="/cars" component={Cars} /> | ||
</Layout> | ||
</Router> | ||
</ThemeProvider> | ||
</ApolloProvider> | ||
); | ||
|
||
ReactDOM.render(<App />, document.getElementById('root')); | ||
registerServiceWorker(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import React from 'react'; | ||
import Helmet from 'react-helmet'; | ||
|
||
export default () => ( | ||
<section className="section"> | ||
<Helmet title="About" /> | ||
<div className="container"> | ||
<h1 className="title"> | ||
I am about page | ||
</h1> | ||
</div> | ||
</section> | ||
); |
Oops, something went wrong.