Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

GTHell's avatar

How to separate frontend and backend completely?

I want frontend to only fetch api from backend using one of the js library like axios or superagent. I can't seem to understand how can one make a route without having backend?

0 likes
4 replies
jlrdw's avatar

Doesn't node.js directly work with apis.

biishmar's avatar

@GTHell use angular 5 in frontend and laravel in back as api. angular have their own route function.

1 like
spekkionu's avatar

You will likely want to use a front end framework to handle routing for you. Common options for this are react with react-router, Angular, Ember, and Vue with vue-router. There are dozens of javascript mvc frameworks out there. Vue seems to be the most common choice for the Laravel community (especially on this site) and react is probably the most common choice overall. You can watch some of the videos on this site to get started with Vue.

1 like
GTHell's avatar
GTHell
OP
Best Answer
Level 3

I know react and react-router but making a site in react can sometime take more time then it is intended. I'm not advance enough to develop website with it. There is a library call Sammy.js for frontend routing but I want to make thing as small as possible for the front end. I just think that there might be alternative to react or angular and vuejs.

Component base and the good stuff available in those framework are great but for a smaller website that would need only simple api call to the backend is a bit overkill.

Why I try to avoid those framework? Styling in react just make me feel less productive. Don't know but I've been building a web app for my portfolio using react and the bad part is arranging the style. I prefer normal that why I ask for simple frontend routing.

Thank for your suggestion. Seem like I can't escape from react at all.

Please or to participate in this conversation.