The Quanta data model: folders and nodes
So you installed Quanta. What now?
Well, time has come to start creating content! But first, let's understand how and where Quanta store its data.
Storing Data in Quanta: the no-Database approach
The very first thing to understand, especially if you are coming from other popular CMSs, is:
Quanta is not using a Database. Entities (that are called Nodes) are nothing but system folders.
Yes: one folder = one entity!
How is that made possible?
As you probably know, a system folder already contains some metadata as provided by your operating system.
Usually, depending on the file system itself, that's limited to basic data (name, creation date, update date, etc...).
So, given you have a folder, where are you going to store news's title, your article's body, your recipe's ingredients, your review's ratings?
Quick answer: in a JSON file.
one folder + one data.json file = one entity with metadata
Node naming conventions in Quanta
The folder name represents the node unique name / key / path, and it must be unique in the system.
This means, if at some point you attempt creating two folders with an identical name, Quanta will complain and ask you to change one of the two.
- 📁 orange
- 📁 banana
- 📂 apple📄 data.json
In the above scenario, in example, we could not have another folder named "apple" in the system. Quanta won't allow it.
Other conventions are:
- nodes can't contain underscores in their names
- a node having a name starting with an underscore, is considered a system node. It can't be directly viewed in the browser, but its data can be fetched, or it can be rendered, using qTags.
- a node having a name starting with two underscores, is considered a deleted node. We do a kind of soft delete, while the "real" removal, is done by Quanta's Garbage collector.
How to create nodes in Quanta
You can create nodes in Quanta the same way you create folders in your file system. In example, you could even create Nodes by hand, by just creating folders on your system explorer, command line, mkdir, whatever.
I still like doing it when I'm short of time, or when I want to transform an existing folder structure (i.e. a big photo album, or asset of documents) into a Quanta application.
But in your (and your customer's) everyday use, you'll be dealing with content using Quanta's embedded UI backend utility, called Shadow.
There are other conventions to respect:
Nodes starting with _ are