<commit_before>eEcology-Annotation-WS
======================

Webservice for eEcology Annotation project.

Start development server
-------------------------

    cp development.ini-dist development.ini
    # adjust database settings
    . env/bin/activate
    pserve development.ini

NGINX develop config
--------------------

Using a hardcoded user.

        location /aws {
                gzip on;
                gzip_types application/json;
                gzip_proxied any;
                auth_basic "Restricted";
                auth_basic_user_file aws.users;
                proxy_set_header REMOTE_USER $remote_user;
                proxy_pass http://127.0.0.1:6565;
        }

The `aws.users` contains user/password combi created with htpasswd.

Apache production config
------------------------

Put WS and UI behind auth and follow instructions at https://services.e-ecology.sara.nl/redmine/projects/uvagps/wiki/Apache_authentication_against_DB .

Deploy ui
---------

The eEcology-Annotation-UI project should be build and deployed as annotation/static/TrackAnnot

Timeout
~~~~~~~

Configure apache to allow for longer request handling by addding to httpd config:

    Timeout 300
    ProxyTimeout 300

Required permissions for user
-----------------------------

0. User needs a eEcology DB account.
1. The user should have `gps_limited` roles.
2. The user should have access to one or more trackers.
3. Then it should work.

Api documentation
-----------------

The api documentation can be found in [apiary.apib](apiary.apib).
Generate html version of api with

    npm install aglio
    aglio -i apiary.apib -o api.html
<commit_msg>Document inclusion of user interface in repo<commit_after>eEcology-Annotation-WS
======================

Webservice for eEcology Annotation project.

Start development server
-------------------------

    cp development.ini-dist development.ini
    # adjust database settings
    . env/bin/activate
    pserve development.ini

NGINX develop config
--------------------

Using a hardcoded user.

        location /aws {
                gzip on;
                gzip_types application/json;
                gzip_proxied any;
                auth_basic "Restricted";
                auth_basic_user_file aws.users;
                proxy_set_header REMOTE_USER $remote_user;
                proxy_pass http://127.0.0.1:6565;
        }

The `aws.users` contains user/password combi created with htpasswd.

Apache production config
------------------------

Put WS and UI behind auth and follow instructions at https://services.e-ecology.sara.nl/redmine/projects/uvagps/wiki/Apache_authentication_against_DB .

User interface
--------------

The web user interface is in the `annotation/static/TrackAnnot` folder.
That folder has compiled/minimized javascript, the source/un-minimized version can be found in the  https://github.com/NLeSC/eEcology-Annotation-UI repository.

The user interface was build using a commercial licens of ExtJS.

Timeouts
--------

The fetch track data from the database can take a while to do. The webserver can timeout, causing the fetching to stopped prematurely.

Configure apache to allow for longer request handling by addding to httpd config:

    Timeout 300
    ProxyTimeout 300

Required permissions for user
-----------------------------

0. User needs a eEcology DB account.
1. The user should have `gps_limited` roles.
2. The user should have access to one or more trackers.
3. Then it should work.

Api documentation
-----------------

The api documentation can be found in [apiary.apib](apiary.apib).
Generate html version of api with

    npm install aglio
    aglio -i apiary.apib -o api.html

{'fraction_non_alphanumeric': 0.13351424694708278, 'fraction_numerical': 0.010854816824966078, 'mean_word_length': 2.2735346358792183, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 3, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '389729', 'n_tokens_mistral': 1041, 'n_tokens_neox': 963, 'n_words': 358}