Philosophy

Here is the core vision and principles behind this project.

Fastify first

Nearly all modern frontend JavaScript tooling adheres to the middleware API introduced by Express, where stacked up functions each taking req, res and next as parameters are executed serially.

Next.js built its own server based on this paradigm, Nuxt.js initially used connect, which also employed the same paradigm, and then built their own, retaining the same paradigm.

Their approach to providing server functionality is framework-first.

TIP

Middleware functions are easy to grasp and mix up. Vite itself uses connect too and it enables it to be integrated with pretty any other Node.js server, including Fastify coupled with this plugin.

That being said, the core vision behind this plugin is to be Fastify-first. Due to its modern, minimal and well architected core, including its encapsulation mechanism, hooks, decorators and plugin architecture, Fastify should be the foundation for web application servers in Node.js.

This feature set delivers an immense amount of flexibility in architecting complex Node.js backend solutions, and Fastify does it while compromising zero on performance, positioning itself as one of the top performing web application servers for Node.js.

TIP

To learn about migrating from Express to Fastify, refer to:

Pack light

ToolingTime to npm installSize of node_modules
Nuxt.js18.85s153M
Next.js5.37s109M
fastify-vite4.31s70M

Another key idea is to avoid cruft and hidden complexities by sticking to just Fastify and Vite.

The Fastify ecosystem provides enough plugins to cover literally every backend need you may have, the community is vibrant and development is active. The same can be said already about Vite, which despite being relatively new, already has plugins for nearly everything.

In short, with fastify-vite you can mix and match Fastify plugins for your backend needs with Vite plugins for your frontend needs. You're likely to need some other batteries, like VueUse and ReactUse, but it's a solid foundation for starting small and with the least amount of vendor lock-in.