ReactJS and Quart
From the perspective of the server, the JavaScript code is a static file, and so serving React apps with Quart is no trouble at all. The HTML page can be rendered with Jinja2, and the transpiled JSX files can be provided as static content alongside it, much like you would do for plain JavaScript files. We can also get the React distribution and serve those files, or rely on a Content Delivery Network (CDN) to provide them.
In many cases a CDN is the better option, as retrieving the files will be faster, and the browser then has the option of recognizing that it has already downloaded these files and can use a cached copy to save time and bandwidth. Let's name our Quart application dashboard
, and start off with a simple structure like this:
setup.py
dashboard/
__init__.py
app.py
templates/
index.html
static/
people.jsx
The basic Quart application...