Re:None of my projects want to be SPAs
by BerislavLopac on Wednesday February 13, 2019 @08:29AM
(#19152849)
It should be trivial to build a server-side client app in the same manner, using an API for any persistence instead of directly accessing the database. Most of the full-stack frameworks (Django, Rails, Laravel etc) are unfortunately still conflating the persistent state entities with business logic objects.
Re:None of my projects want to be SPAs
by em-bee on Wednesday February 13, 2019 @03:13PM
(#19156499)
you are of course right. there is no stopping anyone from doing that. in fact the university which initially developed the backend i am using has been doing just that, using the backend like a database, creating "frontends" in PHP.
though that doesn't negate the point of SPA which enables building clients that run directly on the users devices and are not hampered by the difficulty of emulating stateful clients on a server.
You are falling into a comfortable trap where it is easier to do the same. If you took the time to learn laravel your development time can be cut in half.
the backend i have is of course written in such a framework. (it's not laravel[0], but it could be)
i am not trying to diss backend frameworks here as bad. any of these would be a good choice for the backend.
the point is that thanks to SPA and CRUD i get to reuse that same backend over and over with little or no modification. (modifications amount to fixing bugs and very rarely adding new features to the API)
my backend development time now is effectively 0!
[0] (i have been working with laravel, django and others (primarily roxen and pike) before, and while i am not a fan of php, i did find laravel pleasant to work with)
SPAs bring back the client-server architecture we had before the web. you build desktop clients that consume server-api's.
server-side html generation now feels like cruft and an awkward way of building applications.