Skip to content
lucienhetu edited this page Nov 24, 2020 · 46 revisions

GETTING STARTED

O V E R V I E W

  • Back-end: rethinkDB (realtime database JSON-based)
  • Middle-tier: node.js + Horizon (expose a websocket API to front-end application)
  • Front-end: Javascript + HTML

R E Q U I R E M E N T S

D E P L O Y. T H E. C O M P O N E N T S.

Ubuntu

**(optionally - if you are planning on installing in virtual machine, I recommend VMware Workstation Player)

Install OS : https://ubuntu.com/download/server

Install rethinkDB : https://rethinkdb.com/docs/install/ubuntu/

Install node.js : https://github.com/nodesource/distributions/blob/master/README.md#debinstall

Install Horizon : sudo npm install -g horizon

**(optionally - if you are planning on running over a port under 1024, like 80 or 443, run "sudo setcap cap_net_bind_service=+ep readlink -f \which node``")

Copy files : download the files of a version directory from https://github.com/lucienhetu/my-mind?files=1 to your local system

Start the server : "cd" to the folder where the files were downloaded, then run "hz serve"

Windows

Install node.js : If you are here, you know how.

Install RethinkDB: Download the installation package for Windows (an non-official of 2.4 is available at https://github.com/srh/rethinkdb/releases/download/v2.4.0-srh-win-1/rethinkdb-v2.4.0-srh-win-1-Release_x64.zip), go through all the questions of the wizard. Once the installation is complete, move rethinkdb.exe under c:\Windows.

Install Horizon using node.js

  • Open a command line and run "npm install -g horizon"

Testing everything is working

  • Create a folder: c:\path_to_your_project_directory
  • Create a basic horizon project
    • open a command line
    • cd to the folder hosting the folder previously created (cd c:\path_to_your_project)
    • deploy a basic project
      • run "hz init _directory", _directory being the folder previously created
  • Start the server
    • open a command line
    • cd to the folder hosting the folder previously created (cd c:\path_to_your_project)
    • run "hz serve _directory --dev" (note: some instructions will appear)

-Open a browser and navigate to http://127.0.0.1/8181, a scrolling message will/should appear.

everything is working? Well celebrate, then delete everything under _directory, copy all files from https://github.com/lucienhetu/my-mind?files=1 to _directory, run "hz serve _directory", the browse and navigate to http://127.0.0.1:8181/?id=nodes

Configure Authentication (v0.5 and later)

Run services in the background

BD

  • Follow the instructions here

Web

  • Add the following to /etc/rc.local

#!/bin/bash

/sbin/runuser insertUserNameHere -s /bin/bash -c "hz serve /home/insertUserNameHere"

exit 0

  • Run sudo chmod +x /etc/rc.local

==========

Debug notes

Symptom: page never stop loading

Diagnostic:

Solution:

  • stop hz process
  • run rethinkdb
  • run hz serve --start-rethinkdb no

==========

REFERENCES

Note to self: add instruction for OSes other than windows - https://rethinkdb.com/docs/install/, ...)