init db and code