Require posts and repo in application router
Refactor post entity queries