nrudolph's avatar

Advice needed - Vue or Livewire for CRM app

Here is the situation - I am developing a custom CRM app that stores customers, communication records, quotes, and many other types of interrelated data. Each instance of the app will have a small number of users, under 50, and in normal use the users will be going back and forth among forms to edit and create data, view data in different ways, etc. Performance and reliability are important.

I am somewhat new to Laravel and full-stack development (been working with Laravel a lot for the last year), when I first started this project I went with Laravel + Vue + Inertia. I am very familiar with JS and with react and vue frameworks and I chose this set because of my familiarity with the frontend framework. However I began to run into the complexity of dealing with client-side caching and having to create a large number of API endpoints for all the different forms of data that the application interacts with.

Over the last couple months I have been looking into using Livewire 3 as an alternative. I love the simplicity of being able to interact directly with models and php controller methods. If I need a collection with custom business logic applied for a single component I can handle it in the Livewire components php class without having to write a controller method and API endpoint just for that single component. However, I have been having growing frustration with blade for the frontend (possibly just from lack of experience) and I don't like the lack of 3rd party libraries and documentation of Livewire as compared to Vue.

So here are my questions that I am looking for some advice on:

  1. Is Livewire objectively better/easier in the long run for applications that have a relatively small number of users and do not have to have a completely decoupled front end and back end? Or is it just personal preference.
  2. If internet speed is not a big concern with the applications users, can I just skip most of the client-side caching problem I was running into with Vue and opt to just send more requests from the front end to the API to avoid trying to manage state in the front end? Does this cause a lot problems as the application grows in complexity?
  3. Is there are framework or solution that I am not aware of to have the freedom of JS front end development with Vue and the simplicity of being able to eliminate the API and interact directly with PHP from component code?

Thank you for any advice that you can provide, I know whichever route I go will have its own downsides, I just am not sure which stack will give me the least overall headache down the road as the application continues to develop. Thanks!

0 likes
3 replies
martinbean's avatar

@nrudolph What’s wrong with just standard controllers and Blade views if “performance and reliability are important”?

However, I have been having growing frustration with blade

Blade is just a templating language. What specific frustrations have you been having? Livewire also isn’t going to alleviate this, since you use Blade templates with that as well.

nrudolph's avatar

@martinbean Thanks for your reply! So I worded it somewhat poorly, my frustration is mainly with Blade + Alpine + Livewire 3 development environment as compared to JSX frameworks. And again it is probably a lot that I am used to JSX and much less experienced with Blade. Here are some of my specific frustrations.

  1. The added complexity of having state from PHP and state from Alpine for relatively simple things like defining custom "select" components. And just generally I miss the ease of JSX.
  2. The increased complexity of developing standalone components that need some custom logic. In JSX it is super easy to create a component and write scoped JS or import packages, anything that is needed, all in one file that is super easy to reuse and understand and it is easy to use JS variables for things like custom styling that is determined by JS. With Alpine + Blade it is not that I can't get the same functionality to work but it seems much harder and less intuitive. Again probably lack of experience on my part. Also side note I personally am not a big fan of livewire components having separate files for php and blade templates. I have looked into the Volt package for Livewire as a solution to this as it allows you to put php directly in the blade files but I have found limited documentation on it.
  3. The difficulty in importing and using npm packages in blade

TLDR; coming from JSX it feels as though it is more complex and difficult to develop UI. The only thing I didn't like about Vue + Inertia + Laravel stack was how decoupled the back end and the UI are.

jlrdw's avatar

@nrudolph Just use laravel and blade or laravel and use php as the template language. I have had no problems using this with regular javascript and fetch js.

I only use the "packages" that come with laravel. I don't even have npm, not needed. Vite, not needed.

I see so often apps that suddenly my special so much needed package is no longer maintained, and suddenly the person has to role up their sleeves and code.

The "datatable thing" is an example, not needed, I learned a long time ago how to write my own "inplace editing" and add on the fly routines. Yes a little learning curve but worth it later.

Just some thoughts on it.

Edit:

Also you could look at some CRM's based on laravel.

Also a good series: https://laracasts.com/series/javascript-techniques-for-server-side-developers

Please or to participate in this conversation.