Consider creating an npm package that maps the CouchDB security model to the Cloudant security model. This package would replace the code in this application which maps the requests from PouchDB Authentication in the frontend to Cloudant on the backend.