Reputation: 815
I'm working on a Phoenix + ReactJS app and so far all the tutorials I've seen on the internet seem to install React inside the Phoenix directory:
Now I have 2 questions regarding this:
first of all, is it a good ideea? Most SPA projects I've worked on had their client side code split from the backend code. There are also several advantages to doing it this way. Why do Phoenix developers tend to go the other way around?
if we do separate the frontend from the backend how should we actually do it? What are we supposed to configure and how?
Upvotes: 2
Views: 540
Reputation: 8270
It's perfectly fine to separate front-end and back-end code into separate repos. When you're first starting an app, that's often overkill. Additionally, Phoenix's response time are superb, so you're not going to see incredible benefits from putting your static assets on a CDN (compared to doing the same with, say, a Rails app).
If you do separate them, put your static assets on a CDN and deploy your Phoenix backend just like you would with any other framework (AWS, VPS, Heroku, etc.)
Upvotes: 2