initial database build and main app creation