- Clone this repository.
yarn install
.- Copy the contents of
.env.local.example
into a new file called.env.local
.
If you're setting up your database on your localhost or on a machine on your local network, you must ensure there is a secure tunnel established into your DB server:port in order for the Firebase cloud functions (to be setup later) are able to access the DB. See the ngrok project for a way to achieve this.
Alternatively, you can install the DB on a publicly visible machine such as a cloud server. Either way, you must either configure your firewall rules or set up a secure tunnel in order to allow FB cloud functions (and your dev server) to directly access the database.
- Install ArangoDB and the RecallGraph extension by following the instructions here.
- Fill in the database access point, credentials and the RecallGraph service mount point in the
.env.local
file at the root of this project.
Run the scripts in the db-setup
folder using the command below. These are idempotent scripts and is safe to execute them multiple times. In case of a partial or incomplete setup from a prior run, these scripts will pick up where they left the last time. It effectively behaves like a sync operation.
node db-setup
- Create a project at the Firebase console.
- Get your account credentials from the Firebase console at Project settings > Service accounts, where you can click on Generate new private key and download the credentials as a json file. It will contain keys such as
project_id
,client_email
andclient_id
. Set them as environment variables in the.env.local
file at the root of this project. - Go to Develop, click on Authentication and in the Sign-in method tab enable authentication for the app.
- In the
.firebaserc
file at the root of this project, update the project ID for thedefault
key.
- Install the Firebase CLI tool:
npm install -g firebase-tools
firebase login
.- Configure environment variables for cloud functions:
firebase functions:config:set arango.host=<db host> # Make sure this host is publicly accessible.
firebase functions:config:set arango.port=<db port> # Make sure this port is publicly open.
firebase functions:config:set arango.db=<db name>
firebase functions:config:set arango.user=<db user>
firebase functions:config:set arango.password=<db password>
firebase functions:config:set arango.svc.mount=<recallgraph mount point>
- Inside the
functions
directory at the root of the project:npm install
. Note that this needs a specific version of node to run. Use nvm to manage multiple node versions on your system. - Deploy cloud functions:
firebase deploy --only functions
Your installation is now complete!