Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

App development setup with PHP and Vue.js

I am new to Nextcloud app development and would like to create a simple app to play around. I saw that some apps are made with Vue.js, so I’m asking if there is a guide out there?

I generated an app skeleton and played around with the PHP templates but unfortunately I don’t know PHP and would like to create a Vue.js project into this existing demo app.

I found some premade Vue components for Nextcloud

https://github.com/nextcloud/nextcloud-vue

but no step by step guide on how to setup the Vue project after creating the skeleton app. I just saw that the Nextcloud app Tasks is also using Vue.js within the PHP code:

https://github.com/nextcloud/tasks

Thanks a lot for help.

like image 631
hrp8sfH4xQ4 Avatar asked Jun 19 '19 06:06

hrp8sfH4xQ4


People also ask

Can I use PHP with Vue JS?

It is possible to use any front-end framework with PHP, since PHP works only on the back-end. The best thing you can do is create an API with PHP, which you will use to operate the database and do all back-end tasks. Then, you will use Vue. js to communicate with PHP server using AJAX and display the data to the user.

Can we use Vue JS for mobile app development?

NativeScript-Vue is a NativeScript plugin which allows you to use Vue. js to craft your mobile application. NativeScript-Vue is one of the most popular solutions for native mobile apps with Vue.

Is Vue JS good with laravel?

The Laravel Vue js combination is the perfect choice for any single-page app development and its popularity is increasing among developers worldwide.


1 Answers

I've looked at the repository you mentioned and it's fairly easy to setup, the question is what would you deserve after setup? If you clone the repository you have something like a 'working copy' of the plugin. But this Plugin needs to be build and the resulting package needs to be copied to right location at the nextcloud server (or maybe you have to install the package over frontend). This is some type of plugin and not a full web application which could run standalone, as I understood.

It's not like you said:

Nextcloud app Tasks is also using Vue.js within the PHP code

It's more like PHP is used for Backend and Vue is used for Frontend, these two 'projects' are completely independent from each other (PHP is backend and Vue is frontend there are no direct dependencies). Just create your Vue application (after build you will have an index.html and several js and css files) these files have to be available from browser. Then your applications entrypoint is the index.html. For PHP: You will just define Interfaces and Routes here which will give you the possibility to interact with the serverside. Then later to deploy your plugin, you have to package it in the format nextcloud needs. You can read from Makefile in the Tasks repository what happens if package is created.

I think a good starting point for you would be: https://docs.nextcloud.com/server/15/developer_manual/app/tutorial.html

like image 155
kSp Avatar answered Sep 28 '22 03:09

kSp