I was looking to do something like this a while back and worked great until I tried to run the web app on a headless machine. It was unable to draw components. have you also found this to be true?
-Lucas