Overview

This tutorial shows you how to start development, run your first app on Aidbox, and deploy it into the cloud.

Setup Development Environment

To take full advantage of Aidbox, you will need GIT and NODE.JS.

You will also need aidbox-cli. You can install it using NPM. Just make sure that you have permission for installing modules globally. 

Execute this in your command terminal:

$ npm install -g aidbox-cli
$ aidbox v

If "aidbox v" returns OK, everything is ready for developing your applications with Aidbox!

Using Aidbox on the Website

To start working with Aidbox you have to create a free Aidbox account. After you receive a confirmation email from us, click the link it contains to confirm that you own the email address.

  • Log in to Aidbox
  • Create a new box e.g. mysuperEHR (see Box Management on how to create a new one)
  • Open the box by clicking its name on the Dashboard
  • Create a user in your box e.g. user1@test.com / 7777 (see Users and Groups on how to create a new one)
  • Each newly created box has a default implicit client named "site" (see Clients for more information about clients)
  • Open this client for editing and add the following link to the 'Redirect Uri' field on the form: s3-us-west-1.amazonaws.com
  • Create a new policy with the following schema (see Policies on how to create a new one):
{"required": ["client"],
"properties": {
  "client": {
    "type": "object",
      "properties": {
        "client_id": {
          "constant": "site"
        }
      }
     }
  }
}

AIDBOX CLI

In your command console, switch to the sample-spa folderConnect to Aidbox:

$ aidbox login

Enter email and password of your Aidbox accountView the list of your boxes

$ aidbox box list

Choose a box to work with

$ aidbox box use <boxname>

Run Sample Application

To try Aidbox, run our sample single-page application (SPA).

Execute the following commands to clone it, and install modules and packages it depends on:

$ git clone https://github.com/Aidbox/sample-spa
$ cd sample-spa
$ npm install

In the file dist/app.js, set the variable BOX_URL to the URL of your box.

For instance, if the name of your box is mysuperEHR then set the variable BOX_URL this way:

var BOX_URL = 'https://mysuperEHR.aidbox.io';

You can run your application locally with this command from the project folder (this step is optional):

$ npm run start

Your application will be running at http://localhost:5000.

Click on the login button and enter login and password of one of the box users e.g. user1@test.com / 7777.

After logging in, you will see a simple patient list which allows you to filter, add and edit patients.

Deploy Sample Application

Deploy your application into the box from the sample-spa folder with the following command:

$ aidbox deploy

Visit your running application by the URL generated from the box name - e.g. https://s3-us-west-1.amazonaws.com/aidbox-production4-aidbox-files/mysuperehr/index.html for the box mysuperEHR.

Click on the login button and enter login and password of one of the box users e.g. user1@test.com / 7777.