<commit_before># VK Group Stats

Service for a collecting of a [VK](http://vk.com/) groups stats.

## Technologies

* ECMAScript 2015;
* back-end:
    * Node.js;
    * Express;
    * MongoDB;
* front-end:
    * Redux;
    * React;
    * Material-UI.

## Features

* back-end:
    * authentication:
        * an authentication via [VK](http://vk.com/);
        * support of a skipping of an authentication;
    * users:
        * data:
            * MongoDB ObjectId;
            * [VK](http://vk.com/) ID;
        * operations:
            * getting of a current user;
            * automatically addition on an authentication;
        * support of a fake user on a skipping of an authentication;
    * groups:
        * data:
            * MongoDB ObjectId;
            * user ObjectId;
            * [VK](http://vk.com/) screen name;
        * operations (for a current user):
            * getting of all;
            * addition of one;
            * deletion of one;
    * counters:
        * data:
            * MongoDB ObjectId;
            * group ObjectId;
            * addition timestamp;
            * group members counter;
        * operations (for a specified group):
            * getting of all in a descending order;
            * getting of all in a descending order beginning with a specified timestamp;
            * addition of one (automatically via [VK](http://vk.com/) API);
            * deletion of all;
    * automatically addition of counters via [VK](http://vk.com/) API for all added groups by schedule;
* front-end:
    * design:
        * adaptive;
        * material;
    * group list:
        * displays:
            * groups;
        * states:
            * fetching;
            * success;
            * failure;
        * for every group:
            * displays:
                * [VK](http://vk.com/) screen name;
                * counters for a last day;
            * states:
                * fetching;
                * success;
                * failure;
            * for every counter:
                * displays:
                    * timestamp;
                    * number of subscribers;
                    * delta compared to a previous;
    * add group dialog.

## Usage

In a development:

```
$ npm start
```

In a production:

```
$ npm server-up
```

Environment variables:

* `NODE_ENV` &mdash; the current environment (allowed: `production`);
* `VK_GROUP_STATS_SERVER_PORT` &mdash; the server port (default: 4000);
* `VK_GROUP_STATS_MONGODB_HOST` &mdash; the MongoDB host (default: `localhost`);
* `VK_GROUP_STATS_MONGODB_DATABASE` &mdash; the MongoDB database (default: `vk-group-stats`);
* `VK_GROUP_STATS_MONGODB_PORT` &mdash; the MongoDB port (default: 27017);
* `VK_GROUP_STATS_SESSION_SECURE` &mdash; use secure sessions (`TRUE` to an use);
* `VK_GROUP_STATS_SESSION_SECRET` &mdash; the sessions secret (default: a random UUID v4);<commit_msg>Describe an installation<commit_after># VK Group Stats

Service for a collecting of a [VK](http://vk.com/) groups stats.

## Technologies

* ECMAScript 2015;
* back-end:
    * Node.js;
    * Express;
    * MongoDB;
* front-end:
    * Redux;
    * React;
    * Material-UI.

## Features

* back-end:
    * authentication:
        * an authentication via [VK](http://vk.com/);
        * support of a skipping of an authentication;
    * users:
        * data:
            * MongoDB ObjectId;
            * [VK](http://vk.com/) ID;
        * operations:
            * getting of a current user;
            * automatically addition on an authentication;
        * support of a fake user on a skipping of an authentication;
    * groups:
        * data:
            * MongoDB ObjectId;
            * user ObjectId;
            * [VK](http://vk.com/) screen name;
        * operations (for a current user):
            * getting of all;
            * addition of one;
            * deletion of one;
    * counters:
        * data:
            * MongoDB ObjectId;
            * group ObjectId;
            * addition timestamp;
            * group members counter;
        * operations (for a specified group):
            * getting of all in a descending order;
            * getting of all in a descending order beginning with a specified timestamp;
            * addition of one (automatically via [VK](http://vk.com/) API);
            * deletion of all;
    * automatically addition of counters via [VK](http://vk.com/) API for all added groups by schedule;
* front-end:
    * design:
        * adaptive;
        * material;
    * group list:
        * displays:
            * groups;
        * states:
            * fetching;
            * success;
            * failure;
        * for every group:
            * displays:
                * [VK](http://vk.com/) screen name;
                * counters for a last day;
            * states:
                * fetching;
                * success;
                * failure;
            * for every counter:
                * displays:
                    * timestamp;
                    * number of subscribers;
                    * delta compared to a previous;
    * add group dialog.

## Installation

Install Node.js v6+: https://nodejs.org/en/download/package-manager/

Install MongoDB Community Edition v3.4+: https://docs.mongodb.com/manual/installation/

Clone this repository:

```
$ git clone https://github.com/thewizardplusplus/vk-group-stats.git
$ cd vk-group-stats
```

Install dependencies:

```
$ npm run install-all
```

Build the project:

```
$ npm run build
```

Create the [VK](http://vk.com/) website app: https://vk.com/dev/first_guide?f=2.%20Application%20registration

Its authorized redirect URI must be in the format: `http://<host>[:<port>]/authentication/vk/callback`.

## Usage

```
$ npm run serve
```

Environment variables:

* `NODE_ENV` &mdash; the current environment (allowed: `production`);
* `VK_GROUP_STATS_SERVER_PORT` &mdash; the server port (default: 4000);
* `VK_GROUP_STATS_MONGODB_HOST` &mdash; the MongoDB host (default: `localhost`);
* `VK_GROUP_STATS_MONGODB_DATABASE` &mdash; the MongoDB database (default: `vk-group-stats`);
* `VK_GROUP_STATS_MONGODB_PORT` &mdash; the MongoDB port (default: 27017);
* `VK_GROUP_STATS_SESSION_SECURE` &mdash; use secure sessions (`TRUE` to an use);
* `VK_GROUP_STATS_SESSION_SECRET` &mdash; the sessions secret (default: a random UUID v4);
{'fraction_non_alphanumeric': 0.11128526645768025, 'fraction_numerical': 0.005642633228840125, 'mean_word_length': 1.9915611814345993, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3124899', 'n_tokens_mistral': 1960, 'n_tokens_neox': 1833, 'n_words': 556}