Everything is really messy but it's a good start. I'll clean it up later. You only need app.R and global.R to run the app. The rest is just for prototyping.