What's the Best Approach to This Project?

Bruce Gust
Bruce Gust used Ask the Experts™
on
I've just finished a short tutorial on Laravel using an API with some Vue.js thrown in.

Done!

I'm also working my way through another tutorial that doesn't use an API and is pure PHP.

After getting a taste of both, I'm looking at a project that I'm building in Laravel and I'm contemplating two different approaches and I want some other eyes on this thing because I really don't know what I'm talking about.

It would appear that you use Vue.js when the priority is a single page application. For the administrative suite, I plan on using TinyMCE for the word processor. The tutorial I went through didn't accommodate a full page for the editing of whole pages. Instead, it was very small piece of the page and the SPA dynamic worked great. But I don't see it being necessary or beneficial with the Admin suite.

For the actual page, absolutely. But not for the administrative piece.

Is that a reasonable approach or should I plan on keeping it the same format across the boards? I guess what I'm asking is, "What is typical?" Do you keep the entire site working as an SPA with Vue.js or is it common to incorporate Vue.js and straight PHP?

Or do you just do what you want and not worry about?

I want to incorporate best practices right out of the chute, hence the question.

Thanks!
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Most Valuable Expert 2018
Distinguished Expert 2018
Commented:
Hey Bruce,

I think it's difficult to define what's typical. The beauty of web development these days is the flexibility you have. It can sometimes be a little overwhelming, particularly when starting a new project - lots of questions about which stack to use the front and back end.

Every project has it's own requirements and every developer has their own preferences and skill sets.

For the front end, if your app suits the SPA style of working, then use Vue. If it works better with a more traditional style, then go with that (perhaps using the web aspects of Laravel).

For the backend, you could write all your own functionality in PHP. If it's a simple app, that might be the way to go (regardless of Vue / Traditional). If you choose to use Laravel, then you already have a well structured platform that includes authentication / logging / testing / routing / database / email / debugging etc. right out of the box - these things may be a deciding factor.

And there's no reason why you can't mix and match. Create an API in Laravel to handle the data models. Create your website in Laravel (calling API methods in your controllers for the data), and include Vue Components on those pages that you think need it (again, pushing requests to the API if needed). This way, you have one source for data access (API), a traditional, multi-page site from Laraval and some dynamic Vue components thrown in for some nice interactivity.
David FavorFractional CTO
Distinguished Expert 2018

Commented:
Best to first describe your actual target project.

Laravel may or may not be a good choice.

Glancing at vue.js docs, this code is great for browser centric projects.

If your goal is to get a blog up + running + generating income in a few hours, you'll use WordPress, as CMS/Blog projects of any size/flexibility will require backend server data, like an SQL database.

Other project types, have other approaches.

Start with your actual project, then choose tools matching your implementation budget + timeline requirements.
Bruce GustPHP Developer

Author

Commented:
Thanks, Chris!

I think I'm going to do just that: Where a SPA dynamic is the most logical choice in order to ensure an optimum experience for the end user, I'll go with that. For the Admin piece, I'm probably going to go with the Laravel "out of the box" advantages just because, again, of the way they serve the end user in the long run.

David, thanks for weighing in!
David FavorFractional CTO
Distinguished Expert 2018

Commented:
Suggestion: Open another question describing your exact project including function provided, how user interaction will occur, monetization strategy.

Then ask for design suggestion.

Likely you'll have a wealth of great comments to assist with your design.
Most Valuable Expert 2018
Distinguished Expert 2018

Commented:
Hey Bruce,

No worries. I think that makes sense:

Laravel Web for the Admin UI
Vue for the User UI
Laravel API for the data access

This will keep your data layer in one place (both the User and Admin sites use it to access the data). Later on, you can add static pages to the UI and Vue Components to the Admin without effecting your Domain Models. Gives you good flexibility and scalability.

Good luck with it

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial