All Projects â†’ GraphQL-Portal â†’ Graphql Portal

GraphQL-Portal / Graphql Portal

Licence: mit
Configurable and distributed GraphQL Gateway. Convert your legacy data sources or monitor your existing GraphQL Services with a visual dashboard.

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Graphql Portal

Graphql Inspector
ðŸ•ĩïļâ€â™€ïļ Validate schema, get schema change notifications, validate operations, find breaking changes, look for similar types, schema coverage
Stars: ✭ 1,059 (+1103.41%)
Mutual labels:  api, graphql
Best Of Web Python
🏆 A ranked list of awesome python libraries for web development. Updated weekly.
Stars: ✭ 1,118 (+1170.45%)
Mutual labels:  api, graphql
Rest Layer
REST Layer, Go (golang) REST API framework
Stars: ✭ 1,068 (+1113.64%)
Mutual labels:  api, graphql
Graphql Music
ðŸŽļA workshop in building a GraphQL API
Stars: ✭ 33 (-62.5%)
Mutual labels:  api, graphql
Graphql Microservices
Showcasing a graphql microservice setup
Stars: ✭ 68 (-22.73%)
Mutual labels:  api, graphql
Graphql Lodash
🛠 Data manipulation for GraphQL queries with lodash syntax
Stars: ✭ 1,003 (+1039.77%)
Mutual labels:  api, graphql
Up
Up focuses on deploying "vanilla" HTTP servers so there's nothing new to learn, just develop with your favorite existing frameworks such as Express, Koa, Django, Golang net/http or others.
Stars: ✭ 8,439 (+9489.77%)
Mutual labels:  api, graphql
Hoppscotch
ðŸ‘― Open source API development ecosystem https://hoppscotch.io
Stars: ✭ 34,569 (+39182.95%)
Mutual labels:  api, graphql
Graphql Server
This is the core package for using GraphQL in a custom server easily
Stars: ✭ 65 (-26.14%)
Mutual labels:  api, graphql
Android Okgraphql
Reactive GraphQl client for Android
Stars: ✭ 64 (-27.27%)
Mutual labels:  api, graphql
Ariadne
Ariadne is a Python library for implementing GraphQL servers using schema-first approach.
Stars: ✭ 1,274 (+1347.73%)
Mutual labels:  api, graphql
Purescript Graphql
End to End typesafe GraphQL with PureScript
Stars: ✭ 79 (-10.23%)
Mutual labels:  api, graphql
Nextjs Graphql Sample
A simple app to demonstrate basic API functions built with REST and GraphQL
Stars: ✭ 29 (-67.05%)
Mutual labels:  api, graphql
Omdb Graphql Wrapper
🚀 GraphQL wrapper for the OMDb API
Stars: ✭ 45 (-48.86%)
Mutual labels:  api, graphql
Django Graph Api
Pythonic implementation of the GraphQL specification for the Django Web Framework.
Stars: ✭ 29 (-67.05%)
Mutual labels:  api, graphql
Wertik Js
💊 A library that powers your app with GraphQL + Rest API
Stars: ✭ 56 (-36.36%)
Mutual labels:  api, graphql
Api Example
WIP: Just sample app with API
Stars: ✭ 12 (-86.36%)
Mutual labels:  api, graphql
Osrs.me
A comprehensive dataset for OldSchool Runescape.
Stars: ✭ 13 (-85.23%)
Mutual labels:  api, graphql
Gravitee Gateway
Gravitee.io - API Management - OpenSource API Gateway
Stars: ✭ 1,123 (+1176.14%)
Mutual labels:  api, gateway
Requent
A GraphQL like interface to map a request to eloquent query with data transformation for Laravel.
Stars: ✭ 78 (-11.36%)
Mutual labels:  api, graphql

GraphQL Portal Gateway

GraphQL Portal

npm version Test FOSSA Status code style: prettier from Paris with Love

Converge all your data sources into One Graph with a configurable, distributed and open source GraphQL Gateway.

Motivation

The GraphQL Community and Ecosystem are growing rapidly, and the goal of GraphQL Portal is to bring an API Gateway that is native to GraphQL. It is designed to be a simple and universal GraphQL Gateway for those who must mix legacy services with new ones exposing GraphQL APIs, but also for those who already have GraphQL APIs and want to have a light gateway that will bring more control and visibility to their APIs.

It is open source by choice, relies on existing open source tools by design, is extendable, scalable and configurable. It can either be installed on-premises, or be used as a SaaS Gateway (coming soon).

Key facts and features:

  • it is open source but is also available in a SaaS version (coming soon)
  • written in TypeScript
  • based on GraphQL Mesh and supports most of its input handlers
  • provides its own data connectors in addition to those by Mesh
  • is distributed and can easily be scaled
  • can be configured via YAML/JSON files or via the interactive web-dashboard
  • has built-in monitoring and analytics
  • is extendable with custom middlewares.

Table of contents

How it works

GraphQL Portal consists of two major components:

  • Gateway – can be launched as 1 or more instances in 1 or more servers/containers/pods;
  • Dashboard – a backend (NestJS) and frontend (React) application that connects with Gateway nodes and works as a configuration interface for Gateways.

We plan on adding a GraphQL Registry in the future.

In a full-power mode, GraphQL Portal will require two more components: Redis and MongoDB.

Once installed and configured, the Gateway allows you to:

  • connect to multiple sources of data, including existing GraphQL services, REST or gRPC APIs, databases, etc;
  • combine these data sources into universal graphs and serve them from different endpoints;
  • apply schema transformations if necessary, cache data;
  • protect your APIs with authentication keys;
  • gather metrics and analytics;
  • configure custom notifications via webhooks (coming soon).

Quick Start

TL;DR? The quickest way to launch GraphQL Portal (with Gateway and Dashboard) locally, is to use our Docker Compose file:

git clone [email protected]:graphql-portal/graphql-portal-docker.git
cd graphql-portal-docker

docker-compose -f docker-compose.yml up

This will launch the Gateway, Dashboard, as well as Redis and MongoDB.

Where to go from here? We would suggest creating some APIs and playing with the data connectors. Read more about that here.

Installation

Prerequisites

Unless installed via docker compose, you will need:

  • Redis – required by Gateway and Dashboard
  • MongoDB - required by Dashboard only

Docker Compose

Check out our dedicated repository with docker compose files and examples of the configuration:

git clone [email protected]:graphql-portal/graphql-portal-docker.git
cd graphql-portal-docker

docker-compose -f docker-compose.yml up

Standalone Docker containers

Install and launch the Gateway:

docker pull gqlportal/gateway:latest

Now that you have Docker image locally, you will need to prepare a basic configuration file. You may download a sample config:

curl -s -o ./gateway.yaml https://raw.githubusercontent.com/graphql-portal/graphql-portal-docker/main/basic.gateway.yaml

Once that is done, you can now launch the Gateway in a standalone mode (you may have to specify a Redis connection string relevant to your local environment):

docker run --name graphql-gateway \
  -p 3000:3000 \
  -e REDIS="redis://localhost:6379" \
  -v $(pwd)/gateway.yaml:/opt/graphql-portal/config/gateway.yaml \
  gqlportal/gateway:latest

Install and launch Dashboard:

docker pull gqlportal/dashboard:latest

# Modify the connection strings depending on your environment
docker run --name graphql-dashboard \
  -e REDIS_CONNECTION_STRING="redis://localhost:6379" \
  -e MONGODB_CONNECTION_STRING="mongodb://localhost:27017" \
  -e DASHBOARD_PORT=3030 \
  -e NODE_ENV=production \
  -p 3030:3030 \
  gqlportal/dashboard:latest

You now should be able to open the configuration dashboard by going to http://localhost:3030 in your browser.

Standalone Gateway with Yarn/NPM

The Gateway can also be installed either via npm/yarn, or by pulling this repository and then building the source codes.

The package @graphql-portal/gateway provides a CLI command graphql-portal which will start the server. However, in order for the server to start correctly, we should first create (or download) a configuration file. By default, GraphQL Portal will search for a configuration in ./config/gateway.json|yaml file. That's why, prior to launching the gateway, you may want to create a directory and place a config file into it. You can use a basic configuration file from our examples repository here.

# create directories for configuration
mkdir -p /opt/graphql-portal/config && cd /opt/graphql-portal

# download a basic configuration file
curl -s -o ./config/gateway.yaml https://raw.githubusercontent.com/graphql-portal/graphql-portal-docker/main/basic.gateway.yaml

Now that the configuration is in place, we can install and launch the gateway:

# install the gateway and go to the directory with configuration
yarn global add @graphql-portal/gateway

# @graphql-portal/gateway package provides a CLI command graphql-portal
# we will also need a Redis connection string in order to launch the gateway
env REDIS="redis://localhost:6379" NODE_ENV=production graphql-portal

You should now see the output of the server without any errors. Read more about the configuration of the gateway here.

Standalone Dashboard without Docker

At the moment, GraphQL Portal Dashboard consists from the following components:

  • Backend (NestJS)
  • Frontend (React),

and requires the following dependencies:

  • MongoDB
  • connection to Redis – same Redis used by Gateway.

It is not distributed via Yarn/NPM and can be installed locally by pulling and building the source code from the repository:

mkdir /opt/graphql-portal-dashboard
git clone https://github.com/graphql-portal/graphql-portal-dashboard /opt/graphql-portal-dashboard

cd /opt/graphql-portal-dashboard

# the following two steps can take some time
yarn install --frozen-lockfile
yarn build

We'll have to edit the configuration file before launching the server. To do that, open the configuration file for production environment:

vim packages/backend/config/env/production.json
{
  "application": {
    "env": "production",
    "useSwaggerUi": false,
    "port": "@@DASHBOARD_PORT",
    "host": "@@HOST",
    "graphQL": {
      "playground": false,
      "debug": false
    },
    "logLevel": "log",
    "defaultAdmin": {
      "email": "@@DEFAULT_ADMIN_EMAIL",
      "password": "@@DEFAULT_ADMIN_PASSWORD"
    },
    "sendgrid": {
      "senderEmail": "@@SENDGRID_SENDER_EMAIL",
      "confirmationTemplateId": "@@SENDGRID_CONFIRMATION_TEMPLATE",
      "resetPasswordTemplateId": "@@SENDGRID_RESET_PASSWORD_TEMPLATE",
      "apiKey": "@@SENDGRID_API_KEY"
    },
    "metrics": {
      "enabled": "@@METRICS_ENABLED",
      "chunk": "@@METRICS_CHUNK",
      "delay": "@@METRICS_DELAY"
    },
    "maxmind": {
      "dbPath": "@@MAXMIND_DB_PATH",
      "licenseKey": "@@MAXMIND_LICENSE_KEY",
      "accountId": "@@MAXMIND_ACCOUNT_ID"
    }
  },
  "client": {
    "host": "@@CLIENT_HOST"
  },
  "db": {
    "redis": {
      "connectionString": "@@REDIS_CONNECTION_STRING"
    },
    "mongodb": {
      "connectionString": "@@MONGODB_CONNECTION_STRING"
    }
  }
}

In that file, we have 5 main configuration variables which we have to specify:

  • port – it is a port on which the dashboard application is going to be available.
  • redis:connectionString – self-explicative, connection string for Redis.
  • mongodb:connectionString – connection string for Mongo.
  • defaultAdmin:email – default admin email.
  • defaultAdmin:password – default admin password.

Now, we have two choices: either we can pass these values as environment variables, or we can put them directly in the file. In our current case, we will pass them as environment variables. Read more about the configuration of the Gateway and Dashboard here.

We can now launch the server:

# replace the following values with those relevant to your environment
DASHBOARD_PORT=8080 \
REDIS_CONNECTION_STRING="redis://localhost:6379" \
MONGODB_CONNECTION_STRING="mongodb://localhost:27017" \
DEFAULT_ADMIN_EMAIL="your_email" \
DEFAULT_ADMIN_PASSWORD="your_password" \
NODE_ENV=production yarn start:prod

Once the server is launched, you can open the dashboard by going to http://localhost:8080 and login via admin credentials.

Authentication

If you want enable manual authentication you have to specify these environment varibales:

# replace the following values with those relevant to your sendgrid account and environment
SENDGRID_SENDER_EMAIL="[email protected]" \
SENDGRID_CONFIRMATION_TEMPLATE="your_confirmation_template_id" \
SENDGRID_RESET_PASSWORD_TEMPLATE="your_reset_password_template_id" \
SENDGRID_API_KEY="your_api_key" \
CLIENT_HOST="dashboard_frontend_host" \
HOST="dashboard_backend_host" \

You can use the following variables data in your dynamic templates:

  • Confirmation template: confirmationUrl, firstName;
  • Reset password template: resetPasswordUrl, firstName;

Metrics

  • metrics:enabled – enable metrics recording to mongo; (default = true).
  • metrics:chunk – count of records that will be read per 1 iteration (default = 100).
  • metrics:delay – delay between recording iterations in ms (default = 5000).
If you want to enable geo data in request metrics specify maxmind:dbPath for using local mmdb database file or maxmind:licenseKey and maxmind:accountId for WebServiceClient
  • maxmind:dbPath – path to the binary mmdb database file.
  • maxmind:licenseKey – maxmind license key, used to authorize access to query maxmind web services and download databases.
  • maxmind:accountId – maxmind account id.
METRICS_ENABLED="true" \
METRICS_CHUNK="100" \
METRICS_DELAY="5000" \
MAXMIND_DB_PATH="db_path" \
MAXMIND_LICENSE_KEY="license_key" \
MAXMIND_ACCOUNT_ID="account_id" \

Configuration

Coming soon

Use cases

Coming soon

License compatibility

FOSSA Status

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].