Creating Hello World app

In this tutorial, we'll create a very simple application for Aurora, all it's going to do is displaying "Hello world" message. We'll make sure the link to this application is added to main menu. This sample application is available for download here.

In Aurora, every application consists of at least one module, and each of the modules has its separate subdirectory under modules dir.
Applications usually have their logic and presentation separated, hence the modules can be backend and frontend ones.
While it's not a strict requirement, the recommended naming policy for frontend modules assumes appending Webclient to module names.

To begin, we need to create a subdirectory under modules dir. Our application will only have one frontend module, and we will call it HelloWorldWebclient.

Then we create three directories under modules/HelloWorldWebclient: js for JavaScript code, templates for HTML templates and i18n for translation files.

Let's look at what this code is doing. It starts with including two utilities and denotes hash value used in URL for switching to this application.

The following condition:

if (App.getUserRole() === Enums.UserRole.NormalUser)
{
...
}

ensures that only authenticated user, one that doesn't have admin privileges, can access the application.

getScreens function adds a screen for our application and includes js/views/MainView.js file we'll cover below. As for getHeaderItem function, its purpose is adding a link to main menu.

As you can see, the code makes use of language constants. Our module supplies those in i18n/English.ini and i18n/Russian.ini files; if you plan to use Aurora interface in different language, you'll need to provide translation file for that language as well. Take a look at i18n/English.ini file:

Now that we have all the files of our module in place, we need to let Aurora know about this new module. That's done by rebuilding static files as explained here. If you're logged in as Aurora user, you'll need to log out and back in to see the new application entry in top menu.