Hacker News new | ask | show | jobs
by votac 497 days ago
I don't know what is the benefit of using NextJs over React when managing a backend in django. You wouldn't necessarily even need React, just plain old django ssr.

Django and Next are both very opiniated and can basically achieve the same results.

Point by point: "1. React (Nextjs) is wonderful for frontend while pythong works perfect for machine learning (at backend)."

-Nextjs is a fullstack framework. You can use python with lighter backends too, for example Flask or Starlette. What benefits would Next bring is you're planning to use django?

"2. To demo or dev machine learning or AI related stuff we need some easy to start front-end framework. I have tried gradio but still wish the frontend could be replaced by reactjs."

-If you have a good grasp of React, go with it. Nextjs however is a lot more complex. You could also work vanilla for the front.

"3. Yes it's possible to create reactjs + Django app but think about reactjs + nodejs if comparing with nextjs."

-If you're talking about plain React, then whatever backend you suits your need (if ML-things, probably a Python / Go based one) will do. If you're planning to use Nextjs, it would make more sense to do as much as possible in Nextjs and host a lighter api / backend / lambdas for ai-stuff. Using express means using JS too in the backend. This isn't an advantage necessarily – HTTP doesn't care about the language of the backend.

1 comments

Thanks for feedback! Yes I have been using plain old django :) as well as reactjs/nextjs in enterprise product for a while. I have also used reactjs + django (as a pure api backend) but the experience is not as smooth as nextjs. However, when dev AI/ML application in terms of DX, python (django) is definitely way better than javascript based backend (nextjs or nodejs).