Repository navigation
v0.7.0 - March Release 2017
I'm excited to announce the March Release v0.7 of Materia. A big step forward !
Some of the key highlights include:
-
Addons: You can install/uninstall addons within Materia Designer.
-
3 new addons:
- @materia/sengrid - Send emails in your application using Sendgrid
- @materia/mailjet - Send emails in your application using Mailjet
- @materia/users - Simple user management solution for Materia
-
Permissions management
-
UI Enhancements
Addons
An addon is a reusable and configurable component for your backend. It gives super power to your application. The goal behind addon is to write as less code as possible while being able to configure everything.
e.g. If you want User Management on your website, you can code it in your application, or you can install a user management addon which will automate all of this for you.
This release introduce an easy way to manage your addons in your Materia application.
Install
You can see the list of available addons directly in Materia Designer. You can install them in one click.
You can do the same in your terminal using yarn or npm
e.g. for the addon of User Management
yarn add @materia/users
or
npm install @materia/users --save
Setup
Once an addon is installed, we enter in the setup phase to configure how the addon should work.
It may be a simple setup like for the Sendgrid Addon:
Or complex setup like for the User Management Addon (defined by the addon's developer)
Uninstall
Once you don't want an addon anymore, just remove it from Materia designer and everything associated with this addon will be removed (entities/queries/endpoints/data).
You can uninstall addons using yarn or npm
With Yarn:
yarn remove @materia/sendgrid
With NPM:
npm uninstall @materia/sendgrid --save
Addons Marketplace
The goal behind making addons is the desire to build a Marketplace of reusable and configurable backend component. It will soon be open to publish your npm/yarn package as a Materia addon.
We're working hard to bring a good documentation to explain how you can develop your own easily. In the meantime, you can browser official addons source code: @materia/users, @materia/sendgrid & @materia/mailjet
To share your addons with others, you can publish it on NPM so others will be able to install it easily using the terminal: npm install {your-addon} --save
Sendgrid & Mailjet Addon
Sendgrid/Mailjet addon has been released to send email with your Sendgrid/Mailjet account.
You can install these addons in Materia Designer in the Addons section or directly with npm or yarn
For Sendgrid:
npm install @materia/sendgrid --save
or
yarn add @materia/sendgrid
For Mailjet:
npm install @materia/mailjet --save
or
yarn add @materia/mailjet
To use this addon, you will need to setup your API Keys and your email address (used to send email). Once the setup completed, you'll be able to send email from your application endpoint using the query send in the entity sendgrid or mailjet depending which one you chose.
For the moment, both the Sendgrid and Mailjet addon are limited to send text email. Next step: use templates and HTML email and potentially create newsletter within Materia.
User Management Addon
One of the biggest step in this release is this addon. It enables you to quickly have your user management system up and running securely.
You can configure extra fields in the user entity to get exactly the data you need to know about your users.
You can enable at any time email verification to know if a user has its email verified. You can use this field to block unverified user on specific feature if you don't want to.
The email verification is done by communicating with the emailing addons (Mailjet and Sendgrid) to send lost password emails or signup emails.
This is an example of front which implement the User Management addon (thanks @GeoAstronaute !):
This addon adds new endpoint permissions in your application to secure your data.
- Authenticated => Only signed in user can access an endpoint with this permission
- Connected User ID => Inject in the executed endpoint/query the parameter user_id with the id of the connected user.
You can define roles and user permission in the entity user_role and user_permission. Each time a role is created, a new endpoint permission is added with the role as name.
E.g. if you create the role "admin", a endpoint permission "Admin" will be created to authorize only authenticated user which have the user permission "admin"
Endpoint permissions Management
Addons were the only way to configure permissions. I thought it was really too limiting and was preventing users to secure their application correctly so we added some configuration files:
server/permissions.json- List of available permissionsserver/permissions/*.js- Permission definition
A permission is just an Express middleware you can define yourself in the Permission Editor.
The code to make a permission has this structure:
module.exports = function(req, res, next) => {
//permission logic
//call `next()` if the user is allowed
//throw an error if the user is not allowed
}UI Enhancement
Some work has been done in the UI:
- (Global) Right sidenav animation (still a WIP for the left sidenav)
- (Entities) Reduce zoom in entities (as the maximum zoom is still big)
- (API) Endpoint information are better displayed
- (Internal Editor) Enhance the title / action button display
- (App Settings) Dark theme - In a more general way, all modal called within a dark sidenav will have a dark theme
- (Database Settings) Loader animation while trying to connect the database






