Create a new project in Vue (npm create vue) to consume through an API in CodeIgniter 4

We are going to create a project in Vue using the Node ecosystem.

Let's start so for that let's remember that we are going to use Node to install what is our Vue so in case you don't want to use it you have problems with Node or whatever you want or you want to use the CD and you don't know how to start you can check at the end of the section if I already added something related to this I don't know if I added it depending on whether they ask me or not then if they haven't asked me you can ask me to add said development and if not well you can ask me anything then let's remember that we already started from what we did in the previous class which was

Advantages of Vue and Node

We'll just talk a little bit about what Vue is, why we're going to use it, and also that we're going to use the Node version with Vue, because here we have the entire ecosystem at our disposal and that's the one we're usually going to use when we want to do any development in viw, so here the small disadvantage we have is that we can't link Vue directly with the project, that is, we're going to have a project in codiner 4, which in this case is this one, and independently, the application in Vue, which is something that, for example, when we create a project in Laravel, we automatically have an integration with node, and with this we can install in the same project both our beloved Vue along with arabel, which would be everything we have here, but in viu in cader we can't do that type of implementations since it's not part of or doesn't bring us the Vue ecosystem by default through the node ecosystem.

So we have to do it in a separate project, although usually this is what we do, that is, what interests us here in CodeIgniter is the API that we built previously. and from here we want to consume it as simple as that, so usually that is done from separate projects, in this case we are doing a demonstration to consume the Rest API through a Vue application, but it can be a React Angular application, a mobile application, which at that point obviously is not going to be the same project, it is going to be a Flutter Android native application with escode with whatever you want

It is important to know that separate projects are usually handled, well here the first thing you have to do is position yourself somewhere where you want to create your project and execute:

$ npm create vue@latest

Important for us to be able to install in this case a dependency such as Vue, we first need a project, it is the same as we did with CodeIgniter 4 if we want to install a package in php.

Remember that it is installed here through composer, which by the way

npm is the package manager that is equivalent to composer, but in this case it is obviously php's composer and the package manager is not javascript with Node.

Once the project is generated, if we do not have the node_modules folder, which is where all the project dependencies are located, we must generate it. To do this, we execute on the root of the project in Vue:

$ npm install

- Andrés Cruz

En español

Andrés Cruz

Develop with Laravel, Django, Flask, CodeIgniter, HTML5, CSS3, MySQL, JavaScript, Vue, Android, iOS, Flutter

Andrés Cruz In Udemy

I agree to receive announcements of interest about this Blog.

!Courses from!

10$

On Udemy

There are 0d 03:50!


Udemy

!Courses from!

4$

In Academy

View courses

!Books from!

1$

View books
¡Become an affiliate on Gumroad!