
Ask HN: Have you built apps with Vue and Rails? Any opinions/learnings? - mmanfrin
I&#x27;m building a site using vue and rails and I&#x27;m torn between building separate apps and then just treating rails as an API, versus building the vue frontend inside rails. I feel with the latter there may be some synergies in wiring up things, whereas the former would mean I can build the Vue app as strictly idiomatic as possible.
======
dyeje
I've used React and Rails together. Unless your app is highly interactive, I
would do the frontend in Rails. You can use helper methods to render the React
/ Vue / etc components alongside your regular markup. In some cases, you can
even pass the data directly into the component avoiding an API call at all. To
me, this is the best of both worlds. You let Rails do the heavy lifting and
bring in framework components when you need to do something complicated /
interactive in the frontend.

------
hazz99
Although I don't have experience with Vue and Rails specifically, I've always
found it beneficial to have the front & backend separate. It's really nice
have the backend API completely decoupled from eachother.

It also depends on what your goals are - for a personal project, do what you
like! Whatever is quickest & easiest is best.

For more public-facing services, I prefer to have the decoupled structure.

------
nik736
I am currently wrangling with exactly this and after trying both ways I would
always prefer using Vue CLI completely separated. The thing is though, after
going through all of this I would completely skip the frontend JS mindset and
just use server rendered templates. Development speed is so much faster and
Turbolinks + some JS here and there is more than enough for 99% of projects.

