


This is a Node.js implementation of the RFI: Precursors server.
Before you get started, you'll need to make sure that you have the server's dependencies installed:
npm installNext, you have a few options for how to run the server...
Before starting, you'll need docker and docker-compose installed.
The first time you set up your Docker containers, you'll need to initialize the database. To do this, bring up the
rethinkdb service, run scripts/initdb.sh, and stop the rethinkdb service:
docker-compose up -d rethinkdb
scripts/initdb.js --rethinkdb.host=$(docker inspect -f '{{.NetworkSettings.IPAddress}}' rfiserver_rethinkdb_1)
# If using `fish`: scripts/initdb.js --rethinkdb.host=(docker inspect -f '{{.NetworkSettings.IPAddress}}' rfiserver_rethinkdb_1)
docker-compose stop rethinkdbFinally, bring up all defined services:
docker-compose upNow, the server should be running and listening on port 8008; you can then bring up and connect any client.
First, you will need to either install RethinkDB on your system, or use the rethinkdb Docker image.
To install RethinkDB on your system, follow the instructions for your platform.
To use the Docker image, first install docker. Then, run the following command to create and start a new RethinkDB container:
docker run --name rfi-rethinkdb -v $PWD:/data -p 28015:28015 -d rethinkdb
# If using `fish`: docker run --name rfi-rethinkdb -v (pwd):/data -p 28015:28015 -d rethinkdbFrom now on, you can use docker ps to check on your container, docker stop rfi-rethinkdb to stop the running
container, and docker start rfi-rethinkdb to start it again. To connect to your RethinkDB instance's administration
UI, use the following command:
$BROWSER http://$(docker inspect -f '{{.NetworkSettings.IPAddress}}' rfi-rethinkdb):8080
# If using `fish`: eval $BROWSER http://(docker inspect -f '{{.NetworkSettings.IPAddress}}' rfi-rethinkdb):8080Once you have an accesible RethinkDB instance, create the tables in the database, and populate them with test data:
node ./scripts/initdb.jsNote: If you don't want the development accounts, pass the --production option.
Use npm to start the server:
npm startOr, alternatively, start the server directly:
node server.jsStarting the server directly allows you to override configuration options on the command line; see
node server.js --help for more information.
To run the unit tests, simple run:
npm testAll tests should pass.