/RAM

Relationship Authorisation Manager

Primary LanguageJavaScriptMIT LicenseMIT

Architecture

System Architecture

High level system functionality - User UI Flow

High Level Functionality

Data Model (In TypeScript format here)

Data Model

Rest API - Work in progress - here

Useful resources:

  1. Development Environment

Development Environment Installation

  • Create a (GitHub)[http://github.com] account if you do not already have one.
  • Log in to your GitHub account
  • Go to https://github.com/atogov/RAM
  • Select the Fork button from the top right
    • If you have not yet created a fork, you will be given that option now
      • Read https://help.github.com/articles/fork-a-repo/ for instructions. This will give you a repository in your own account that synchronises from the ATO RAM repository. As you make changes, use pull requests to update the main repository. Don't forget to merge from ATO before creating a pull request back.

Windows

  • Download the Github downloader/installer
  • The GitHub GUI should open once install is complete
    • Change shell to Bash
      • Select the tool icon on the top right
      • Selection Options... from the menu
      • In the Default shell section, choose Git Bash
  • While there configure your GitHub account, clone path, etc
    • Close the options
    • To use SourceTree for reviewing / merging pull requests, you need to modify .git/config file as described here. In short, add the following: [remote "atogov"] fetch = +refs/pull/*/head:refs/remotes/origin/pr/*
  • Run a git bash shell
    • from the GitHub GUI client
      • Select the tool icon on the top right
      • Selection Open in Git Shell from the menu
    • curl -SLO https://raw.githubusercontent.com/atogov/RAM/develop/install/ram-dev-win.sh
    • ./ram-dev-win.sh your-github-name
      • Clones a local copy of your FORK of RAM
      • Uses npm/tsd/jspm to install dependencies
      • Installs MongoDB
      • Installs Node 6.x.x
      • Installs Visual Studio Code

Windows Manual installation - Windows 7

  • Download and install latest version of MongoDB
  • Install python 2.7 and make sure it is also on the PATH
  • Install NodeJs 6.x.x
  • npm config set python python2.7 --global
  • npm config set msvs_version 2015 --global
  • Install VC++ Build Tools Technical Preview from http://go.microsoft.com/fwlink/?LinkId=691132, choose Custom Install, and select both Windows 8.1 and Windows 10 SDKs.
  • npm install typescript tslint eslint gulp-cli jasmine jspm -g
  • cd backend; npm install
  • cd frontend; npm install; jspm install

AWS Install

  • Each server requires its own configuration file. Template configuration file at conf/conf.js. You must set an environment variable called RAM_CONF pointing to the absolute path of your configuration file. Once you set your RAM_CONF environment variable you can run the server by calling gulp serve.

  • SSH to the server

From the Server

SSH to the server and run /ram/update.sh hhhhhh where hhhhhh is the hash of the commit you want to run. It can also be a tag or branch name. If not supplied, develop is used.

From the UI (Dev env only)

From a browser run http://ramvm01.expoctest.com/dev. Enter a branch/tag/hash and press the appropriate button.

The Development Process

  • Fork and clone https://github.com/atogov/RAM if you haven't already. This need only be done once per developer.
  • Open Git Shell
  • Run ./ram.sh backend server&
  • Run ./ram.sh frontend server&
  • Wait patentially. Eventually a browser page will open
  • For each task:
    • Refresh your clone from RAM or another fork if that is the base you need.
    • Repeat...
      • Enable tests you want to work on.
      • Run Jasmine for a service called nnnnn. If the optional describe text is provided, only the describe() that matches the text will run. Otherwise all tests in the file execute.
      • If it fails, add code to one of the service actions

Jasmine from the Client

You may prefer to test your service from a browser. You can then select individual tests as needed. The browser will need to include

  • RAM/microservices/node_modules/ram/service/request.js
  • RAM/microservices/nnnnn/spec.js

PM2 - Production Process Manager

Full use has yet to be explored. For development the watch can be set to restart on file changes. To do this we need to set up environments so that it only does so on development. This is a matter of setting and using environent variable within ecosystem.json.

favicon.ico

Credit for creation of icon to Alexandr Cherkinsky