Re:You probably don't need a single-page app
by ryukafalz on Sunday February 17, 2019 @12:23PM
(#19185544)
>Plus you've got the extra layer of an API to maintain too
On the other hand, if you're providing a service that will always have an API, and you want to make sure that all the functionality you provide is nicely accessible through the API, building the frontend on top of it can be a good approach. The developers at the company I work for have done this, and IMO it's worked out pretty well.
Re:You probably don't need a single-page app
by IanCal on Sunday February 17, 2019 @12:43PM
(#19185678)
Possibly, though your perfect API design may differ significantly from your perfect site structure. It feels reasonable to consider both and see it as a positive if the use cases work.
Re:You probably don't need a single-page app
by eeZah7Ux on Sunday February 17, 2019 @05:44PM
(#19187375)
Nonsense. People have been doing that for years before the single-page hype. The servers generating HTML contents use the API as their own backend and you have better layering.
Re:You probably don't need a single-page app
by pvorb on Sunday February 17, 2019 @06:25PM
(#19187561)
Are you sure about that? Today I think this is a good model, but I haven't seen it in the wild before.
Re:You probably don't need a single-page app
by Scarblac on Sunday February 17, 2019 @03:30PM
(#19186682)
This is also the main argument that keeps me on the side of SPA for our own project, at the moment. Our product is a specialized database with a fancy GUI on top, but we have customers that only use the database through its API; by using it ourselves for our frontends we make sure everything is doable that way.
The other argument is that frontend developers are looking for SPA work because they see SPA work everywhere. There's an element of everybody having to go with the flow...
Re:You probably don't need a single-page app
by ericmcer on Sunday February 17, 2019 @02:08PM
(#19186190)
I definitely view being forced to build a sane API as one of the perks of a SPA. Having worked on some PHP pages with SQL queries, HTML, CSS, & JS all in a single file you would be surprised how people fail to separate concerns when they aren't forced to.
Re:You probably don't need a single-page app
by armandososa on Sunday February 17, 2019 @05:07PM
(#19187211)
How would you make it "even more complicated, and more likely to spaghettifi" to maintain an API than having to maintain a rich UI. Now that's a load of nonsense, or at least very misguided hyperbole.
If you can't separate concerns in a hybrid MVC pattern, you'll be screwing it up just as much in an SPA.
Plus you've got the extra layer of an API to maintain too making it even more complicated, and more likely to spaghettifi, not less.