I'm building a Web application as an interface for a Business Network. I would like to reuse some of the REST Server functionality (e.g. GitHub login and storing cards in a MongoDB database) but do a few things differently. For example, I want to generate all cards on the server, so that the users won't have to upload them. Plus, I need to serve the static files from somewhere. I'm trying to figure which architecture I should use.
The app would serve 10's - 100's of users, potentially scaling to 100's of 1000's.
So far, I thought about these options: 1. Have a different app on a different port; REST endpoints called from the client. 2. Same, but REST endpoints called from the server (also means that I'll have to forward the login process somehow). 3. Extend the REST server with custom functionality (is it possible?). 4. Don't use the REST server but steal some of its code to use it in my app.
Questions: