Skip to content

Fastify
(7 h)

To learn
Ideas
  • Rebuild blurcasts' backend with fastify

The hitchhiker's guide to plugins
(+0.5 h)
(Draft)

March 13, 2024

The hitchhiker's guide to plugins

  • "Every time you use the register API, a new context is created ..."

Encapsulation and breaking it
(+2 h)

March 7, 2024

Should you contribute to Open Source? - YouTube

  • "Open source is the way I could find the mentor."

Building a modular monolith with Fastify - Matteo Collina, Node Congress 2023 - YouTube

1, 2, 3... Fastify! - Matteo Collina - YouTube

  • Plugin autoload
  • Test with tape

Getting started
(+3.5 h)

March 5, 2024

Fastify is a web framework. Other than React, Vue, and Svelte those frontend web framework, there are backend web framework, such as Express and Fastify.

Getting-Started | Fastify

Details

Your first plugin:

  • With Fastify everything is a plugin.
  • This is one of the best features of Fastify, it will load your plugins in the same order you declare them, and it will load the next plugin only once the current one has been loaded. In this way, we can register the database connector in the first plugin and use it in the second
  • Plugin loading starts when you call fastify.listen()fastify.inject() or fastify.ready()
  • The MongoDB plugin uses the decorate API to add custom objects to the Fastify instance, making them available for use everywhere.

Loading order of your plugins:

└── plugins (from the Fastify ecosystem)
└── your plugins (your custom plugins)
└── decorators
└── hooks
└── your services

	└── service A
	│   └── plugins (from the Fastify ecosystem)
	│   └── your plugins (your custom plugins)
	│   └── decorators
	│   └── hooks
	│   └── your services

	└── service B
		└── plugins (from the Fastify ecosystem)
		└── your plugins (your custom plugins)
		└── decorators
		└── hooks
		└── your services

Take your http server to ludicrous speed - YouTube

A "fast" Introduction to Fastify - Matteo Collina, NearForm - YouTube

A Fastify Tale of Shapes - Matteo Collina, NearForm - YouTube

Released under the CC BY-NC-SA 4.0 License.