DEV Community

Bret
Bret

Posted on

what Backend is recommended for VUE or REACT?

When your using Vue or React, what Backend is preferred to use? I've been using Django and Python, but that's because I've been focused on Python for a while. I kinda like Javascript, but tutorials don't completely use what there teaching in "context", they pretty much end at "console.log" and don't implement the last 1 or 2 different steps to take instead of that.

Top comments (14)

Collapse
 
matiasvj profile image
Matias Verdier

There is not preferred backend technology to use with Vue or React, you can use wherever you like and feel confortable with, you could write or rewrite your backend in any framework, and as long as the API remains the same your frontend (Vue or React) shouldn't care or know about it.

With that said, is true that you would find more resources using node and Javascript frameworks for the backend simply because it's the same underlying language, making that more common I guess.

I would recommend taking a look to github.com/gothinkster/realworld to see examples of an app build with a lot of different languages and frameworks but using the same API.

Also feel free to ask if you have more questions about this or about a specific tutorial or topic.

Collapse
 
aisirachcha21 profile image
Ryan Kuruppu

The technology you use for your backend is entirely dependent on the use case you have. You could just stick with Python and write an API using Django or Flask or use another Lang and framework like C# and ASP.NET Core to build it.

If you need Server side rendering, nodejs would be your best bet. And like this your requirements will change.

If you're just doing it to learn something new. First learn how to build and connect the API in Python to a React app and then move to learn a new language/framework

Ultimately it's what you want out of your API that decides the technology you use.

Collapse
 
yobretyo profile image
Bret

Ive been using Django and like how creating fields and accessing the data is really easy. React, with hooks, kinda adds clutter to the steps.

Collapse
 
aisirachcha21 profile image
Ryan Kuruppu

Well everything has its pros and cons. But frankly if you do it right react with hooks is more helpful than you realize. When things start messy that's when you should start looking into the context API and then if it gets more complex you'll need to look into state Management libraries like Redux or MobX

Thread Thread
 
devhammed profile image
Hammed Oyedele

Things getting messy using context API depends entirely on the Developer.

Thread Thread
 
aisirachcha21 profile image
Ryan Kuruppu

Not if you're using for it's designated purpose. If you end up making contexts for too many things then you've missed out on using something like Redux to reduce that problem. But using Contexts for the right problem is what makes it useful

Thread Thread
 
devhammed profile image
Hammed Oyedele

You have been lied to, there is absolutely nothing wrong with context API or creating contexts to handle different things, even react-redux uses it under the hood.

Thread Thread
 
aisirachcha21 profile image
Ryan Kuruppu

I never said there was anything wrong with it. I simply meant that there's a time and place to use the Context API and that you shouldn't use it for everything. There are times where you may need to shift to something bigger like redux. But you shouldn't if it's not required.

Collapse
 
cwraytech profile image
Christopher Wray • Edited

The suggestions to use Nuxt or next on here is very interesting. No and no.

If you are building an api to interact with a front end, then it should be built with a backend web framework.

You could use a node backend framework like nest, or continue using django/python but build only api’s that interact with a Nuxt(Vue) or Next(React) front end.

Nuxt and Next are front end frameworks.

Collapse
 
shadowtime2000 profile image
shadowtime2000

If you keep them decoupled in a good way it just shouldn't matter. As long as the different languages's servers operate the same way the frontend wants then it's fine. Using NodeJs is pretty cool but you could also look into a framework like NextJS or NuxtJS because those both I believe allow API routes which can access databases and CMSs and stuff.

Collapse
 
karandpr profile image
Karan Gandhi

Any REST framework should technically work. Django, Flask, Laravel, Rails, ExpressJS, Spring, whatever works. PHP gets a lot of hate but it has libraries for everything and can be hosted easily.

Collapse
 
ericchapman profile image
Eric The Coder

I agree. I have develop in almost all of them. If it’s only for a api, anything can do but if they want to do a full backend web app with api but also with things like sending email, run schedule job, etc, take time too choose something you will be confortable with.

Personally, I really like Laravel. It make full usage of modern PHP OOP. The MVC project is well done and very easy to learn and scale. The documentation is clear and write with beginner in mind. And like you said there tons of well maintain librairies ready to use in production.

Collapse
 
dennisfrijlink profile image
Dennis Frijlink

It doesn't really matter which backend you use for the (frontend) framework Vue.js or library React.js. It more depends on the case you have.

If you wanna build the backend in javascript I prefer Node.js + Express. If you wanna stay up to date with the new techniques you can also choose for deno.js. It's new, innovative and made by the same who made Node.js (Ryan Dahl) focussing on productivity.

Collapse
 
dabjazz profile image
Yash_Jaiswal

If it's angular, I'll go with spring boot, if it's react I'll go with node, if it's Vue I'll go with flask/django, if it's moon/solid I'll go with deno/flask/bottle