Deploying a GRANDstack application to Aura
In this page, we will learn how to build and deploy a GRANDstack application with Neo4j Aura.
We should have created and started a Neo4j Aura database instance. If we have not already, we can follow the instructions in the getting started guide to step through the process. We should also be familiar with the GRANDstack.
Now that we’ve created our Neo4j Aura database, we’re going to learn how to deploy a GRANDstack application that queries data stored in that database.
We’re going to use the Neo4j Cloud Tool to import our data, so let’s see how to set up that application.
We can install that directly via this link, or if that doesn’t work we can paste the following URL into the
Graph App URL field on the Graph Applications menu:
Once we do that we’ll see the following prompt:
We can now launch the Neo4j Cloud Tool, which will take us to the following screen:
We’re going to use the Neo4j Cloud tool to import this dataset.
Click on the
Check existing database button.
This will check whether our Aura database contains existing data.
Assuming an empty database, we’ll see the following screen:
Clicking on the
Next button will take us to the following screen:
From here we can import databases or a dump file. We’ll be using the latter functionality to import a dump containing the football transfers database.
The dump file can be downloaded from aura-datasets.s3.amazonaws.com/football-transfers.dump.
Once we’ve downloaded that file we’ll select it as the dump file to import.
After that we’ll click on the
Import Dump file button.
This will take a few minutes to run, but eventually we’ll see output similar to the following:
Click on the
View data in Neo4j Browser button to see what we’ve imported.
The diagram below shows a sample of the imported graph:
Let’s have a look at the GRANDstack application that we’re going to deploy. The application is a football transfers one built on top of the graph that we imported in the previous step. See Football Transfers Graph App with the GRANDstack Starter Kit to learn more about the application itself.
The following command will clone the football transfers project locally:
git clone firstname.lastname@example.org:mneedham/football-transfers-app.git cd football-transfers-app
The application has two parts:
API - this code powers a GraphQL API on top of our Neo4j database, and lives in the
UI - the
uidirectory contains a React application that renders data extracted from the GraphQL API.
The diagram below shows the architecture of our application and how it interacts with Neo4j:
We’re going to deploy the application using ZEIT, a cloud platform for websites and serverless APIS.
First we’ll need to create an account on that platform via zeit.co/signup.
Once we’ve done that we can install the Now CLI on our machine using instructions from zeit.co/download:
npm i -g now
Now let’s login to ZEIT using the Now CLI tool:
If we run that, we’ll see the following output:
> Enter your email: email@example.com > We sent an email to xxx. Please follow the steps provided inside it and make sure the security code matches xxx.
Once we’ve entered our credentials we’ll receive an email which will contain a link that we need to click to verify that we want to login. The console will then be updated with the following message:
✔ Email confirmed > Congratulations! You are now logged in. In order to deploy something, run `now`.
Now we’re ready to tell ZEIT about our database credentials. We’ll need to provide the following details:
If we open our Neo4j Aura Console Dashboard, we’ll see a list of our databases.
We’ll need to use the Bolt URL, so let’s copy that onto our clipboard:
The default username is
neo4j and the default password is generated on database creation.
For the database described above we’d have the following credentials:
Bolt URL -
We can run the following commands to add these credentials as ZEIT secrets.
Don’t forget to change the credentials below to match those of your own Aura database. Copy and pasting the credentials below won’t work as that database has long since been destroyed!
now secret add NEO4J_URI bolt+routing://648d934e.databases.neo4j.io now secret add NEO4J_USER neo4j now secret add NEO4J_PASSWORD 9UvUS6UnVAnr7_ziNaKg--e7ekd-5x4AEL7yseEFsl8
We’re now ready to deploy our application, which we can do by executing the following command:
Running this command will result in the following output:
> Deploying ~/projects/football-transfers-app under mneedham > Using project grand-stack-starter > Synced 21 files [652ms] > Upload [====================] 99% 0.0s> NOTE: This is the first deployment in the grand-stack-starter project. It will be promoted to production. > NOTE: To deploy to production in the future, run `now --prod`. > https://grand-stack-starter-ou2l4008p.now.sh [4s] > Ready! Deployment complete [2m] - https://grand-stack-starter-seven-wheat.now.sh - https://grand-stack-starter.mneedham.now.sh [in clipboard]
We can then navigate to the provided URL, which in this case is
Once this page has loaded, we’ll see a list of the top transfers:
We can navigate to other screens via the left menu:
My favourite one is
Country Money Flow, so let’s have a look at that:
Was this page helpful?