You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 9, 2024. It is now read-only.
Copy file name to clipboardExpand all lines: charting/README.md
+20-2Lines changed: 20 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@
9
9
</h2>
10
10
</div>
11
11
12
-
<h3align="center"><ahref="https://slash.dgraph.io/_/one-click?app=charting"target="_blank">Deploy Now</a> for free!</h3>
12
+
<h3align="center"><ahref="https://dgraph.io/docs/learn/developer/todo-app-tutorial/todo-deploy/"target="_blank">Deploy Now</a> for free!</h3>
13
13
14
14
Charts is a sample app that lets users build online charts using metrics that they provide. For example, you could provide this app with data from an e-commerce site and use it to track site statistics such as the number of page views and revenue. This app demonstrates how to use React hooks with Apollo client to add and read related data. Deploying this app on Slash GraphQL deploys both the back-end database service and a front-end React app in a single click, no credit card required. To learn more about this sample app, see the [Charting Sample App on GitHub](https://github.com/dgraph-io/graphql-sample-apps/tree/master/charting).
15
15
@@ -27,9 +27,27 @@ Charts is a sample app that lets users build online charts using metrics that th
27
27
### Back-end
28
28
-[Slash GraphQL](https://dgraph.io/slash-graphql)—a fully managed GraphQL backend service
29
29
30
+
## Getting started
31
+
32
+
### No-Auth Version
33
+
34
+
1. Copy the entire contents of the `schema.graphql` file located in the root folder of the application.
35
+
2. Open your `Graphql Client`, you can check some GraphQL clients [here](https://dgraph.io/docs/graphql/quick-start/#testing-your-graphql-api) or open a `terminal` and run the following command: `curl -X POST localhost:8080/admin/schema --data-binary <@SCHEMA.GRAPHQL>`, which contains the code copied in step 1.
36
+
4. To run the application locally go to the `src` folder and find the `apollo-client.js` file and replace `uri: process.env.REACT_APP_GRAPHQL_ENDPOINT || "<API-ENDPOINT>"` by `uri: process.env.REACT_APP_GRAPHQL_ENDPOINT || "http://localhost:8080/graphql"`.
37
+
3. In the root folder of the application, open a terminal and run the following commands: `npm install` followed by `npm start`.
38
+
39
+
### Auth Version
40
+
41
+
1. Create an authentication service account on: [Auth0](https://auth0.com/).
42
+
2. After creating your Auth0 account, follow the instructions provided [here](https://dgraph.io/docs/learn/developer/todo-app-tutorial/todo-auth0-jwt/) to set up Auth0 authentication.
43
+
3. Open the `schema.graphql` file located in the root folder and apply the `rules` as described in step 2.
44
+
4. Then open your `Graphql Client`, you can check some GraphQL clients [here](https://dgraph.io/docs/graphql/quick-start/#testing-your-graphql-api) or open a ` terminal ` and run the following command: `curl -X POST localhost:8080/admin/schema --data-binary <@SCHEMA.GRAPHQL>`.
45
+
5. To run the application locally go to the `src` folder and find the `apollo-client.js` file and replace `uri: process.env.REACT_APP_GRAPHQL_ENDPOINT || "<API-ENDPOINT>"` by `uri: process.env.REACT_APP_GRAPHQL_ENDPOINT || "http://localhost:8080/graphql"`.
46
+
6. In the root folder of the application, open a terminal and run the following commands: `npm install` followed by `npm start`.
0 commit comments