<commit_before>Quickstart
==========

Pre-requisites
--------------

Before starting this guide, ensure the following are
installed/configured properly:

 - Git
 - MySQL 5.7
 - Python 2.7

Setting things up
-----------------

First thing's first: clone the Iris repo:

.. code:: sh

    git clone <EMAIL>:linkedin/iris.git

Let's take a quick look through the source code.
 - ``ops`` - examples of deployment options with Docker, Kubernetes, etc
 - ``db`` - schema and dummy data for testing
 - ``test`` - end-to-end tests and unit tests
 - ``src/iris`` - the main source code directory
     - ``bin`` - various daemons. The biggest one to note here is ``sender.py``, which handles Iris's message sending
     - ``api.py`` - Main REST API code
     - ``ui`` - Frontend JS, CSS, and static assets. Also contains authentication modules for the FE, and bundling setup.
     - ``vendors`` - Pluggable modules handling message sending for various contact modes. Leveraged by the Iris sender.

Set up a virtual env, install dependencies, and set up development
environment.

.. code:: sh

    virtualenv venv
    source venv/bin/activate
    sudo apt-get install libssl-dev libxml2-dev libxslt1-dev libsasl2-dev python-dev libldap2-dev
    pip install -e '.[dev,kazoo]

Configuring the database
------------------------

Out of the box, Iris expects the database to be set up with username
``root`` and no password. This isn't very secure, so let's create an
``iris`` user. Log in as root, and add the new user. We'll also need to
turn off the ``ONLY_FULL_GROUP_BY`` MySQL mode.

.. code:: sql

    CREATE USER ‘iris’@’localhost’ IDENTIFIED BY ‘iris’
    CREATE DATABASE iris
    GRANT ALL ON iris.* TO iris@localhost
    SET GLOBAL sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));

Now let’s load the schema and some dummy data. Navigate to project root,
then run:

.. code:: sh

    mysql -u iris -p < ./db/schema_0.sql
    mysql -u iris -p -o iris < ./db/dummy_data.sql

dummy\_data.sql contains the following entities: - user demo with
password <PASSWORD> - team demo\_team - application Autoalerts with key:
a7a9d7657ac8837cd7dfed0b93f4b8b864007724d7fa21422c24f4ff0adb2e49

Confirm that this is successful:

::<commit_msg>Missing a single quotation in `pip install` cmd<commit_after>Quickstart
==========

Pre-requisites
--------------

Before starting this guide, ensure the following are
installed/configured properly:

 - Git
 - MySQL 5.7
 - Python 2.7

Setting things up
-----------------

First thing's first: clone the Iris repo:

.. code:: sh

    git clone <EMAIL>:linkedin/iris.git

Let's take a quick look through the source code.
 - ``ops`` - examples of deployment options with Docker, Kubernetes, etc
 - ``db`` - schema and dummy data for testing
 - ``test`` - end-to-end tests and unit tests
 - ``src/iris`` - the main source code directory
     - ``bin`` - various daemons. The biggest one to note here is ``sender.py``, which handles Iris's message sending
     - ``api.py`` - Main REST API code
     - ``ui`` - Frontend JS, CSS, and static assets. Also contains authentication modules for the FE, and bundling setup.
     - ``vendors`` - Pluggable modules handling message sending for various contact modes. Leveraged by the Iris sender.

Set up a virtual env, install dependencies, and set up development
environment.

.. code:: sh

    virtualenv venv
    source venv/bin/activate
    sudo apt-get install libssl-dev libxml2-dev libxslt1-dev libsasl2-dev python-dev libldap2-dev
    pip install -e '.[dev,kazoo]'

Configuring the database
------------------------

Out of the box, Iris expects the database to be set up with username
``root`` and no password. This isn't very secure, so let's create an
``iris`` user. Log in as root, and add the new user. We'll also need to
turn off the ``ONLY_FULL_GROUP_BY`` MySQL mode.

.. code:: sql

    CREATE USER ‘iris’@’localhost’ IDENTIFIED BY ‘iris’
    CREATE DATABASE iris
    GRANT ALL ON iris.* TO iris@localhost
    SET GLOBAL sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));

Now let’s load the schema and some dummy data. Navigate to project root,
then run:

.. code:: sh

    mysql -u iris -p < ./db/schema_0.sql
    mysql -u iris -p -o iris < ./db/dummy_data.sql

dummy\_data.sql contains the following entities: - user demo with
password <PASSWORD> - team demo\_team - application Autoalerts with key:
a7a9d7657ac8837cd7dfed0b93f4b8b864007724d7fa21422c24f4ff0adb2e49

Confirm that this is successful:

::
{'fraction_non_alphanumeric': 0.11964483906770255, 'fraction_numerical': 0.020865704772475027, 'mean_word_length': 3.1799628942486087, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '89730', 'n_tokens_mistral': 1464, 'n_tokens_neox': 1373, 'n_words': 557}