Data Modelling in Mattrbld

Illustrated drawing of Amadeus Maxmimilian StadlerIllustrated drawing of Amadeus Maxmimilian Stadler

Amadeus Stadler

Last updated August 28, 2021

Mattrbld is built to do one thing: help you manage your content. As such, it’s only natural that content is at its very core. In this article, you will get an overview of how your content is mapped to an intuitive editing experience, while the individual aspects of this broad topic will be discussed in greater detail in the following articles.

Files Working Together

Since Mattrbld is Git-based, everything you do lives in separate files which all work together in the background to make your experience as smooth as possible. In this sense, it’s similar to other flat-file content management systems which don’t lock your data away behind some database. You can easily open and inspect every configuration file just like you can with your content—you could even perform all the steps we will discuss below from the comfort of your own text editor, but that might not be the most ideal experience. 😉

Regarding your content, there are two types of files that matter beyond the actual content files: Schemas and Collections.

Schemas

We will discuss Schemas in more detail in the next article, but in a nutshell, a Schema denotes the shape of your data. It dictates which keys will store what information, but not only that, it also allows you to finely control what data is considered valid through validation rules.

Schemas consist of one or more Fields, each with its own options and rules. These fields come in various types and can be easily arranged in a visual editor. To make your own and the experience of your collaborators as enjoyable as possible, you can not only split the fields of a Schema into multiple logical tabs, but also control who sees what field when.

If you have trouble picturing a Schema, think of it as a blueprint for your content, which Mattrbld will then use to build a form for you to enter the required information. For example a simple blueprint for a blog post might consist of:

  • A title

  • The content

  • The publishing date

Add all the data for these three fields and you have a blog post. In Mattrbld you could define the Schema as follows:

  • Title: unformatted text, required

  • Content: rich text, markdown, required

  • Published: date, default to now

As you can see, the Schema includes information about what fields are required, of what type they are, and any defaults they might have. The data is then used to generate the UI for you to write your blog posts whenever you create one.

This system is extremely flexible and should allow you to map any sort of imaginable content into Mattrbld, especially once you bring Custom Fields into the mix.

Fields

Mattrbld comes with a large amount of predefined Fields from which you can construct your Schemas. Most of these fields represent individual pieces of data, such as a number, an image, or a string of characters. Some fields are used to group and structure other fields and a select few fields don’t have a direct impact on your content and instead just serve to provide additional information and make the content editing experience more enjoyable and easier to grasp.

Custom Fields

Thanks to Custom Fields you are able to manage and reuse sets of default fields with their own specific configurations from a central location. This means you can create more complex fields with advanced functionality from basic field types and re-use them throughout your entire project with ease.

Collections

The second half of the content-equation are the Collections. While Schemas describe the shape of individual pieces of content, Collections describe groups of content. A Collection holds information about where a set of content is stored, what Schemas it may have, who can create and modify content in that Collection and more.

So while a Schema might describe what a blog post should look like, a Collection dictates what format the files have, where they are stored, and who has what degree of access to them.

Another way of thinking of Collections is picturing them as folders full of documents. The documents are the content, and each folder only allows documents within it that look a certain way, determined by the Schema after which the documents were constructed.

Rinse and Repeat

Setting up the content of a project for Mattrbld always involves the same steps:

  1. Define the Schemas

  2. Create Collections and assign Schemas to them

  3. Done

The following articles in this section will teach you everything you need to know to efficiently model your data structures with Mattrbld and show you some tricks to save time along the way. You will also find an extensive almanac documenting each default field type and its individual options so you can quickly check up on details should you ever need to.