setup config and database connection