Simon Tadros, programmer driven by his passion for entrepreneurial activities.Evangelist of Open Source, as he maintains that knowledge is for everyone. White hacker and security adviser known as evilqubit in white hacker community.As a blogger and writer have led many online groups for php community and launched with a small team an initiative through talk shows advises several young entrepreneurs and startups from the MENA region and often speaks about early stage development and entrepreneurship. Participated in many online activities and incubators clubs such as official representative for Arabnet developer tour and organiser of startupweekend .
“Releasing software is too often an art; it should be an engineering discipline.”
― David Farley
|Framework Freedom||Do not disrupt engineers by imposing new framework. This will kill agility|
|API Management & Lifecycle||Build homogen API catalog by leveraging what you have. Do not start from scratch|
|Multitenant API||Create economy of scale and accelerate time to market. Reusability is profitability|
|Agnostic Container Technology||Do not limit yourself to proprietary technologies. Take advantage of kubernetes, swarm and other container technologies.|
|Agnostic Cloud||Leverage any cloud provider as well as you own private cloud. Move any system you have on the cloud in minutes|
|Continuous Integration & Delivery||Release with a click of button. Speed Speed Speed|
Our Demo will demonstrate how to deploy an environment ( DEV ) then deploy 3 services in it where each service is built using a certain technology/framework.
Once deployed, we will show using the Swagger Simulator tool in the API Catalog Module:
- how to test the APIs of these services
- how multi tenancy is applied at the code level
- how mutli security is applied on running services
Finally we will demonstrate how to turn on Continuous Integration & Delivery, configure it and see it in action.
|Express||/tidbit/hello||POST||retrieve a SOAJS object|
|Express||/tidbit/hello||GET||returns a message containing your username and last name.|
- Configuring and apply Multi-Security
We will import a ready made configuration that introduces a product with 2 ACL packages where package 1 offers full access to all 3 services and their APIs while package 2 offers limited access to APIs who use the POST method only.
|package 1||DEV||provides public access to both APIs|
|package 2||DEV||provides limited access to only POST API|
|TIDBIT 1||TID1||package 1||full access to all the APIs of all the services|
|TIDBIT 3||TID3||package 2||limited access to the API that use the POST method only|
|TIDBIT 5||TID5||package 2||limited access to the API that uses the GET method only|
Users and Groups belong to tenants.
Tenants use product packages and each tenant offers a custom configuration per environment.
Products and Packages provide ACL access to services
Services provide APIs and are deployed in multiple environments.
# Create a directory to download the installer in it > mkdir -p /opt/soajs/node_modules/ && cd /opt/soajs/node_modules/ # download the installer from npm > npm install soajs.installer # start the installer > cd soajs.installer > node .
# Create a directory to clone the repo > mkdir -p /opt/soajs/node_modules # Go to directory > cd /opt/soajs/node_modules # Clone configuration repo from github > git clone email@example.com:soajs/soajs.tidbit.demo # Install the dependencies > cd soajs.tidbit.demo > npm install # node . -h <mongo service host> -p <mongo port> > cd soajs.tidbit.demo/import/ > node . -h dashboard-soajsdata -p 32017
Fetch SOAJS demo repo
# Open the import script help manual > cd soajs.tidbit.demo/import/ > node . --help
Integrate & Activate Services
Head over to the Develop pillar → Repositories to activate the microservices.
In the Repositories, we find the default SOAJS account activated and it contains a list of repositories we can turn on and off.
Activate soajs.nodejs.express repository, you will be asked to select a branch; pick master.
Deploy a new Environment
Our import script already imported the configuration we need to get things going. Let's deploy the DEV environment.
Go to Deploy pillar and select DEV from the drop down menu in the top left corner.
Click on High Availability → Cloud in the left-hand side menu , click on the Services tab and press Deploy Environment.
Deploy the service (express)
Point the Dev Domain IP in your hosts file
Before proceeding, make sure to go to:
Deploy pillar / High availability - Cloud / Services (tab)
Find the controller entry and click on the 'service Operations' drop down and hit: Reload registry & Load provision
Test your Services with Swagger and Postman
We will test the microservice in two ways :
Swagger Simulator: rich UI simulator that provides REST API documentation and the ability to interact with them.
SOAJS Dashboard UI is equipped with Swagger Engine and Simulator by default.
- Go to the dashboard → Develop → API Catalog:
- Click on Swagger logo that appears if the microservice contains the property "swagger" set to true
- Choose your environment where you deployed your microservice
- Choose the right tenant TID1 for example
- Use the simulator to make API calls to your microservice
express is a multitenant microservice; you will need to provide the tenant keys for the requests to work.
To find these keys, go to the Manage pillar → Multitenancy → Client ( you will see the list of tenants there ).
Expand a tenant entry, to reach the external keys section, grab the external key and use it in the postman requests. In the Swagger Simulator, when you pick the tenant, the external key is added automatically to the header
Continuous Integration & Delivery
Continuous integration & Continuous Delivery CI/CD provides the mechanism to automate everything. Continuous integration (CI) means that whenever a developer checks in code to the source repository, a build is automatically triggered. Continuous delivery (CD) takes this one step further: after a build and automated unit tests are successful, you automatically deploy the application to an environment where you can do more in-depth testing.
Generally we recommend that you do continuous delivery to your development and staging environments. Most teams, require a manual review and approval process for production deployment.
SOAJS provides you with ready made UI so you can turn on and configure CI/CD with just a few clicks.
Head to Develop → Continuous Integration and pick the provider you would like to integrate with.
Fill in your account information and enter the CI Yaml Configuration where applicable.
Head to Develop → Repositories and click the configuration button next to your repository and select the Continuous Integration Tab.
Activate your repository and configure its settings and manage the environment variables that should be available at build time.
Head to Develop → Repositories and click the configuration button next to your repository.
Select the Continuous Deliver Tab and configure the strategy to use for your service in each environment it is deployed in.
At this point, CI/CD is turned on and configured for soajs.express repository.
Head back to Develop → Continuous Integration:
- click on Download Continuous Integration
- Extract the zip file and add both files ( .travis.yml & soajs.cd.js ) at the root level of your repository
- Commit and push
Get you hands Dirty
- Get Started: http://www.soajs.org/getstarte
- how to build a service: https://soajsorg.atlassian.net/wiki/spaces/EX/pages/61672832/How+to+build+a+service
- Framework overview: https://soajsorg.atlassian.net/wiki/spaces/SOAJ/pages/61344468/Overview
- Documentation Index: http://www.soajs.org/documentation
co-founder of switchdw (kiev)
By Simon Tadros