cd refocus.git checkout -b <your branch name> masternpm install. This downloads and installs project dependencies and executes the post-install steps. Note: don’t run this with sudo! You may get some weird errors later.brew install Caskroom/cask/lunchy). This will help you start redis.lunchy start redis to start redis.npm start to start your Node.js server at http://localhost:3000.ENABLE_CLOCK_PROCESS set to true.npm run start-clock to start the clock process.ENABLE_WORKER_PROCESS set to true.npm run start-worker to start the worker process.heroku local to start the web, clock and worker processes all together. Make sure that the ENABLE_CLOCK_PROCESS and ENABLE_WORKER_PROCESS environment variables are set to true. Note that the node server will be listening on port 5000 when you start it using the heroku local command.Whenever you pull down a new version of Refocus from the git repository:
npm update to make sure you have all the latest dependencies.npm start to start your Node.js server at http://localhost:3000.If not already setup, follow Installation instructions to setup Refocus. Execute the following commands to setup production environment and corresponding config variables:
export NODE_ENV=production
export DATABASE_URL='postgres://postgres:postgres@localhost:5432/focusdb'
npm start
TODO
On node server startup, two redis clients are instantiated:
The publisher is called by the sequelize ORM when a subject or sample is inserted/updated/deleted. It publishes a serialized object keyed by the record type (i.e. subject or sample) and containing the object which was inserted/updated/deleted.
The subscriber parses the message string into an object then uses socket.io to broadcast the changes out to any connected browser clients.
After installing the server, you can run redis-cli to issue commands to redis server. Command to show active channels is: PUBSUB CHANNELS *