Deity Falcon Configuration

First ensure that you have installed NodeJS and PM2 as per here

Creating a new Falcon install

Change to your VHost directory, in this example we use example.com that is part of the example domain-group:

cd /microcloud/domains/example/domains/example.com/

Run npx to create the app in a directory called ___falcon

npx create-falcon-app ___falcon

Frontend app configuration

Edit ___falcon/client/config/default.json and change the uri value to point to the URL hosting your graphql server.

"apolloClient": {
  "httpLink": {
    "uri": "https://example.com/graphql"
  }
},

Start the client:

cd /microcloud/domains/example/domains/example.com/___falcon/client
pm2 start --name=deityclient npm -- run start:prod

GraphQL server configruation

Edit ___falcon/server/config/default.json :-

  • Set the following api-magento2 values:
    • Host - The hostname of your Magento store
    • Protocol - Should be set to HTTPS - your Magento site should have a valid SSL certificate
    • Username - Username of the Falcon admin user on your Magento store
    • Password - Password of the Falcon admin user on your Magento store
  • Set the endpoints -> magento -> config -> host to your Magento hostname

Start the API server:

cd /microcloud/domains/example/domains/example.com/___falcon/server
pm2 start --name=deityserver npm -- run start:prod

Save PM2 configuration

Typing pm2 save will remember the processes that have been started and restart them in the event of an unexpected reboot.

Nginx/VHost configuration (Magento hosted on another domain/VHost)

# Deity Falcon GraphSQL Server
location ~* ^/graphql(/.*|$) {
  include sites-config/magestack-headers.conf;
  proxy_pass https://acc1.i:4000;
}

# Passthrough for all other Requests to NodeJS
location ~* ^/ {
  include sites-config/magestack-headers.conf;
  proxy_pass https://acc1.i:3000;
}

After implementing one of the above rulesets, you should ensure you test and reload the nginx configuration.