Peer Group Supervision enables professionals to help each other.
This is the first version, heavy alpha.
-
Fetch all submodules unsed by node server
git submodule update --init
-
Install required gems
bundle install
If you are using rvm, create new gemset to not mess with your default gems
-
Setup configuration files
cp config/redis.yml.example config/redis.yml cp config/database.yml.example config/database.yml cp app-node/config.json.example app-node/config.json
-
Setup Redis
Run redis (download from redis.io/download) - tested on 2.0 and 2.2 stable releases
-
Run node server (download from nodejs.org/#download) - tested on (v0.4.3, v0.4.7-v.0.5.0)
Go to app-node directory directly (this is necessary to load configuraion file using relative path see github.com/joyent/node/issues/1326)
cd app-node && node server.js
Tip: You can also use nvm github.com/creationix/nvm
You can run node as root user (sudo node …) or with ‘authbind` (authbind node …), so socket.io could bind to low port to serve xml policy file for Flash.
-
Run the application
bundle exec rails server
-
Open localhost:3000
As with test database, make sure that you run your tests on separate Redis database, as this will flush you data before tests.
Unfortunately Redis gem uses default url for connection (redis://localhost:6379), so if you don’t provide proper config (or use older gem than from master repository for Redis in case of unix socket), then instead of connecting to test database, your test environment could connect to other database and flush it all.
You have been warned!
-
Install required gems
bundle install
-
Setup database number in config/redis.yml or run separate redis server like this:
redis-server config/redis-test.conf
-
Run Node server instance
REDIS_DB should be number that you specified in config/redis.yml NODE_ENV should be set to test
REDIS_DB=1 NODE_ENV=test node app-node/server.js
Above command can be run as:
rake spec:start_node
Eventually you can connect to separate instace of redis server (if running)
REDIS_DB=1 REDIS_PORT=6380 NODE_ENV=test node app-node/server.js
-
Run tests:
bundle exec rake spec
Note: If you encounter error during requests specs: Selenium::WebDriver::Error::ObsoleteElementError, try to use wait_until method.
Currently, the application is available in 2 languages: English and German. Default locale is set during the application boot, but is's possible to switch to different locale while application is running - just click link with locale name in the header. To add missing translation for non-default locale:
-
import all keys from primary locale file: rake tolk:sync
-
importing non-primary locales: rake tolk:import
-
start application in development mode, open up localhost:3000/tolk
-
find your missing translation by english phrase or key without first part, so if you see: “translation missing for key en, supervisions, show, title”, then you need to search for “supervisions.show.title” key
-
edit, and save, and when ready dump your translations: rake tolk:dump
To change the default locale edit aprropriate line in the environment file config/environments/production.rb or config/environments/development.rb. The line looks like: # I18n.default_locale = :en Other localized files are: * db/default_rules_<locale>.csv * app/views/pages/_about.<locale>.html.haml * app/views/pages/_help.<locale>.html.haml * README / LIESMICH
If you are having problems with compiling sass files, try this:
bundle exec compass compile -e production --force
On production server mysql database is used.
Credentials are stored in non tracked file config/database.yml
If you have problems with installing mysql2 gem, check this: stackoverflow.com/questions/3608287/installing-mysql2-gem-for-rails-3
If you don’t have mysql database at all, you can bundle gems by: bundle install –without production
Node server is managed by init script placed in /etc/init.d/node-peergroup
Deployment is done by Capistrano.
Deployment process:
-
make changes, commit and push to github server
-
from your local machine, type: cap deploy
-
That’s all