posts appear dynamically

established connection to the database and the posts on the main page
appear dynamically from the database