databio / bedhost

API and UI for BEDbase
http://api.bedbase.org
BSD 2-Clause "Simplified" License
2 stars 0 forks source link

Protocol for updating bedhost-ui #34

Closed nsheff closed 3 years ago

nsheff commented 3 years ago

Right now, the protocol for updating bedhost-ui is not specified in this repository, and is outlined in steps in the full bedbase tutorial.

The steps to update are something like (not tested):

cd bedhost
git clone git@github.com:databio/bedhost-ui
cd bedhost-ui
npm install 
npm run build
rm -rf ../bedhost/bedhost/static/
mkdir ../bedhost/bedhost/static/
cp -avr ./build ../bedhost/bedhost/static/bedhost-ui

We need a better way to distribute the UI. I'm not quite sure yet what the typically accepted way to do this would be, but probably it's not putting it in the user-facing tutorial.

An alternative would be to have a little script like the above within this repository, and then run it every time we want to update the UI. This would embed the compiled version of the UI within this repository. While it's not ideal to embed compiled versions, then at least the actual UI would be frozen and distributed with the bedhost app.

Another alternative would be to have the above script in this repository, and just run it before packaging/installing/pushing bedhost. SO, we wouldn't push the compiled UI into this repository, we'd just create it on the fly whenever releasing this python package. But, then it wouldn't make it into the github repository, so you couldn't do things like pip install github.com/.../bedhost, because the UI wouldn't be included.

One thing that worries me is that the compiled react app is 13M+ in size. So, that's a lot to put into a git repository, why is it so big?

How do they approach it here? https://github.com/Buuntu/fastapi-react

xuebingjie1990 commented 3 years ago

How do they approach it here? https://github.com/Buuntu/fastapi-react

here the front-end and back-end are in the same repo. when you run docker-compose, it will build the react front-end. so you don't really need to manually copy the build to bedhost/static. I'm not sure why the compiled react app is so big. I'm guessing it's because the dependencies (node_model is the only thing I know that takes lots of space).