DoliMobile is the result of a long process of reflection aimed at providing the Dolibarr ecosystem with a technical stack so that developers can offer native mobile interfaces in addition to the Module Builder.
The aim is to enable all Dolibarr developers to offer PWAs rather than applications to be deployed via the GAFAM portals.
It all started at a dolibarr devcamp and gave rise to a GIFF which, unfortunately, was neither funded nor supported by a real group of dolibarr partners: https://decidim-dolibarr.informatique-libre.com/assemblies/assemblee-giff-socle-mobile
Dolibarr is an open-source project and we believe that we need to offer our users a decentralised alternative so that they are not locked into the GAFAM ecosystems. So a PWA application developed using DoliMobile is simply hosted on your Dolibarr. Users can 'add a launch icon' to their smartphone 'desktop' if they wish. Launching the PWA is therefore virtually identical to launching a native application. For more details on PWAs, please consult the wikipedia entry https://fr.wikipedia.org/wiki/Progressive_web_app
DoliMobile is a CAP-REL (preferred dolibarr partner) project that is completely open and we hope to see as many things as possible integrated into the Dolibarr project.
DoliMobile proposes the use of APIs on the backoffice side to make accessible the elements that the front application would need.
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 and we have adopted the implementation proposed in SmartAuth.
Note: The content of the SmartAuth project has been designed to be integrated into the heart of dolibarr, or at least we hope to see a solution covering the same functional scope in the heart of dolibarr. .
DoliMobile offers you a modern development framework to maximise your efficiency.
DoliMobile provides a PHP router like you can find in modern PHP projects such as symfony or Laravel. For example:
Linked to this router is a PSR-4 autoloader that allows you to set up a logical file tree responding to the entry points of your PHP routing table.
(The files suffixed with Controller.php are the controller classes indicated in the router).
So the following line in the router
PHP Route::get('home', HomeController::class, 'index', true); ```
Implements the “GET /home” method and calls the “index” function of the HomeController class … everything is structured so that your code is easy to read and maintain.
The HomeController
class is simply implemented in the ./smartmaker-api/HomeController.php
file and will be loaded automatically by an autoloader (PSR-4). Note: You can find the autoloader in the smartmaker-api-prepend.php
file.
The front end is developed in react and a number of ready-to-use objects are available.
Note: If you've never set foot in the world of mobile development: your source code for the mobile platform will be compiled (in short, the result will be a big “js” file). So it's important to master the entire chain before you can implement your mobile application.
DoliMobile comes with a number of additional tools, including a Makefile that will make 'old' developers smile (make is particularly used in C/C++ development).
Instead of having to run complicated commands, we've grouped everything together in the Makefile, which lets you run simpler commands. Make is able to check a number of things and automate actions a bit like a script.
So, for example, to compile the pwa mobile application and launch it in developer mode, you can just run the command
> make pwadev
For more details, have a look at the Makefile.dist file
Note: If you have “local” adaptations to implement, you can do so in a new Makefile.local file, which will be automatically included when you call the make command!