A Materia application is a folder which contains all the files of your application. Most of these files are just simple JSON configuration files which are used to describe your backend.
Keep in mind that Materia designer automates a good part of how your application is architectured.
The hierarchy of a minimal application is as follow:
materia.json materia.prod.json package.json
These 3 files are mandatory to launch a Materia application:
The database configuration is now optional since the August Release. You can just remove the key
database from the file
materia.json and Materia will skip to connect the database.
json files in the
server/models/ folder are descriptions of the entities you've created in Materia designer. They contains all information about the fields they may have, the relation between these entities, and all the queries you can execute on them.
Materia now supports addons: they are special npm package you can install using
npm install [package_name] --save or
yarn install [package_name] in the CLI. They can define their own entities, queries and endpoints to define new features for your application (e.g. emailing, user management etc.).
To learn more about these JSON file which describe your application, You can find their specifications here.
Example of the structure of a complete application:
.materia/ | ids.json | entities-position.json server/ | controllers/ | | default.ctrl.js | | customer.ctrl.js | | ... | models/ | | queries/ | | | customer.js | | | product.js | | | ... | | customer.json | | product.json | | ... | permissions/ | | has-bought.js | api.json | permissions.json client/ | css/ | | main.css | | ... | img/ | | logo.png | | ... | js/ | | main.js | | ... | index.html .gitignore materia.json materia.prod.json package.json webpack.config.js
When creating a new application you can select a database (this step is optional but highly recommended). You can currently choose between:
SQLite stores everything in a file and is easier to start with as it doesn't require any installation to work. It just works out of the box. It's limited for small or medium database as it is harder to scale with this DB and as you can't connect to the DB from another server using a TCP connection, the Live mode of Materia Designer cannot work for SQLite.
At any time, you can use the icon at the left on your application name to open the application sidenav.
In this sidenav, you can switch application:
You can create a new application using the icon in the bottom of the application sidenav.