Home

Installation For Development/Contributing

  1. Install the MEAN-stack components nodejs/npm and mongodb

    nodejs
    Install MongoDB Community Edition

    Installation may require root access. If the ScriptRemote server will use an existing, shared MongoDB service then you will need to set the MONGO_URL or MONGO_HOST_PORT environment variable (see config/env/development.js) and you may need to add MongoDB credentials to the .env file in Step 3.

    Also if not already present install:

    For bash testing install:

    For python2.7 testing install:


  2. Clone ScriptRemote

    If you plan to contribute to the project then the clone would be from your forked repo instead of scriptremote.

    >$ cd ~ (or your preferred install location)
    >$ git clone https://github.com/jimb245/scriptremote | 
    >$ cd scriptremote
    ~$ cp npm-shrinkwrap-dev.json npm-shrinkwrap.json
    >$ npm install
    >$ cd public/lib/forge-bower
    >$ npm install
    >$ npm run minify
    

  3. Set up credentials/secrets

    First set up an email forwarding account. This will be used to send various security-related messages and user notifications. Copy the sample credentials file and substitue your values for the MAILER dummy values:

    >$ cd ~/scriptremote
    >$ cp credentials.env .env
    >$ chmod 600 .env
    >$ vim .env
    

    Some services are stricter than others about relaying mail. To help ensure that mail can be sent choose the same provider as expected for registered user emails, and set MAILER_FROM to the same address as MAILER_EMAIL_ID. Any mailing errors will be logged to the console. If there is a problem it will probably first show up when registering the admin user below.

    Second, generate a random string for the session middleware. For example:

    >$ openssl rand -base64 32
    
    Substitute the result for the SESSION_SECRET value in .env

  4. Test the server
    >$ grunt development
    
    This should start the server listening on localhost:3000. Check that you can access the site with a browser.

Code Organization

Code organization is roughly similar to meanjs.org v0.3.

Server code is in directory app. Registration, login, and password reset pages are handled by the server directly rather than by the Angular framework. The login page is compatible with password managers. The server template manager is handlebars and the template layouts are in app/views/layouts, one for the server-managed pages and one for Angular.

Public files are in directory public. The Angular-based code is in public/modules. The bash and python script utilities and their tests are in public/scripts. Doc files other than README.md are in doc.

Config files are located in config/env. The server configuration is determined by the NODE_ENV environment variable. The defined configuration values are:

The displayed release version is set in config/env/all.js.

The server startup files are server.js, and server_mod.js which returns a promise that is useful in test initialization.

Grunt Tasks

Additional References:

MEAN.JS
MEAN.IO
An Introduction To The MEAN Stack