My web-app server is Rails, but it needs to execute Reason code (pure, stateless) for certain requests. This code is wrapped in an HTTP endpoint with bs-express and runs on Node on the same box. The Rails server talks to it locally.
The web UI is part of the Rails codebase, and it is written in ReasonReact. There is also a web-worker that is almost identical to the Node server. But this one runs on the browser.
All three of them - Node, webworker, and ReasonReact UI - relies on a common Reason codebase.
It is structured like this:
The Node source tree is within the Rails directory. It is a thin folder with just an HTTP entrypoint. All other code is in common-core. Its bsconfig.json looks like this:
This required a non-standard Rails deployment: a single git repo that serves two applications. But no other hacks.