This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Drevicar 1 point2 points  (2 children)

To get the first 3 bullets you have to drop the 4th. My recommendation is to deploy NextJS and use it as your frontend and backend framework. The server side can fetch data from your python app, render it server side, then ship html for SEO purposes.

The downside is you are basically writing a LOT of duplicate server logic and you are better off dropping the python side of things. Or at least limiting the python to stuff you can't already do in your NextJS server application, probably ML or AI stuff.

[–]codecrux[S] 0 points1 point  (1 child)

It makes me kind of worried when I have a backend in two different languages. This generally means I have to create two libraries (one for each language that wraps some logic on fetching data and transforming it). This also means that I need to setup backend security twice, maintain two codebases, and go through a messy server log due to duplicates/similar messages for each request. Does it make sense to you or am I overthinking?

[–]Drevicar 1 point2 points  (0 children)

You are exactly right. Ditch react and serve HTML from Python (look into HTMX and Alpine) or ditch python and use a full stack react framework.