<commit_before># Dilia - Game Editor for Renaissance

Dilia is a dedicated game editor for the Renaissance project. The editor can
be used for your own project, you'll probably want to fork it to adapt it to your needs.

This editor is designed to be used by multiple users with different backgrounds.
One of the long term goals is to facilitate the integration of the creation or modification
of quests, monsters, scripts, maps and skins that are then "automatically" integrated
in the game.

Dilia is made of two part: a `node.js` server and a web client.
In order to work properly, the server has a few requirements:

* Some packages:
  * **[required]** `mongodb`
* Some environment variables:
  * **[required]** `NODE_ENV` set to `production`.
  * **[optional]** `GOOGLE_SECRET` and `GOOGLE_CLIENTID` API token in order to allow google oauth
  * **[optional]** `GITHUB_SECRET` and `GITHUB_CLIENTID` API token in order to allow github oauth

## Development

First you need to install node and npm. You should install them via
[nvm](https://github.com/creationix/nvm).
Then you run:

```bash
export NODE_ENV=development
npm install
```

You start the server with:

```bash
npm run build-server && npm run server
```

To start the client:

```bash
npm start
```

### Vagrant

This repository also includes a **Vagrantfile** for easy set up and quick development.
It will setup `nvm`, `node`, `npm`, performs a build of the server and the client and also
install `mongo-express` and `node-inspector` which are usefull for debugging.
With vagrant, simply run:

```bash
vagrant up
```

Within the vm (`vagrant ssh`), then you do:

```bash
cd /vagrant
export NODE_ENV='development' && npm run server
```

And navigate to http://localhost:3000/.

### Text editor setup<commit_msg>How to create an account with curl<commit_after># Dilia - Game Editor for Renaissance

Dilia is a dedicated game editor for the Renaissance project. The editor can
be used for your own project, you'll probably want to fork it to adapt it to your needs.

This editor is designed to be used by multiple users with different backgrounds.
One of the long term goals is to facilitate the integration of the creation or modification
of quests, monsters, scripts, maps and skins that are then "automatically" integrated
in the game.

Dilia is made of two part: a `node.js` server and a web client.
In order to work properly, the server has a few requirements:

* Some packages:
  * **[required]** `mongodb`
* Some environment variables:
  * **[required]** `NODE_ENV` set to `production`.
  * **[optional]** `GOOGLE_SECRET` and `GOOGLE_CLIENTID` API token in order to allow google oauth
  * **[optional]** `GITHUB_SECRET` and `GITHUB_CLIENTID` API token in order to allow github oauth

## Development

First you need to install node and npm. You should install them via
[nvm](https://github.com/creationix/nvm).
Then you run:

```bash
export NODE_ENV=development
npm install
```

You start the server with:

```bash
npm run build-server && npm run server
```

To start the client:

```bash
npm start
```

Note that, as for now, the project does not contain any fixture and if you do
not use any external authentication provider (Google or Github), you cannot use
the Dilia UI to create an account to connect with. Therefore, you have to create
an user by sending a POST request directly to the Dilia server.

```bash
curl -H "Content-Type: application/json"      \
     -X POST                                  \
     -d '{"username": "test","password": "<PASSWORD>", "email": "<EMAIL>"}' \
     http://localhost:3000/api/users
```

The server response —in case of success— is `OK`.

### Vagrant

This repository also includes a **Vagrantfile** for easy set up and quick development.
It will setup `nvm`, `node`, `npm`, performs a build of the server and the client and also
install `mongo-express` and `node-inspector` which are usefull for debugging.
With vagrant, simply run:

```bash
vagrant up
```

Within the vm (`vagrant ssh`), then you do:

```bash
cd /vagrant
export NODE_ENV='development' && npm run server
```

And navigate to http://localhost:3000/.

### Text editor setup
{'fraction_non_alphanumeric': 0.09561657032755298, 'fraction_numerical': 0.002890173410404624, 'mean_word_length': 4.19125, 'pattern_counts': {'":': 3, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5461613', 'n_tokens_mistral': 1272, 'n_tokens_neox': 1174, 'n_words': 590}