Bring doc logic from mybook
Debug database setup
Add document display logic
Fix login issues