I'm a kinda confused about API please point me in the right direction
We want to develop an e-commerce website and Mobile apps as well with one database, my doubt is how to create a n API so that both app and the web interact with database or is there a better way to do that. What is the best architecture to achieve this
Yea, an api is a good option in this case . Think of an api as some service that just spits out data . Therefore your web app will just consume this data, as well as your mobile app . Laravel or Lumen are the best options for such a task . You can build your web app with a framework(kind of ) like Vuejs , Angular, or any of the popular ones out there , and these will just consume data from Laravel/Lumen . https://www.youtube.com/channel/UC4gijXR8cM4gmEt9Olse-TQ . This channel might give you an idea of how things work with vuejs . Also , the mobile app will communicate with the same api .
Little stress relieving option : You might not want to build a complete SPA website , so u still can use laravel to build your web app, then create an api for your mobile app , which will simply be creating exactly the same backend app structure, but with a stateless architecture
I made a small project for a class using Ionic and Lumen, working with Ionic using html, js and css and Lumen for backend makes it feel like building a website.
@maitrefrantz If i want to build a website on top of a Laravel API i need to use some front end MVC like "React.js or Angular.JS or Backbone.js" something like that right
what i understood from above is that i have to implement all the functionality(cart) in laravel
and just tell the Vue what to display and what not. my concern is how the cart works without page refresh
Could you please point me to some tutorials or existing work or any github projects
I didn't mention anything about cart functionality. If you want to implement it in your Vue.js File you are free todo so.
You should learn the functionality off the api of Laravel then return your data from there and then consume it in your Vue files so the page is actual reactive.