Im working on an application where the client-side interface and backend server are completely separate applications. The backend is written in Ruby and only serves JSON via HTTP. The client is a completely static single-page browser application that communicates with the JSON API. I now need to build an administrative interface that will be used to curate content served by the JSON API.I see a number of ways I could conceivably build this:Extend the existing single-page application. Initially this seemed like the most obvious way to do it because I already have a lot of existing code for communicating with the API. The downside I see here is that the admin section would feel very tacked on. The admin concerns are largely orthogonal to the functionality of the existing SPA and Im not convinced the amount of code reuse would actually warrant combining the two applications.A separate single-page application. This could work fine. I would have to duplicate some code from the existing SPA but I think this makes a little more sense since the admin interface very much feels like a separate application. The admin area does not need a spectacular UI, though, and a traditional server-rendered web application might be a way to reduce the development effort required to build the admin interface.A server-rendered web application. All the server-rendered web applications Ive built in the past have been directly connected to a database. This, however, would need to communicate with the JSON API on each request. Im sure its possible but its not very familiar to me and dont see much discussion about this approach.A server-rendered web application in the same process as the JSON API. This way the code rendering pages for the admin interface can directly access the db/model layer and doesnt need to make separate HTTP requests to render the page. The part I dont like about this is that it complects the API code with UI code and Id rather keep those completely separate.Ive been considering the tradeoffs in each of these cases and would be very interested to hear others opinions. Have you developed a similar architecture? Which approach did you take and why?
What's the best way of building an administrative UI for an existing SPA application?
web development;web applications;api;json;client server