Unless installed via docker compose, you will need:
- Redis – required by Gateway and Dashboard
- MongoDB - required by Dashboard only
Check out our dedicated repository with docker compose files and examples of the configuration:
Install and launch the Gateway:
Now that you have Docker image locally, you will need to prepare a basic configuration file. You may download a sample config:
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):
Install and launch Dashboard:
You now should be able to open the configuration dashboard by going to http://localhost:8080 in your browser.
The Gateway can also be installed either via npm/yarn, or by pulling this repository and then building the source codes.
@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
from our examples repository here.
Now that the configuration is in place, we can install and launch the gateway:
You should now see the output of the server without any errors. Read more about the configuration of the gateway here.
At the moment, GraphQL Portal Dashboard consists from the following components:
- Backend (NestJS)
- Frontend (React),
and requires the following dependencies:
- 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:
We'll have to edit the configuration file before launching the server. To do that, open the configuration file for production environment:
In that file, we have 3 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.
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:
Once the server is launched, you can open the dashboard by going to http://localhost:8080.