Closed tamas-ferenci closed 3 years ago
hi @tamas-ferenci, it looks like you're not running webpack (which serves the SPA /admin as well as the CSS / JS on localhost). Are you running all three commands described in https://github.com/owid/owid-grapher#development-server:
yarn startTscServer
yarn startAdminServer
yarn startWebpackServer
?
Thanks for your response @mlbrgl !
I did start webpack; more specifically, I used yarn startTmuxServer
. Here is what is see:
That looks good to me (for a local set up)! As I understand it, you're now running the local dev environment on a remote server, which we don't really support.
If you want to go down that route, then you might be able to proxy webpack-dev-server on localhost:8090 through another path (you'll need to change some of the logic here: https://github.com/owid/owid-grapher/blob/c0acc58aa8dc3a7c69353bd09939f2a3b6c234e0/site/webpackUtils.tsx#L11), although I woundn't recommend this as a production set up.
The other option is to compile and bundle your code for production. We use yarn buildAndDeploySite [target]
, which will require some adjustments outside of our environment. yarn buildTsc
and yarn buildWebpack
will already take you some of the way, and I invite you to take a look at https://github.com/owid/owid-grapher/blob/c0acc58aa8dc3a7c69353bd09939f2a3b6c234e0/baker/Deployer.ts#L155 for further instructions.
Thanks! I absolutely do not insist on the "local dev on remote server" solution.
Is my understanding correct that the proper way would be to use production environment? If so, do you have a documentation on setting up the production environment? (I am afraid https://github.com/owid/owid-grapher doesn't really talk about this.) I don't really see what should be the procedure here... (especially together with Apache).
Hi @tamas-ferenci, I discussed this in more detail internally and as you noticed, we're not yet at the point where Grapher can be used in production for publishing charts, independently from our site. It is our intention to better decouple these in the future but right now our platform can only run in local dev environments for experimentation purposes.
I'll go ahead and close this for now, but don't hesitate to continue the conversation if you have any other questions.
Have a good w-e!
The other option is to compile and bundle your code for production. We use
yarn buildAndDeploySite [target]
, which will require some adjustments outside of our environment.yarn buildTsc
andyarn buildWebpack
will already take you some of the way,
I'm trying to deploy the admin server only at the moment. Can you tell me, buildAndDeploySite is for the OWID main site and not the admin server, is that correct?
Is my understanding correct that the proper way would be to use production environment? If so, do you have a documentation on setting up the production environment? (I am afraid https://github.com/owid/owid-grapher doesn't really talk about this.) I don't really see what should be the procedure here... (especially together with Apache).
Hi @tamas-ferenci I was wondering if you had made any further progress with this? I'm trying to deploy the admin server and whilst I'm part successful I'm still finding that localhost:3030 is still being referenced for some things rather than being picked up from the environment variables. I'm somewhat stuck at the moment so wondering if you'd made any progress that you could share at all please?
After installing
owid-grapher
on an Ubuntu 18.04 machine, and runningyarn startAdminServer
, I can log in atlocalhost:3030/admin
, however, a completely blank page is shown afterwards.This is shown at the terminal:
The
localhost:3030
site is also very strange:and goes on like this with horribly large icons.
It seems to me that this problem is related to how the website is served through Apache. Here is the raw content of the blank page after admin login:
Obviously it won't work as it is referring to
localhost
(while I view through the web). Here is the relevant Apache configuration: