SHIV5T3R / CO-DE

An Open Source Collaborative Code Editor
35 stars 26 forks source link

Added more relevant boilerplate #1

Closed Erik-Z closed 1 year ago

Erik-Z commented 1 year ago

You don't need to merge this PR. I just wanted to share some of the boilerplate that I thought would be useful in this project.

I made quite a few changes when messing around with this.

New Packages:

Proposed architecture change: I had some discussion with some of the folks in the backend thread about Frontend vs Backend page routing. While I think it makes more sense to do a MPA using backend routing, I realize that might not be very feasible since React is designed to make SPAs. That being said, we still need to serve the initial page with our backend. Hence lines 13-19 in app.py.

Build steps: Now that we are delivering the initial page using Flask, npm run dev is not needed. you can just build the frontend and run Flask. Socket.IO also messes with the flask run command. Socket.IO won't work (at least from what I've seen) when ran with flask run. You can use python app.py instead to run the app.py file manually. I am not sure if there is a better way to do this. Maybe have a bash script that builds the frontend and runs the backend.

Let me know of any criticisms or things I can do better. Like I said this was just me messing around and getting to know the framework better. Currently this is a working real time "editor". You can have two clients and changes from one client affects the other.

SeanPaulson commented 1 year ago

Front ender here. We could definitely make this a mpa. React is made for both mpa and spas.