Skip to content

Commit 6ddc2da

Browse files
author
Carlos Rufo Jimenez
committed
1-end-getstarted
1 parent 8952532 commit 6ddc2da

27 files changed

+15608
-0
lines changed

.gitignore

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# See https://help.github.com/ignore-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/server/node_modules
6+
7+
# testing
8+
/coverage
9+
10+
# production
11+
/build
12+
13+
# misc
14+
.DS_Store
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*

README.md

Lines changed: 2434 additions & 0 deletions
Large diffs are not rendered by default.

package.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"name": "hackernews-react-apollo",
3+
"version": "0.1.0",
4+
"private": true,
5+
"dependencies": {
6+
"apollo-client-preset": "^1.0.8",
7+
"graphql": "^0.13.1",
8+
"graphql-tag": "^2.8.0",
9+
"react": "^16.2.0",
10+
"react-apollo": "^2.1.0-beta.3",
11+
"react-dom": "^16.2.0",
12+
"react-scripts": "1.1.1"
13+
},
14+
"scripts": {
15+
"start": "react-scripts start",
16+
"build": "react-scripts build",
17+
"test": "react-scripts test --env=jsdom",
18+
"eject": "react-scripts eject"
19+
}
20+
}

public/favicon.ico

3.78 KB
Binary file not shown.

public/index.html

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
6+
<meta name="theme-color" content="#000000">
7+
<!--
8+
manifest.json provides metadata used when your web app is added to the
9+
homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/
10+
-->
11+
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
12+
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
13+
<link rel="stylesheet" href="https://unpkg.com/[email protected]/css/tachyons.min.css"/>
14+
<!--
15+
Notice the use of %PUBLIC_URL% in the tags above.
16+
It will be replaced with the URL of the `public` folder during the build.
17+
Only files inside the `public` folder can be referenced from the HTML.
18+
19+
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
20+
work correctly both with client-side routing and a non-root public URL.
21+
Learn how to configure a non-root public URL by running `npm run build`.
22+
-->
23+
<title>React App</title>
24+
</head>
25+
<body>
26+
<noscript>
27+
You need to enable JavaScript to run this app.
28+
</noscript>
29+
<div id="root"></div>
30+
<!--
31+
This HTML file is a template.
32+
If you open it directly in the browser, you will see an empty page.
33+
34+
You can add webfonts, meta tags, or analytics to this file.
35+
The build step will place the bundled scripts into the <body> tag.
36+
37+
To begin the development, run `npm start` or `yarn start`.
38+
To create a production bundle, use `npm run build` or `yarn build`.
39+
-->
40+
</body>
41+
</html>

public/manifest.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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+
}

server/.graphqlconfig.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
projects:
2+
app:
3+
schemaPath: "src/schema.graphql"
4+
extensions:
5+
endpoints:
6+
default: "http://localhost:4000"
7+
database:
8+
schemaPath: "src/generated/prisma.graphql"
9+
extensions:
10+
prisma: database/prisma.yml

server/database/datamodel.graphql

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
type Vote {
2+
id: ID! @unique
3+
link: Link!
4+
user: User!
5+
}
6+
7+
type Link {
8+
id: ID! @unique
9+
createdAt: DateTime!
10+
description: String!
11+
url: String!
12+
postedBy: User
13+
votes: [Vote!]!
14+
}
15+
16+
type User {
17+
id: ID! @unique
18+
name: String!
19+
email: String! @unique
20+
password: String!
21+
links: [Link!]!
22+
votes: [Vote!]!
23+
}

server/database/prisma.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# the name for the service (will be part of the service's HTTP endpoint)
2+
service: hackernews-graphql-js
3+
4+
# the cluster and stage the service is deployed to
5+
stage: dev
6+
7+
# to disable authentication:
8+
# disableAuth: true
9+
secret: mysecret123
10+
11+
# the file path pointing to your data model
12+
datamodel: datamodel.graphql
13+
14+
cluster: public-denimotter-285/prisma-eu1

server/package.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"name": "hackernews-graphql-js",
3+
"scripts": {
4+
"start": "node src/index.js",
5+
"dev": "npm-run-all --parallel start playground",
6+
"playground": "graphql playground",
7+
"prisma": "prisma"
8+
},
9+
"dependencies": {
10+
"bcryptjs": "^2.4.3",
11+
"graphql-yoga": "1.3.2",
12+
"prisma-binding": "1.5.10"
13+
},
14+
"devDependencies": {
15+
"graphql-cli": "2.14.1",
16+
"npm-run-all": "4.1.2",
17+
"prisma": "1.2.2"
18+
}
19+
}

0 commit comments

Comments
 (0)