Collaborative Sobamail Applications¶
Now that we seem to have a convergent implementation, let's test the waters by creating a private instance that can be used across replicas of our mailbox.
It takes two distinct steps to ship a Sobamail application to end users:
- Deployment
- Instantiation
Lets cover each one in detail:
Deployment¶
Deployment (aka freezing) is the process of generating a structured message
(objkey = {https://sobamail.com/module/appmanager/v1}AppInfo ) that
contains the digest values of all components of a Sobamail application along
with miscellanous metadata.
- The digest values of the backend module and its imports are all computed separately. All JS modules from all apps are deployed to a common folder shared by all Sobamail applications.
-
As for the frontend assets, a zip file is created from the contents of the
assets/folder in the develroot which is used as input to digest computation.If you used a frontend framework, be sure to run a release build before performing the deployment operation.
Now let's do this for our Counter app:
- Navigate to the app develroot.
- Don't forget to abort the
npm run dev-watchjob if it's still running. - Change to the
ui/folder and runnpm run build. If all went according to plan, you should now have the release build of the app frontend in theassets/folder in develroot.
Now launch Sobamail and open the Application Manager:
- Go to "Instances" screen and find your app. Ensure that it's the correct appinst value and also remember that it must be in in developer mode.
-
Click the radio button next to your app and click the Deploy button at the top of the screen.
- If all went well, you should see your app in the "Known Apps" screen.
-
If not, check Sobamail logs, fix the errors shown there and try again. Some common mistakes:
- Ensure you have the correct hashes for imports. Sobamail runtime tells you the expected value so just copy/paste it from the logs.
- Ensure your version is greater than all deployed versions of your app id.
- Ensure the appid on the Mutator module matches the one on the "Instances" screen.
Instantiation¶
Now that your Application is deployed, you can instantiate your application to use it.
While app deployment freezes the app, app instantiation assigns it a data store. You can create as many instances of your app as you like and you can keep your app instances private or share them with as many Sobamail users as you like. It's also possible to add/remove collaborators to your app after instantiation.