SmartMaker or DoliMobile?

SmartMaker illustration: a developer springing out of a smartphone with a keyboard, surrounded by code and the React logo

The project was initially named DoliMobile, then, since the solution is not only meant for mobile devices and the DoliMobile name had been "borrowed" by another project, we renamed it SmartMaker.

You may still come across the DoliMobile name in our publications; please bear with us and make the substitution yourself: DoliMobile = the former name of SmartMaker.

SmartMaker is the outcome of a long design effort aimed at bringing the Dolibarr ecosystem a technical stack that lets developers offer native mobile interfaces alongside the Module Builder.

The goal is to let any Dolibarr developer ship PWAs (Progressive Web Apps) rather than applications distributed through the GAFAM stores (and therefore subject to their terms).

A short history

It all started at a Dolibarr devcamp and led to a GIFF (see https://www.dolibarr.fr/forum/t/giff-socle-technique-mobile/43476) which unfortunately was neither funded nor backed by a real group of Dolibarr partners: https://decidim-dolibarr.informatique-libre.com/assemblies/assemblee-giff-socle-mobile - most likely for lack of people and because of how priorities stand today (electronic invoicing, point-of-sale software certification, among others).

Motivations

Dolibarr is a free software project and we believe a decentralised alternative must be offered to our users, so they do not get locked into the GAFAM ecosystems as happens when an application is distributed natively through Google Play or Apple iTunes.

A PWA built with SmartMaker is therefore simply hosted on the user's own Dolibarr, like any regular Dolibarr module.

Users can, if they wish, "add a launch icon" to the "home screen" of their smartphone (or of their own users' smartphones), making the PWA as easy to reach as a native application.

To make the process even simpler, we suggest generating a QR code for the PWA hosting path: users then only have to scan it to get access, which is easier still than searching a GAFAM store.

For more details about PWAs, see the Wikipedia entry https://fr.wikipedia.org/wiki/Progressive_web_app

SmartMaker is a project run by CAP-REL (Dolibarr preferred partner), entirely open, and we hope to see as much of it as possible integrated into the Dolibarr project.

Back office (PHP)

SmartMaker fits inside a regular Dolibarr module (one generated with Dolibarr's native Module Builder, for instance) and offers back-office APIs to expose the elements the front application needs.

You can therefore develop everything you want to expose to the front application inside your module, in the language of the Dolibarr core.

Authentication

The authentication stack is detailed in the SmartAuth project: https://inligit.fr/cap-rel/dolibarr/plugin-smartauth/

In our opinion Dolibarr's native API is not sufficient, which led us to the implementation proposed in SmartAuth.

Note: the SmartAuth project was designed to be integrated into the Dolibarr core, or at the very least we hope to see a solution covering the same functional scope land in the core .

Business API for your application

SmartMaker gives you a modern development framework to maximise your efficiency.

SmartMaker brings a PHP router of the kind found in modern PHP projects such as Symfony or Laravel. For example:

PHP routing table declaring GET, POST and PUT routes to Controller classes

Along with that router comes a PSR-4 autoloader, letting you lay out a logical file tree that matches the entry points of your PHP routing table.

(Files suffixed with Controller.php are therefore the controller classes named in the router)

File tree of the smartmaker-api folder with the HomeController.php and InterventionController.php classes

So the following router line

Route::get('home',      HomeController::class, 'index', true);

implements "GET /home" and calls the "index" function of the HomeController class ... everything is structured and gives you code that is easy to read and to maintain.

The HomeController class is simply implemented in the ./smartmaker-api/HomeController.php file and is loaded automatically by a PSR-4 autoloader. Note: the autoloader lives in the smartmaker-api-prepend.php file.

React front end

The front end is developed in React and many ready-to-use objects are provided.

Note: if you have never set foot in the world of mobile development, be aware that your source code for the mobile platform gets compiled (in short, the result is one big "js" file). Mastering the whole chain therefore matters if you want to implement the mobile application.

Companion tools

SmartMaker ships with companion tools, in particular a Makefile that will make "old-timer" developers smile (make is heavily used in C/C++ development).

Instead of running complicated commands, we grouped everything in the Makefile so you can run simpler ones. Make can check a number of things and automate actions, somewhat like a script.

For instance, to build the PWA mobile application and start it in developer mode, you only need to run

> make pwadev

For more details, have a look at the Makefile.dist file

Note: if you have "local" adaptations to make, put them in a new Makefile.local file, which is included automatically when the make command runs!