vegantech/sims

View on GitHub
README.md

Summary

Maintainability
Test Coverage
SIMS-  Student Intervention Monitoring System<a name="top"></a>
====
### Track Student Interventions. ###
[![Build Status](https://travis-ci.org/vegantech/sims.png?branch=master)](https://travis-ci.org/vegantech/sims)
[![Dependency Status](https://gemnasium.com/vegantech/sims.png)](https://gemnasium.com/vegantech/sims)
[![Code Climate](https://codeclimate.com/github/vegantech/sims.png)](https://codeclimate.com/github/vegantech/sims)
[![Coverage Status](https://coveralls.io/repos/vegantech/sims/badge.png?branch=master)](https://coveralls.io/r/vegantech/sims)

See deployment for information on how to deploy. This will be centrally hosted, but you're welcome to set up your own instance and help contribute code.

- [Overview](#overview)
    - [Notes](#notes)
- [Prerequisites](#prerequisites)
- [Installation](#installation)
- [Deploying without production](#production)
- [Deploying](#deploying)

<a name="notes"></a>Notes:

- Examples follow for installing SIMS on debian-based Linux. Be sure to use appropriate package manager and adjust all paths to match your platform `(/ to \)`

- Some of the icons come from the [Silk icon set](http://www.famfamfam.com/lab/icons/silk/).

<a name="prerequisites"></a>
## Prerequisites ##
Before you can use SIMS you need to install and configure the following dependencies on your machine:

- [curl](http://curl.haxx.se)

            sudo apt-get install curl
- [Ruby Version Manager](https://rvm.io) with Rails: See [their installation guide](https://rvm.io/rvm/install) for installing with curl.
- [Git](http://git-scm.com): The [Github Guide to Installing Git](https://help.github.com/articles/set-up-git) is a good source of information.
- MySQL server, client, adapter, and other libraries:

            sudo apt-get install build-essential openssl libreadline6 libreadline6-dev \
               git-core zlib1g zlib1g-dev libssl-dev libyaml-dev mysql mysqld \
               libmysqlclient-devlibxml2-dev mysql-server libxslt-dev autoconf libc6-dev \
               ncurses-dev automake libtool bison  subversion pkg-config
            gem install activerecord-mysql-adapter

<a name="installation"></a>
## Installation ##
Basics for installing SIMS locally (without the tests, which don't work on Windows yet)

    git clone git://github.com/vegantech/sims.git
    cd sims

Make sure you're running version 1.9.3 of Ruby and run [bundle](http://bundler.io/):

    rvm install ruby-1.9.3-p484
    source ~/.rvm/scripts/rvm
    bundle

Copy the `config/database.yml.sqlite3` to `config/database.yml`

    cp config/database.yml.mysql config/database.yml    

Be sure to set the domain name of the SIMS application in the `config/initializers/host_info.rb` file to send the proper links in emails generated by the application.

    bundle exec rake db:setup
    bundle exec rails runner CreateTrainingDistrict.generate_one
    bundle exec rails s

Then point your browser to `http://localhost:3000` to see that SIMS is up and running.

NOTE: When running locally it will be required to connect through `http://lvh.me:3000` for proper cookie authentication

<a name="production"></a>
## Production Deployment ##
Once you have it setup for development and have Apache setup:

    sudo gem install passenger
    sudo passenger-install-apache2-module

Modify the apache config files following the onscreen directions.    


From your development directory:
Adjust your mail and server settings in the config/deploy/other.rb

    sudo gem install capistrano capistrano-ext
    cap other deploy:cold


NOTE: You might need to setup the database.yml on the server
   
If the deploy cold fails, run:

    RAILS_ENV=production bundle exec rake db:migrate db:fixtures:load
    bundle execscript/runner -e production CreateTrainingDistrict.generate_one
    cap other deploy:restart

<a name="deploying"></a>
## Deploying ##

We're using the multi-stage deployment functionality of the excellent
`capistrano-ext` gem to allow you to separately deploy to your staging
and production server. If you don't already have this gem installed,
please do so by running `sudo gem install capistrano-ext`.

Use `cap staging deploy` to deploy to staging and `cap production
deploy` to update production code.

[back to top](#top)