FAC4

Week 8: build a blog using hapi

This week we are going to re-build our blog using hapi.

Your jumping off point is Nelson's learn Hapi repo and the hapi tutorials.

We recommend that your start with the following elements:

  • a JSON API
  • Submission of new blog entries
  • Listing of all blog entries
  • Viewing of existing entries
  • User registration

Your blog will have the following elements:

Routing

Using the hapi package itself (you may also want to follow Rails routing conventions).

Testing

Using lab (we actually covered a lot of this ground last week with shot).

Validation and data storage

Using joi. For storing and retrieving your data you can start by storing your data in a json file or you can jump straight into using MongoDB (with e.g. mongojs or mongoose) or LevelDB, or some other database.

User authentication

Using bell or hapi-auth-cookie.

Roles

Split up into four different roles to explore routing, testing, validation and authentication.

Stretch goals

If you have time, you can add:

  • HTML pages using views and any templating engine you like.
  • Editing and deleting of existing entries

And you can explore the following packages: