Installation

"Local" installation process:

Updated installation process since beta.35:

1 - Create a folder and run npm install reldens, like:

$ mkdir my-game
$ cd my-game
$ npm install reldens 

2 - Create your game-app through the npx command:

$ npx reldens createApp my-game

3 - Run Node / Reldens to get the installation UI

$ node .

Installation process since beta.34:

1 - Git Clone: make sure you have the proper GitHub keys on your current user or just change the method to HTTPS clone to use your GitHub username/password.

$ git clone [email protected]:damian-pastorini/reldens-skeleton.git ./game

2 - Go into the folder and run NPM

$ cd ./game && npm install

Installation process since beta.29:

In beta.29 Reldens include a GUI for the installation process.

IMPORATANT, if you remove the install.lock file from the root folder, and just run:

// linux, gitbash:
$ RELDENS_LOG_LEVEL=9 node .

// windows cmd or powershell:
$ set RELDENS_LOG_LEVEL=9 && node .

You will get a form that will help you to install Reldens.

If you are getting an error like the following:

Is highly likely you missed to give permissions to your DB user, for which you can try:

ALTER USER 'reldens'@'localhost' IDENTIFIED WITH mysql_native_password BY 'reldens';

Or, you need to GRANT your user with native password, for which you can try the following:

create user '<YOUR_USERNAME>'@'localhost' IDENTIFIED WITH 'mysql_native_password' BY '<YOUR_PASSWORD>';

Or this:

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'current password'

    As you can see, you still need to setup the server services requirements prior to use it (for example MySQL or whatever you want to use), but then you won't need to create or edit any file (like the .env or knexfile.js) manually, neither deploy any SQL scripts to get the database tables created.

    Once you click on the "install" button, the installer will validate the parameters and deploy the database updates to create the tables and insert the required data (like the config or the sample data).

    As for the game "theme", the skeleton already provides the preconfigured server "index.js" file, using the "custom-game-theme-test" but you can still use the scripts below (from the manual process), to create your new "custom" theme, or just rename the existent one.

    Manual process:

    Since beta.34:

    Now you can use npx commands, for example, following the old commands for the next steps:

    $ npx reldens installSkeleton custom-game-theme-test
    
    $ npx reldens help
    
    $ npx reldens buildCss custom-game-theme-test
    
    $ npx reldens buildClient custom-game-theme-test
    
    $ npx reldens copyCustomAssets custom-game-theme-test

    Since beta.29:

    3 - Install the default skeleton theme (you can pass a second parameter to be used as the custom theme folder, otherwise "default" will be used):

    $ node ./scripts/reldens-commands.js installSkeleton custom-game-theme-test

    That command will re-generate the theme folder and copy all the required files in your project root and in the "dist" folder.

    For more commands you can use the "help" argument:

    $ node ./scripts/reldens-commands.js help

    Some other useful commands (mostly for when you want to update your implementation) are:

    $ node ./scripts/reldens-commands.js buildCss custom-game-theme-test
    
    $ node ./scripts/reldens-commands.js buildClient custom-game-theme-test
    
    $ node ./scripts/reldens-commands.js copyCustomAssets custom-game-theme-test

    4 - I'm assuming you have a database ready to be used (MySQL is installed and you have the user and password for it).

    You can get the MySQL dump for the installation in the following link:

    https://github.com/damian-pastorini/reldens/tree/master/migrations/production

    • You need to deploy it in your database and change the proper variables in the ".env" and "knexfile.js" files.

    • Once the installation is done and the database ready, you will be able to run:

    $ npm start
    • If you like to see more logs of the process you can change the debug level like:
    $ RELDENS_LOG_LEVEL=9 node .
    • Now, you should be able to browse the following links:

    Game: http://localhost:8080/

    Administration Panel: http://localhost:8080/reldens-admin

    By default, every registered user is an administrator

    In the latest beta this can be changed by setting the default "admin/roleId" in the "config" table in the database.

    UPDATE `config` SET `value` = [new-admin-role-id] WHERE `scope` = 'server' AND `path` = 'admin/roleId';

    Old version: you can change this behavior by changing the following environment variables

    # The role for administrators:
    RELDENS_ADMIN_DEFAULT_ROLE_ID=1
    
    # The role the users get when they register:
    RELDENS_INITIAL_ROLE_ID=1

    ENJOY!