Skip to content
how to do a react flask app with python3 and nodejs in one repl?
Profile icon
h
has Hacker Plan
Travelbug

I'm wondering if I could use repl.it to develop a webapp that contains both, a python3 backend with flask and a nodejs frontent with react.

Basically I try to replicate this tutorial: https://blog.miguelgrinberg.com/post/how-to-create-a-react--flask-project

Is there a way to configure a repl to run python3 AND nodejs?

You are viewing a single comment. View All
Profile icon
Coder100

React is for js frontend. It works well with node.js because of things like webpack and babel, but you can still have a flask backend.

https://www.youtube.com/watch?v=YW8VG_U-m48

Profile icon
Travelbug

@Coder100 Thanks for the video, thats a great tutorial. I am aware of how it works. I just want my npm, yarn, react and all the stuff I use to develop the frontend in the same repl that I use to develop the backend, so that I can work on both at the same time.

This means I have to have node.js installed in the same repl as python3.

And I can find no way to do this.

Profile icon
Coder100

@Travelbug it already is, try doing node

Profile icon
Travelbug

@Coder100 Okay, this was a bit confusing. Did some digging and found out that:

  • If I create a node repl and add a python file (.py) to it, then it would install node and add python2.7 automatically. For my project I need python3 though.
  • If I create a python repl and add a javascript file (.js) to it, then it would install python3.8 and add node automatically.

So this seems to solve the problem for now. I just have to FIRST create a python repl and then add node, not the other way round. I really think there should be a way to manage installs and versions besides relying on automatic detection and import though.

Profile icon
GibranValle

@Travelbug Great info! just what I needed