Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Introduction


SOAJS comes with the following packages:

PackageDescription
SOAJFramework that you will use to develop your services.
COMPAdvanced Service/Daemon Generating Component that forces standardization of code and Layer isolation: REST - BL - Model
soajs.controllerSOAJS gateway service used as an entry point and forwards requests to designated services.
soajs.oauthSecurity service, can be used to protect your services using oAuth 2.0
soajs.uracUser Registration and Access Control, can be used to handle and manage user accounts per tenant.
soajs.examplesExamples Package, contains 4 examples going from basic service example to fully advanced service example.
soajs.dashboardThis is the admin dashboard for soajs, enables you to configure and manage your services using a UI.
soajs.proxyThis Package, provides the ability to communicate with services deployed in other environments while working in the Operate Pillar of the Dashboard UI interface.
GCSGeneric Content Service Generator with UI Module.



Basic Service


Image ModifiedBuilding a basic SOAJS service requires only two of the above mentioned packages: Framework and CON.

You need the framework to build your service and you need the controller so it can forward the requests to your service.

This scenario is explained in depth in EX / Example 01.

When the request reaches your service, SOAJS framework captures the request first, executes the needed features based on how you configured soajs framework for this service and throws an error or hands over the request to your service business logic.


Securing a Service with oAuth


Image ModifiedThis is exactly like the previous basic service example but with oauth turned on.

This scenario is explained in depth in GetEX Started / Example 02.

If you attempt to directly hit the api of either Example 02 without providing an access_token, the request will be rejected.

You will need to request a token from the oauth service first, and provide it in the consecutive requests to Example 02 and 04 services. 

To configure your service to be protected by oauth, set the property oauth to true.

Click Here to see the list of properties a service can use when you create it with SOAJS.


Data Layer


The data layer of soajs framework is built on top of MongoDB and uses two databases: CORE_PROVISION & CORE_SESSION

CORE_PROVISION

Collection NameDescription
environmentList of environments and their IP addresses matching registry configuration.
tenantsList of available tenants and their applications and keys information.
productsList of available products and their packages along with the ACL permissions.
oauth_usersList of oAuth user accounts related to tenants.
oauth_tokensList of tokens related to oAuth users accounts.
servicesList of Services installed.
daemonsList of Daemons installed.
daemon_grpconfList of all Daemon Configurations.
hostsList of deployed services & daemons in all environments. ( Manual Deployment Only )
fs.filesList of all certificates used by docker.
gcList of all generic content schemas created by the content-builder.



CORE_SESSION

Collection NameDescription
sessionsList of sessions with full details on requests made by tenants, containing cookies, session information, api requested, key provided, passed parameters ...



Handling a Request


When a request arrives to your service, it goes through the framework first then your business logic then it goes back to the framework before returning.

The first entry to the framework, adds SOAJS alters the data as configured by the constructor parameters and adds the tools that SOAJS offers, SOAJS also talk to the data layer to check the key provided and the permissions and load the provisioned data based on the current running environment as configured in the the Registry.

The second time the framework is used which is before returning the response, soajs formulates a unified and valid REST response before returning this response.