Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/prashant-shahi/referral-app
Referral app using GraphQL server written in node(express) and REST API server python(flask)
https://github.com/prashant-shahi/referral-app
dgraph express-js flask graphql graphql-server nodejs python3 rest-api
Last synced: 19 days ago
JSON representation
Referral app using GraphQL server written in node(express) and REST API server python(flask)
- Host: GitHub
- URL: https://github.com/prashant-shahi/referral-app
- Owner: prashant-shahi
- License: apache-2.0
- Created: 2019-06-08T12:47:11.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-05-01T20:57:34.000Z (over 1 year ago)
- Last Synced: 2024-10-04T16:41:25.813Z (3 months ago)
- Topics: dgraph, express-js, flask, graphql, graphql-server, nodejs, python3, rest-api
- Language: Python
- Homepage:
- Size: 365 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Referral App
This project is an application with a **GraphQL Server**(Node/Express) which provides *mutation* and *query* functions that calls **REST API Server**(Python/Flask) which fetches data stored in the **Dgraph** Graph Database.### GraphQL Server
GraphQL Server is a Node.js application which is mainly consists of `express` and `express-graphql` library packages. This server is used for the functions to define *mutations* and *queries*. These functions makes use of APIs provided by the REST API server with the function parameters often passed as payload. These functions also takes in a query consisting of various fields which makes it possible for clients to obtain only the request data.### REST API Server
REST API Server is a Flask(Python) application which provides APIs for GraphQL Server. This server uses Dgraph Graph Database for storing data. These APIs performs CRUD Operations with Dgraph and return back data. Using GraphQL alongside with Dgraph makes it a lot easier for everyone, since the Schema remain very identical for GraphQL and Dgraph.## Quick start
There are multiple ways to get this project started. Easiest would be to use [Docker Compose](https://docs.docker.com/compose/). Follow the instructions below:
```sh
git clone https://github.com/coolboi567/referral-appcd referral-app
docker-compose up -d
```Alternatively, for skipping the image building time, you can use different docker-compose file which pulls in the built images of this project from [Docker Hub](https://hub.docker.com/u/coolboi567).
```
docker-compose -f docker-compose-no-build.yaml up -d
```Now, load the schema and sample data into Dgraph using the API end point created for the same.
```sh
curl -XGET http://localhost:5000/setup
```Go to `http://localhost:4000/graphql` to access the GraphiQL
```
open http://localhost:4000/graphql
```You can also use Ratel(Dgraph UI for mutation/query/schema alteration) available at `http://localhost:8000` to view and modify data/schema in Dgraph.
## Screenshots
Query and Result in GraphiQL:
Query and Result in Ratel(Dgraph):