3 ms·
Can anyone point me in the direction of any SPA framework well integrated with a backend framework that can make me as productive as Django, Laravel or Rails?
by jcmontx 4y ago
Can anyone point me in the direction of any SPA framework well integrated with a backend framework that can make me as productive as Django, Laravel or Rails?
- vosper 4y agoIt’s hard to know hot productive you are in those frameworks, but I’ll take your question at face value: if you were an expert with NextJS, Typescript, and Prisma or Hasura then you’d be pretty dang productive.
- floucky 4y agoSPA just use APIs so most of frameworks are compatible
- Nextgrid 4y agoThe problem is that you now need to either make resource-oriented APIs for every model in your DB that your frontend may need to access (even if just for internal business logic) or make RPC-style endpoints that do the business logic. That's significantly more work than just doing whatever logic you want on the server to begin with where you have access to all tables directly (they're an ORM call away) and not have to worry about access control because all of this still happens within the trusted environment of the server.
- hombre_fatal 4y agoPerhaps you could elaborate on what you mean, but from my viewpoint there isn't much daylight between DB-queries in most server-rendered apps vs. SPAs. Instead of this: def endpointAB: a = db.getA() b = db.getB() return template('ab.html', {a=a, b=b}) You tend to have this: def endpointAB: a = db.getA() b = db.getB() return json({a=a, b=b}) When I think of ways you may want to generalize over arbitrary queries on the server, I run into the same challenges you'd have in a SPA rather than fewer.
- tpetry 4y agoThis is not really what you had been asking for but inertia.js is doing a spectacular approach of combining Laravel and a SPA. All the benefits you have with MPAs and no need to build APIs for the SPA view part. That‘s the only SPA model I have seen which is a real productive approach.
- jcmontx 4y agoThis might be what I was looking for
- DangitBobby 4y agoI think remix (remix.run) is really close. You can use it to easily build a site that fully functions with JavaScript disabled (seriously, at one point while building the demo app I disabled JavaScript and there was no observable difference in functionality), or one that just does SSR with hydration and client-side navigation. The framework is built and maintained by the people who did react-router and you can tell that it's very well thought out. It seems to fill a similar niche to Next.js but it has some clear "second system" advantages, IMO. I find myself very productive in it, especially compared to trying to build a highly interactive frontend on top of a Django app. The tutorial app on their website does a great job of demonstrating the capabilities of it and the patterns you'll expect to use, and you should be able to follow along in one long coding session. It doesn't have built in auth, admin, or ORM, but it heavily advocates for the use of Prisma which is probably your best option for ORM in js. So far, no node ORM really comes close to Django's in terms of capabilities. They don't really even try on the production-ready migrations system. However, you could always use Django to get auth (change your hashing to bcrypt and get a bcrypt lib from npm) and admin for free and use `prisma db pull` to keep your Prisma schema definitions (and corresponding type modules) in sync.
- abraxas 4y agoVaadin