<commit_before>[Back to README](../README.md)

## Requirements
 * **Ruby (RVM recommended)**
 * **Node**
 * **NPM**
 * **Bower**

## Project Setup

- Fork this repo, so that you can set it up for a new server.
- Clone the new WikiEduDashboard repo and enter that directory.
- Make sure you are in the "sudo" group.
- Install Ruby 2.1.5 (RVM is recommended)
    - From the WikiEduDashboard directory, run the curl script from [rvm.io](https://rvm.io/)
    - `rvm install ruby-2.1.5`
- Install Node: `apt-get install nodejs npm`

- Install Gems:
    - $ `gem install bundler`
    - $ `bundle install`
    - If some gems fail to install, you may need to install some dependencies, such as: `libmysqlclient-dev libpq-dev libqtwebkit-dev`

- Install NPM modules:
    - $ `npm install`

- Install Bower and Bower modules:
    - $ `sudo npm install bower -g`
    - $ `bower install`

- Add config files:
    - Save `application.example.yml` and `database.example.yml` as `application.yml` and `database.yml`, respectively, in the `config` directory. Fill in your Wikipedia account login details in `application.yml` (for API access). The default settings in `database.yml` will suffice for a development environment.

- Create mysql development and test database:
    - Install mysql-server and start a mysql command line
    - `CREATE DATABASE dashboard DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;`
    - `CREATE DATABASE dashboard_testing DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;`
    - Grant access to these databases to your user.
    - `GRANT ALL ON dashboard.* TO <USER>@localhost identified by <PASSWORD>;`
    - `GRANT ALL ON dashboard_testing.* TO <USER>@localhost identified by <PASSWORD>;`

## Initialize
1. **Start Guard**
      $ `guard`

2. **Migrate the database**
      $ `rake db:migrate`

3. **Create cohorts**
      $ `rake cohort:add_cohorts`

4. **Pull data from sources** (optional; this could take a very long time)
      $ `rake batch:initialize`

**At this point in the process you will likely want to [set up OAuth integration](oauth.md)**<commit_msg>Improve setup documentation for cohorts<commit_after>[Back to README](../README.md)

## Requirements
 * **Ruby (RVM recommended)**
 * **Node**
 * **NPM**
 * **Bower**

## Project Setup

- Fork this repo, so that you can set it up for a new server.
- Clone the new WikiEduDashboard repo and enter that directory.
- Make sure you are in the "sudo" group.
- Install Ruby 2.1.5 (RVM is recommended)
    - From the WikiEduDashboard directory, run the curl script from [rvm.io](https://rvm.io/)
    - `rvm install ruby-2.1.5`
- Install Node: `apt-get install nodejs npm`

- Install Gems:
    - $ `gem install bundler`
    - $ `bundle install`
    - If some gems fail to install, you may need to install some dependencies, such as: `libmysqlclient-dev libpq-dev libqtwebkit-dev`

- Install NPM modules:
    - $ `npm install`

- Install Bower and Bower modules:
    - $ `sudo npm install bower -g`
    - $ `bower install`

- Add config files:
    - Save `application.example.yml` and `database.example.yml` as `application.yml` and `database.yml`, respectively, in the `config` directory. Fill in your Wikipedia account login details in `application.yml` (for API access). The default settings in `database.yml` will suffice for a development environment.

- Create mysql development and test database:
    - Install mysql-server and start a mysql command line
    - `CREATE DATABASE dashboard DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;`
    - `CREATE DATABASE dashboard_testing DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;`
    - Grant access to these databases to your user.
    - `GRANT ALL ON dashboard.* TO <USER>@localhost identified by <PASSWORD>;`
    - `GRANT ALL ON dashboard_testing.* TO <USER>@localhost identified by <PASSWORD>;`

## Initialize
1. **Start Guard**
      $ `guard`

2. **Migrate the database**
      $ `rake db:migrate`
      
## Seed data (optional; this could take a very long time)

1. **Uncomment or add cohort URLs in `application.yml`** 

	`cohort_fall_2014: "Wikipedia:Education_program/Dashboard/Fall_2014_course_ids"`
	`cohort_spring_2015: "Wikipedia:Education_program/Dashboard/course_ids"`

2. **Pull data from sources**

      $ `rake batch:initialize`

## [Set up OAuth integration](oauth.md) (optional)
{'fraction_non_alphanumeric': 0.10770638005945575, 'fraction_numerical': 0.00914703864623828, 'mean_word_length': 3.643312101910828, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5765486', 'n_tokens_mistral': 1407, 'n_tokens_neox': 1315, 'n_words': 512}