TexteaInc / funix

Building web apps without manually creating widgets
http://funix.io
MIT License
90 stars 10 forks source link

Separate PyDataFront and the function(s) it converts #6

Closed forrestbao closed 2 years ago

forrestbao commented 2 years ago

I wish the user experience can be like this:

python3 PydataFront{.py} my_project/app.py {--port_front=4000 --port_back=4001}

Then both the frontend and backend servers will be fired up. And visiting localhost:4000 will show the app.

Can we do this?

TURX commented 2 years ago

Modular usage supported in https://github.com/TexteaInc/PyDataFront/commit/c62e81c35c8648a4ad6863491387c4ff6325d7ec

Sample: python3 -m pydatafront functions --host localhost --port 4010

forrestbao commented 2 years ago

Second thought on this. Since we cannot automatically fire both the frontend and backend servers due to Python's limitation anyway, let's just break this into three steps:

  1. Conversion to two folders, one for frontend files and the other for backend files
  2. Fire the backend server with port option.
  3. Fire the frontend server with frontend port option and backend port option (so the frontend can talk to the backend at a customized port number).

A user will type three commands respectively.

forrestbao commented 2 years ago

Can we allow PyDataFront to convert a Python module from any path?

In the example below, functions.py must locate in the same directory as pydatafront. It is inconvenient.

I wish the new command can be python3 -m pydatafront ../any_location.py --host localhost --port 4010

Modular usage supported in c62e81c

Sample: python3 -m pydatafront functions --host localhost --port 4010

forrestbao commented 2 years ago

I think it now solves the problem very well.