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.
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).
I personally don't find NextJS appealing at all. It's so over the top, felt like it was adding complexity for the sake of it. Maybe it's a "skill issue".
Ultimately this all boils down to 2 things:
* your/your team's proficiency in the tech
* using the right tool for the job
I am not sure if you're trying to replicate some specific NextJS feature or if you're just asking what tech to use for your backend? If it's the latter, Django/Flask/FastAPI will do just fine. More than fine. It's boring, but it works.
My go to would be a simple REST API backend + ReactJS on the frontend. If you want to start mixing server side generation then there is a way forward but it depends on the nature of your app.
Thanks for feedback!
I like "Start simple, keep it boring" LOL
Yes, I am trying to replicate nextjs but using django instead for server side and still keep reactjs for client rendering part. I have been using reactjs + django from time to time.
I am wondering reason that people switched from nodejs + reactjs to nextjs. What is the benefit for that?
Well that's exactly the stack I used for some internal applications in a job I had.
Is a little bit tedious to set everything together, but other than that, is fine.
You most likely will lost some good DX stuff like same types in front and back (like with using tRPC and the like), but in general is pretty good: logic in python, UI in js/ts.
No, but at the time we were using a monorepo for both backend and frontend, so is feasible to keep an action that checks that the models in the front and the back are aligned on each pull request.
Very interesting. It's using django as API backend. Since they are already using nextjs do you know why they chooose django over nodejs for the API backend?
Honestly, this doesn’t sound like a bad idea at all! Next.js is great for frontend, and Django is super powerful for backend, especially for AI/ML stuff. The main challenge would be making Django feel as seamless as Node.js does with Next.js, especially with API routes and SSR. But if you can figure out a good DX, it could actually be really useful for AI devs who want a smoother frontend experience without dealing with Node. Would love to see a proof of concept!
Thanks. Yes those are exactly what I am thinking but you described way better than me! Plus there are so many reactjs template that AI devs could pick up. The difficulty would be how to make the django portion easier for reactjs dev to use and reactjs portion easier for python dev to handle.
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.
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).
I personally don't find NextJS appealing at all. It's so over the top, felt like it was adding complexity for the sake of it. Maybe it's a "skill issue".
Ultimately this all boils down to 2 things:
* your/your team's proficiency in the tech
* using the right tool for the job
I am not sure if you're trying to replicate some specific NextJS feature or if you're just asking what tech to use for your backend? If it's the latter, Django/Flask/FastAPI will do just fine. More than fine. It's boring, but it works.
My go to would be a simple REST API backend + ReactJS on the frontend. If you want to start mixing server side generation then there is a way forward but it depends on the nature of your app.
Start simple. Keep it boring.
Thanks for feedback! I like "Start simple, keep it boring" LOL Yes, I am trying to replicate nextjs but using django instead for server side and still keep reactjs for client rendering part. I have been using reactjs + django from time to time. I am wondering reason that people switched from nodejs + reactjs to nextjs. What is the benefit for that?
Well that's exactly the stack I used for some internal applications in a job I had.
Is a little bit tedious to set everything together, but other than that, is fine.
You most likely will lost some good DX stuff like same types in front and back (like with using tRPC and the like), but in general is pretty good: logic in python, UI in js/ts.
Nice! Did you use tRPC to pass server side data from python to javascript?
No, but at the time we were using a monorepo for both backend and frontend, so is feasible to keep an action that checks that the models in the front and the back are aligned on each pull request.
https://github.com/makeplane/plane this is a fairly big project done in django + next.
Very interesting. It's using django as API backend. Since they are already using nextjs do you know why they chooose django over nodejs for the API backend?
Depends, do you know Python, and the ecosystem around django? If not it's probably wiser to stick to javascript.
That said, you can accomplish some good things with Django.
Yes true. What if could take advantage of both ecosystm.
Yes, bad idea. It increases complexity and number of moving parts, breaking points without the need for it
Hahaha, I agree. I hope it can be at least better than reactjs + Django (API backend)
Honestly, this doesn’t sound like a bad idea at all! Next.js is great for frontend, and Django is super powerful for backend, especially for AI/ML stuff. The main challenge would be making Django feel as seamless as Node.js does with Next.js, especially with API routes and SSR. But if you can figure out a good DX, it could actually be really useful for AI devs who want a smoother frontend experience without dealing with Node. Would love to see a proof of concept!
Thanks. Yes those are exactly what I am thinking but you described way better than me! Plus there are so many reactjs template that AI devs could pick up. The difficulty would be how to make the django portion easier for reactjs dev to use and reactjs portion easier for python dev to handle.
What about plotly dash since it wraps react anyway?
Does django + intertia.js solve this usecase already?
Interesting! Have not heard about intertia. Lemme check it out! Thanks!