<commit_before>CRM 2000
========

Installation
------------

The application requires a running MongoDB server.

### Setting up a local MongoDB server

A MongoDB distribution can be downloaded from the [official page](http://www.mongodb.org/downloads).

To set up a single server instance you must create the default database directory:

    mkdir -p /data/db

and run a database process:

    bin/mongod


### Configuring Mongoid

Default configuration is created by a generator:

    rails generate mongoid:config

### Starting GruntJS

  Go to /lib/fronted/

  npm install
  bower install
  grunt server

Generating assets to /public

  Go to /lib/fronted/

  grunt build --force

### Start Application
bundle install
cp application.yml.example application.yml

### SMS GATEWAY SETUP

application.yml:

    PROMOSMS_LOGIN: email
    PROMOSMS_PASSWORD: password
    PROMOSMS_URL: https://panel.promosms.pl

    APPLICATION_TOKEN: token # allows sending smsemesssems using API

### API

#### esemeseseses

    request:
        methods: POST
        url    : /api/sms_notifications
        json   :
            application_token: ENV['APPLICATION_TOKEN']
            to               : list of receipients
            message          : message<commit_msg>update documentation<commit_after>CRM 2000
========

Installation
------------

The application requires a running MongoDB server.

### Setting up a local MongoDB server

A MongoDB distribution can be downloaded from the [official page](http://www.mongodb.org/downloads).

To set up a single server instance you must create the default database directory:

    mkdir -p /data/db

and run a database process:

    bin/mongod


### Configuring Mongoid

Default configuration is created by a generator:

    rails generate mongoid:config

### Starting GruntJS

  Go to /lib/fronted/

  npm install
  bower install
  grunt server

Generating assets to /public

  Go to /lib/fronted/

  grunt build --force

### Start Application
bundle install
cp application.yml.example application.yml

### SMS GATEWAY SETUP

application.yml:

    PROMOSMS_LOGIN: email
    PROMOSMS_PASSWORD: password
    PROMOSMS_URL: https://panel.promosms.pl

    APPLICATION_TOKEN: token # allows sending smsemesssems using API

### API

#### esemeseseses

    request:
        methods: POST
        url  : /api/sms_notifications
        json :
            application_token: ENV['APPLICATION_TOKEN']
            sms_notification:
                to      : array <phone-number>
                message : message
{'fraction_non_alphanumeric': 0.08201892744479496, 'fraction_numerical': 0.0031545741324921135, 'mean_word_length': 2.7809239940387482, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5462958', 'n_tokens_mistral': 770, 'n_tokens_neox': 705, 'n_words': 244}