Welcome Guest, Not a member yet? Register   Sign In
Codeigniter API + Vue Front project in same folder

Hi guys

I have 2 separate folders

One contains a CI4 AppStarter project, which will be mainly a Resourceful API with basic panel, auth, etc.
Accessible through http://localhost/project/api

The other folder contains a Vue cli project
I'd like to have both frameworks in the same folder and to start the Vue app through

Is there any recommendation to configure both and later deploy to a shared hosting ?

Thanks a lot for any tips you can give me

(This post was last modified: 03-30-2022, 12:59 PM by ignitedcms.)

Not sure you can do that (putting them in the same folder), normally you would be serving your vue app with something like nuxtjs somewhere else, sometimes even on a separate IP especially for SEO as the web crawlers need something to hit first time round, but to be honest I've never bothered to use it like that.

I always tend to use Codeigniter with vuejs as a cdn that way there's less to worry about in terms of things like SM, DI and other javascript framework centric paradigms.
Practical guide to IgnitedCMS - Book coming soon, www.ignitedcms.com

Hi @ignitedcms

This repo will contain a private local application, so I won't upload to Internet, no need SEO stuff, etc.
I've loaded Vue from CDN in CodeIgniter views for testing, and that worked. But Vue dev prefers to use cli, and sent me instructions to use (vue create xxx) etc.

Therefore I must build something with both (CI, VUE -cli) that can live in same folder

As far I tried

1- vue create myapp
2- cd myapp
3- composer create-project codeigniter4/appstarter --no-dev api

So I guess I'll begin with this approach, "api" subfolder inside the Vue project and see how it goes

(This post was last modified: 03-30-2022, 01:15 PM by ignitedcms.)

Yeah it's worth a try, I'm assuming if the devs are building it from a CLI it is going to be an SPA so there are probably a few other little gotchas to keep an eye out for like client side routing etc. Good luck
Practical guide to IgnitedCMS - Book coming soon, www.ignitedcms.com

Theme © iAndrew 2016 - Forum software by © MyBB