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.
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.
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:
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:
And also its attributes by clicking on the gear :
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:
Edit data model accesses
Expand the access management panel by clicking on the "fingerprint" icon at the top of a model:
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:
On a field:
Add meta-data
Some boilerplates use meta-data that will be processed during generation. These meta-data can be used to add custom variables to a field or a model.
On a model:
On a field:
Errors and warnings
A boilerplate can validate the data models you are writing. These errors or warnings will appear when editing the data models.