Re:You Shouldn't Start with an SPA
by paxys on Friday February 02, 2024 @11:18AM
(#39230396)
This article (and all others like it) always ignore the fact that mobile exists. Nowadays "front end" isn't just HTML pages being rended on some browser but also entire iOS and Android apps and maybe several others. Those APIs you think are an overhead are actually necessary regardless, and after that it's your server rendered HTML that instead becomes an additional burden to maintain. A SPA with dedicated front end engineers using the same APIs as the mobile ones is the most sensible approach for most apps.
[ Parent
| on HN ]
I've done this. I spent six years building and maintaining an API platform to support apps and websites.
I'm fully aware of mobile and the need for those APIs. They just weren't sufficiently overlapping to be of any use to an SPA.
You need a whole slew of separate endpoints and behaviour, so it may as well not be an API - just make it a server-rendered monolith and move along.
Why would your mobile apps and browser client be so diverging that you need a completely separate set of APIs for both?
Because they were entirely different applications. It was an API platform for a suite of applications
There was almost zero crossover in functionality
Ok sure, but 99% of applications out there do not fit this description.
If you're building an SPA that's identical to a native app, I think someone in the exec team is making poor decisions
Either make a web app or a native app... don't do both
The only difference between a browser-based (or Electron) SPA and a native app is which runtime and rendering engine you are using. Why would API calls to the backend be different in either case?
Sure. But we're talking about needing the same API for two separate clients...
That infers building both and I'm questioning why you would build both if they're identical. Just build one and get your users to use it
Look around..no one is building native clients for every desktop OS anymore. Web, iOS and Android are the way to go for modern apps.