Designing the application structure
In this chapter, we will design a backend application that will expose some RESTful APIs.
The application structure enables you to write applications that are easy to implement, evolve, and maintain. A good system must be flexible to your needs and the application’s changes. Additionally, it should impose some implementation design to let you and your team avoid some major pitfalls, which could lead to an unstable and untestable application.
This chapter will discuss the application’s features only marginally. In fact, a scaffolding project should not care about them, but it should apply them to any project. For this reason, we will create an application with some health check routes and a MongoDB connection ready to be used.
We will introduce a set of Fastify plugins that will help us structure our application and reduce the burden of writing some utilities from scratch, which have already been developed and tested on production...