From my standpoint, Sugar has 4 separate frameworks, Backend, REST API, Front-end (sidecar), and Mobile SDK. There is a synergy between each of the frameworks and the front-end and Mobile SDK are dependent upon the REST API. The REST API is dependent upon the backend. As a Sugar developer, you will understand what it means to be a Full-Stack developer. This post is a general overview of the different framework components, over time we will delve into the details of each and how we can leverage them to meet our needs.
The OG Backend
I’m not sure if the backend of Sugar has a name, it is the workhorse of the application and should be treated with R E S P E C T. The backend is written in PHP. Sugar was started as an open-source project in 2004, many of the design decisions that were made at that time are still in effect today. Sugar was built in what is now known as WEB 1.0. The backend generated all of the HTML as well as communicated with the database.
Sugar’s backend does:
Authentication
Access Control Lists
Object Relational Mapping (ORM) hiding the complexities of the system
Manages file upload and downloads
Controls the background processes such as Jobs Queue and Schedulers Jobs
Handles all of the triggers like Logic Hooks, Legacy Workflows, SugarBPM
Generates PDFs
Runs Reports
Communicates with external systems
Etcetera
REST API
As mentioned earlier Sugar was WEB 1.0, access to an API was added somewhere around version 3 or 4. The API was not core to Sugar and was not used by the application itself. It was purely for access to the data. Sugar’s Outlook, Word and Excel plugins used this API. The API was SOAP and not REST. In a later version, REST was added as a layer on top of the SOAP functionality. The main difference was that the REST API returned a JSON instead of XML. The REST API was not RESTFul in any way! The current version of the legacy API is version 4_1. This API has been deprecated since Sugar 7 (about 2010). The API can still be accessed at the URLs http://<SugarCRM>/service/v4_1/soap.php
or http://<SugarCRM>/service/v4_1/rest.php
. DO NOT USE THIS VERSION OF THE API!
The release of Sugar 7 changed everything! Sugar became a single-page WEB 2.0 application that relied 100% upon its REST API. The REST API is RESTFul! The front-end utilizes the REST API and can’t function without the API. The API is a layer on top of the backend and all of the features of the backend. The REST API has a built-in help system. The version of the API with Sugar 7 changed to v11 from v4. At the time of this writing, the current version is v11_16 and access to the help system can be accessed athttp://<SugarCRM>/rest/v11_16/help
or http://<SugarCRM>/rest/v11/help
.
Access to functions utilize the RESTFul verbs, GET, POST, PUT, DELETE, etc. To obtain module Contacts, the URL would be http://<SugarCRM>/rest/v11/Contacts
. BTW, the REST API is written in PHP.
Front-End (Sidecar)
When people think of Sugar they are thinking of the User Experience (UX). Starting with Sugar 7; Sugar’s front-end, known as Sidecar, is written as a JavaScript application. Sidecar receives all of its data via the REST API and renders it within the browser. We will delve into extending the sidecar in future posts.
Mobile SDK
In addition to the browser user experience, Sugar also has a Mobile SDK. Sugar provides a mobile app for iOS and Android however, they also provide a mobile SDK that enables developers to add additional functionality to a custom mobile app.
Conclusion
Sugar provides different frameworks for the different parts of the application. Learning all of the different frameworks will not happen overnight. You may only ever need to use one or two of the frameworks. Keep working at it, and you’ll unlock all of the secrets to the frameworks.
Let me know your questions!