Skip to content

Step 2: Edit the data models

Run the serve command.

At this point, you have a boilerplate but no data models in your project, unless you have imported collections of predefined data models. In order to create and modify the data models in your project, run this command to launch the local GUI:

hpf serve

List of data models

Once started, the GUI displays all the data models.

Hapify GUI - Models edition

Tip

For projects with many data models, you can filter them by name, field name or reference. Use the top right bar. Press the escape key to reset these filters.

Add and edit data models

Click on the New model button, enter a name and press the "Enter" key.

The new data model will be populated with the default fields. The default fields are defined in the boilerplate configuration file (hapify.json).

Tip

Once created, you can change the name of the data model by clicking on it.

Importing predefined data models

Click on the Import collections button, choose a collection (preset) and validate.

Hapify GUI - Models import

The data models of the collection will be merged with the existing data models in case of conflict.

Delete, clone and copy

Click on the three dots to display this menu:

Hapify GUI - More options

Copy and paste

When you copy a data model, it is added as JSON to your clipboard. To paste a data model, click Paste from clipboard at the end of the data model list.

This is useful to transfer data models between multiple projects.

Add and edit fields

Click on Add field at the end of a data model and enter a name.

You can choose its type and subtype:

Hapify GUI - Field type

And also its attributes by clicking on the gear :

Hapify GUI - Field attributes

Tip

Once created, you can change the name of the field by clicking on it.

See also

To learn more about field management, please refer to the data model description.

Delete a field

Click on the "trash" icon and select the fields to be deleted:

Hapify GUI - Delete fields

Edit data model accesses

Expand the access management panel by clicking on the "fingerprint" icon at the top of a model:

Hapify GUI - Access management

See also

For more information about access management, please refer to the data model description.

Add notes

You can leave notes on the data models and their fields. Click on the "speech" icon and write a note.

On a model:

Hapify GUI - Models notes

On a field:

Hapify GUI - Models notes

Errors and warnings

A boilerplate can validate the data models you are writing. These errors or warnings will appear when editing the data models.

Hapify GUI - Models error