SvelteKit + Laravel API vs Svelte + Inertia + Laravel #10216
Replies: 3 comments
-
Personally for me I would build the full application in Sveltekit if there is no need to have any API which will be reuse by other clients. This approach would reduce the amount of work needed. There a few draw backs with using Svelte with inertia:
I know laravel is really powerful, if you really want to use Laravel then I would recommend using Vue with Inertia. |
Beta Was this translation helpful? Give feedback.
-
We've done several combinations of Svelte+backend in the past, and the two approaches that worked best for us were a) full stack SvekteKit for everything and b) SvelteKit with external GraphQL APIs. Type safety is important for us and with SK only or SK + GraphQL that was well possible. I have no experience with Inertia nor Laravel (we're using ASP.NET Core), but personally I'd cut out as many middle men as possible. SvelteKit is good at building frontends, Laravel is probably good at building APIs. From what I read, I don't see to much benefit from using Inertia. Personally, for simpler apps (I'm not saying "small", more in the sense classic "request > DB stuff > response" style apps"), I'd go for SvelteKit only if possible For apps that may grow into something more complex (say using a stateful multi node actor system cluster), I'd use SvelteKit + a (ideally single typed) API. In the end, it depends mainly on the requirements, team structure and maybe what's already there. Bonus exercise: add streaming promises for secondary data plus trpc or GraphQL subscriptions for super snappy user experience. |
Beta Was this translation helpful? Give feedback.
-
Another advantage for using SvelteKit as a SPA with a PHP API, is that you don't need a NodeJS server. Instead almost every webspace is good enough to running your app. Btw, maybe that channel is interesting for this topic: |
Beta Was this translation helpful? Give feedback.
-
Hi guys, i wanted to get your opinion, i want to use a Laravel backend with svelte as my Frontend, but can't decide between these two approaches.
Would there be any drawbacks if i decided on using Svelte with Inertia instead of SvelteKit with an API? Because i can't seem to come up with any.
The biggest Inertia advantage for me, which is kind of subjective is that it would all be in one repository, as opposed to having two separate ones. But that is my preference.
Help would be greatly appreciated.
Beta Was this translation helpful? Give feedback.
All reactions