Project initialization

Both of the cases this year require that our React applications use the DHIS2 app platform and app runtime. The easiest way to get started it to use the d2 command line to initialize our app as shown below.

Initializing an app using the command line

The d2 CLI provides a simple way of initializing a new app. Let us navigate (in the terminal emulator) to the where we want to create our project. This command requires yarn to be installed on our machine.

d2 app scripts init <app-name>

<app-name> must be replaced with whatever you want to call your new app.

We can now navigate into the newly created folder and start our development server.

yarn start

A web-browser window should have popped up greeting you with a login dialog (as shown below).

Newly initialized application login dialog
Newly initialized application login dialog

Entering our login credentials and signing in gives us the following screen.

Newly initialized application greeting screen
Newly initialized application greeting screen