<commit_before>## Welcome to dctrl app.

Start by cloning this repo. In the new folder do:
- `npm install`

This will start the dev server
- `npm run dev`

The admin-server depends on:
- rethinkdb: https://rethinkdb.com/docs/install/
- bitcoind: https://bitcoin.org/en/bitcoin-core/

You must create a new file in the root of the directory, and call it `configuration.js`. You need to specify the following information in the file (**WARNING:** The information in the file is sensitive. Manage it accordingly):
```
module.exports = {
    rethinkLocation: "localhost",
    secret: "copay wallet seed random words secret very...",
    bitcoindClient: {
        host: 'localhost',
        port: 8332,
        user: 'whoyou',
        pass: '<PASSWORD>'
    },
    bitcoinAverage: {
        pub: "3232...",
        secret: "HSDH..."
    }
}
```

``
Once the above are started run
- `npm run serve`

When running the server exposes an api defined in the file `./adminSrc/router.js`.

For example to charge a member manually for dress code infractions:
```
const request = require('superagent')
request
    .post('<ip-of-dctrladmin>:8003/member_charge')
    .send({
        memberId: '19116730-8b8d-11e7-8171-1518d628ef09',
        amount: 10,
        notes: 'dress code #15.3'
    })
    .end((err, res)=>{
        if (err) return console.log({err})
        console.log(res.body)
    })
```
<commit_msg>Corrected file extension to API, plus other minor details<commit_after>## Welcome to dctrl app.

Start by cloning this repo. In the new folder do:
- `npm install`

Once npm is installed, you can start the dev server by running the following:
- `npm run dev`

The admin-server depends on:
- rethinkdb: https://rethinkdb.com/docs/install/
- bitcoind: https://bitcoin.org/en/bitcoin-core/

You must create a new file in the root of the directory, and call it `configuration.js`. You need to specify the following information in the file (**WARNING:** The information in the file is sensitive. Manage it accordingly):
```
module.exports = {
    rethinkLocation: "localhost",
    secret: "copay wallet seed random words secret very...",
    bitcoindClient: {
        host: 'localhost',
        port: 8332,
        user: 'whoyou',
        pass: '<PASSWORD>'
    },
    bitcoinAverage: {
        pub: "3232...",
        secret: "HSDH..."
    }
}
```

`
Once the above are started, run the following command:
- `npm run serve`

When running, the server exposes an api defined in the file `./adminSrc/router/EventApi.js`.

For example to charge a member manually for dress code infractions:
```
const request = require('superagent')
request
    .post('<ip-of-dctrladmin>:8003/member_charge')
    .send({
        memberId: '19116730-8b8d-11e7-8171-1518d628ef09',
        amount: 10,
        notes: 'dress code #15.3'
    })
    .end((err, res)=>{
        if (err) return console.log({err})
        console.log(res.body)
    })
```

{'fraction_non_alphanumeric': 0.12611377655928718, 'fraction_numerical': 0.029472241261137764, 'mean_word_length': 2.9286675639300133, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 4, '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': '582564', 'n_tokens_mistral': 970, 'n_tokens_neox': 897, 'n_words': 317}