connect the front to database