Customization as Microservice

By Revant Nandgaonkar September 19, 2017 Integration 1 comment

Traditional Custom App Microservice Custom App
It is part of the same server, database, site, environment, assets.
It is on different server with own database, site, environment, assets etc.
Upgrades along with other apps. Can have its own release cycle
Migration and retirement of the app is complex and endangers whole system Migration and retirement of the app is independent of production ERP
Can compromise data integrity or system security In case of compromise, ERP Data and system is safe 
Privileges of app to access system and user resource cannot be restricted by user User has the control to allow or disallow app from using ERP resource. App access can be revoked
Based on Frappe Framework only and communicates via Python and JS api Can be based on any framework including Frappe on any device and communicates via OAuth 2.0 and REST API


  • Frappe ERPNext is fast changing
  • Not upgrading ERPNext as per the release schedule means missing out on lot of features and fixes
  • Custom app blocks upgrade and may have migration complexities
  • Custom app fails and takes down whole system
  • What is not worth going into core as a pull request may be unreviewed patch work or hack


  1. Setup Social Login such that the primary ERPNext server is in your Frappe Server URL. e.g. SaaS Server URL
  2. The microservice always signs in using primary ERPNext account
  3. AndroidAccountManager, ERPNext Connector or equivalent OAuth 2.0 Client is installed on Microservice app
  4. If microservice is a frappe app, relevant Link fields must show upstream doctypes. ERPNext Connector is hacking this in with Connector DocTypes which query upstream server db for instances saved there instead of showing local data
  5. Whenever user enters such link field the upstream docnames start showing and latest docnames are saved locally for saving data in link field
  6. If there is any change on upstream server, Webhook can inform it to microservice
  7. Even Android app can use login via Frappe. Check out MN Technique's App Showcase for Android app using this approach

Note: Read Documentation Frappe > Integration for more information

Signed in to Primary ERPNext Server with nothing installed e.g. SaaS Server

Item List on ERPNext

Custom App login with Frappe

Signed into Custom App

Upstream Items in Custom App Query

1 comment
Hanstel February 17, 2018

Hi, very nice article, can you please show us a full example of this method, this will help a lot.

Add Comment