Skip to content
This repository was archived by the owner on Oct 9, 2024. It is now read-only.

Commit 2593172

Browse files
authored
Merge pull request #247 from dgraph-io/marcelo/fix-charting-app
Chore(fix): Update Readme and added section Getting Started.
2 parents abbac5d + f8feee5 commit 2593172

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

charting/README.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
</h2>
1010
</div>
1111

12-
<h3 align="center"><a href="https://slash.dgraph.io/_/one-click?app=charting" target="_blank">Deploy Now</a> for free!</h3>
12+
<h3 align="center"><a href="https://dgraph.io/docs/learn/developer/todo-app-tutorial/todo-deploy/" target="_blank">Deploy Now</a> for free!</h3>
1313

1414
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).
1515

@@ -27,9 +27,27 @@ Charts is a sample app that lets users build online charts using metrics that th
2727
### Back-end
2828
- [Slash GraphQL](https://dgraph.io/slash-graphql)—a fully managed GraphQL backend service
2929

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`.
47+
3048

3149
### Links
32-
- [Deploy Now](https://slash.dgraph.io/_/one-click?app=charting)
50+
- [Deploy Now](https://dgraph.io/docs/learn/developer/todo-app-tutorial/todo-deploy/)
3351
- [Community Support](https://discuss.dgraph.io/)
3452

3553
### Screenshots

0 commit comments

Comments
 (0)