markfinger / python-react

Server-side rendering of React components
MIT License
1.62k stars 116 forks source link

Is python-react adapted to my use-case #62

Closed choucavalier closed 8 years ago

choucavalier commented 8 years ago

I am new to React (and, thus, to python-react).

I want to build a web user interface to display real-time data.

I have a python program running on the server-side that retrieves data from a data provider and does some processing on it.

What I want to do is link my program to a client-side real-time user interface to visualize it.

Questions
  1. Considering my use case, when looking at python-react am I looking at the right thing?
  2. From what I understand, python-react renders components on the server-side and then sends the rendered HTML-JS to the client. Am I correct?
    • Yes: isn't that slow? I think there is some state concept in React. Wouldn't it be faster to send state updates?
    • No: what is happening then?
markfinger commented 8 years ago

Sorry for the delay in responding, I was travelling.

In answer to your question: probably not.

python-react is just a bunch of boilerplate that aims to solve the problem of pre-rendering React components, so that your markup is visible before the page load.

For your use case, I'd recommend a socket server that pushes to the clients.

If you want to use python for the backend, you can use something like twisted. I've worked on some small scale real-time stuff with Twisted + Django: seems to work well, not sure about scalability though.

If you want a js backend, node + socket.io + express works well.

markfinger commented 8 years ago

Not sure if that answered all of your questions, but feel free to ask if there's anything you're wondering about.