Skip to content

Commit 863e1f5

Browse files
author
Sebastian Iglesias
committed
chore(): Initial commit
1 parent a66a12b commit 863e1f5

File tree

11 files changed

+335
-99
lines changed

11 files changed

+335
-99
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,5 @@ yarn-debug.log*
2323
yarn-error.log*
2424

2525
.idea/
26+
27+
server/

README.md

Lines changed: 8 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,11 @@
1-
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
1+
## Howtographql react + apollo hackernews site
22

3-
## Available Scripts
43

5-
In the project directory, you can run:
4+
The following commands download and deploy a nodejs server for this client
65

7-
### `yarn start`
8-
9-
Runs the app in the development mode.<br />
10-
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
11-
12-
The page will reload if you make edits.<br />
13-
You will also see any lint errors in the console.
14-
15-
### `yarn test`
16-
17-
Launches the test runner in the interactive watch mode.<br />
18-
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
19-
20-
### `yarn build`
21-
22-
Builds the app for production to the `build` folder.<br />
23-
It correctly bundles React in production mode and optimizes the build for the best performance.
24-
25-
The build is minified and the filenames include the hashes.<br />
26-
Your app is ready to be deployed!
27-
28-
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
29-
30-
### `yarn eject`
31-
32-
**Note: this is a one-way operation. Once you `eject`, you can’t go back!**
33-
34-
If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
35-
36-
Instead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
37-
38-
You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
39-
40-
## Learn More
41-
42-
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
43-
44-
To learn React, check out the [React documentation](https://reactjs.org/).
45-
46-
### Code Splitting
47-
48-
This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting
49-
50-
### Analyzing the Bundle Size
51-
52-
This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size
53-
54-
### Making a Progressive Web App
55-
56-
This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app
57-
58-
### Advanced Configuration
59-
60-
This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration
61-
62-
### Deployment
63-
64-
This section has moved here: https://facebook.github.io/create-react-app/docs/deployment
65-
66-
### `yarn build` fails to minify
67-
68-
This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify
6+
```bash
7+
curl https://codeload.github.com/howtographql/react-apollo/tar.gz/starter | tar -xz --strip=1 react-apollo-starter/server
8+
cd server
9+
yarn install
10+
yarn prisma deploy
11+
```

package.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,15 @@
33
"version": "0.1.0",
44
"private": true,
55
"dependencies": {
6+
"apollo-boost": "^0.4.4",
7+
"graphql": "^14.5.8",
68
"react": "^16.11.0",
9+
"react-apollo": "^3.1.3",
710
"react-dom": "^16.11.0",
8-
"react-scripts": "3.2.0"
11+
"react-scripts": "3.2.0",
12+
"apollo-client": "latest",
13+
"apollo-link-http": "latest",
14+
"apollo-cache-inmemory": "latest"
915
},
1016
"scripts": {
1117
"start": "react-scripts start",

public/index.html

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,10 @@
99
name="description"
1010
content="Web site created using create-react-app"
1111
/>
12+
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
13+
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
14+
<link rel="stylesheet" href="https://unpkg.com/tachyons@4.2.1/css/tachyons.min.css"/>
1215
<link rel="apple-touch-icon" href="logo192.png" />
13-
<!--
14-
manifest.json provides metadata used when your web app is installed on a
15-
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
16-
-->
17-
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
1816
<!--
1917
Notice the use of %PUBLIC_URL% in the tags above.
2018
It will be replaced with the URL of the `public` folder during the build.

src/App.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22
import ReactDOM from 'react-dom';
3-
import App from './App';
3+
import App from './components/App';
44

55
it('renders without crashing', () => {
66
const div = document.createElement('div');

src/App.js renamed to src/components/App.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
2-
import logo from './logo.svg';
3-
import './App.css';
2+
import logo from '../logo.svg';
3+
import '../styles/App.css';
44

55
function App() {
66
return (

src/index.css

Lines changed: 0 additions & 13 deletions
This file was deleted.

src/index.js

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,28 @@
1-
import React from 'react';
2-
import ReactDOM from 'react-dom';
3-
import './index.css';
4-
import App from './App';
1+
import React from 'react'
2+
import ReactDOM from 'react-dom'
3+
import './styles/index.css'
4+
import App from './components/App'
55
import * as serviceWorker from './serviceWorker';
66

7-
ReactDOM.render(<App />, document.getElementById('root'));
7+
// importing the required dependencies from the installed packages
8+
import { ApolloProvider } from 'react-apollo'
9+
import { ApolloClient } from 'apollo-client'
10+
import { createHttpLink } from 'apollo-link-http'
11+
import { InMemoryCache } from 'apollo-cache-inmemory'
812

9-
// If you want your app to work offline and load faster, you can change
10-
// unregister() to register() below. Note this comes with some pitfalls.
11-
// Learn more about service workers: https://bit.ly/CRA-PWA
12-
serviceWorker.unregister();
13+
const httpLink = createHttpLink({
14+
uri: 'http://localhost:4000'
15+
});
16+
17+
const client = new ApolloClient({
18+
link: httpLink,
19+
cache: new InMemoryCache()
20+
});
21+
22+
ReactDOM.render(
23+
<ApolloProvider client={client}>
24+
<App />
25+
</ApolloProvider>,
26+
document.getElementById('root')
27+
);
28+
serviceWorker.unregister();
File renamed without changes.

src/styles/index.css

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
body {
2+
margin: 0;
3+
padding: 0;
4+
font-family: Verdana, Geneva, sans-serif;
5+
}
6+
7+
input {
8+
max-width: 500px;
9+
}
10+
11+
.gray {
12+
color: #828282;
13+
}
14+
15+
.orange {
16+
background-color: #ff6600;
17+
}
18+
19+
.background-gray {
20+
background-color: rgb(246,246,239);
21+
}
22+
23+
.f11 {
24+
font-size: 11px;
25+
}
26+
27+
.w85 {
28+
width: 85%;
29+
}
30+
31+
.button {
32+
font-family: monospace;
33+
font-size: 10pt;
34+
color: black;
35+
background-color: buttonface;
36+
text-align: center;
37+
padding: 2px 6px 3px;
38+
border-width: 2px;
39+
border-style: outset;
40+
border-color: buttonface;
41+
cursor: pointer;
42+
max-width: 250px;
43+
}

0 commit comments

Comments
 (0)