In this workshop you'll learn how to develop APIs with Fastify and deploy them to the Platformatic Cloud.
Node.js Masterclass
From Author:
Have you ever struggled with designing and structuring your Node.js applications? Building applications that are well organised, testable and extendable is not always easy. It can often turn out to be a lot more complicated than you expect it to be. In this live event Matteo will show you how he builds Node.js applications from scratch. You’ll learn how he approaches application design, and the philosophies that he applies to create modular, maintainable and effective applications.
Level: intermediate
This workshop has been presented at Node Congress 2023, check out the latest edition of this Tech Conference.
FAQ
The instructor is a board member on the OpenJS Foundation and a part of the Nojest Tech steering committee with over 10 years of experience deploying Node.js systems.
The three key things covered are: test-driven development, avoiding global state, and splitting business logic across multiple modules.
Jest is primarily designed for browser environments and can cause issues with Node.js servers, such as problems with instances of errors and global state. Alternatives like Vtest, Node-tap, and the built-in Node test library are recommended.
The recommended structure involves organizing the application into modules or features based on domains rather than using a traditional Model-View-Controller (MVC) pattern. This helps in managing complexity and scalability.
Fastify uses a Radix prefix tree for routing, which is more efficient and supports metaprogramming on routes, unlike Express which uses an array of regular expressions evaluated in order.
Yes, Fastify can be used in serverless environments, and it works better than Express in AWS Lambda due to its efficient design and lower cold start times.
The Fastify plugin system allows modularization of the application, making it easier to manage, test, and extend functionalities. It also supports graceful shutdowns by managing dependencies and their order of initialization and termination.
Platformatic is a production-ready framework built on top of Fastify. It provides additional features like automatic API generation, environment variable substitution, and a more streamlined setup, while still supporting all Fastify functionalities.
You can handle authentication by verifying the JWT token at the edge (initial request) and then passing relevant information through HTTP headers to avoid redundant validations in internal microservices.
Recommended libraries include 'AT Database', 'NearForm SQL', and 'Kinet'. These libraries allow you to write raw SQL queries while ensuring SQL injection protection.
Video Transcription
Available in other languages:
Watch more workshops on topic
In this workshop you'll learn how to develop APIs with Fastify and deploy them to the Platformatic Cloud.
We will enhance a full-stack JS application (Node.JS backend + React frontend) to authenticate users with OAuth (social login) and One Time Passwords (email), including:- User authentication - Managing user interactions, returning session / refresh JWTs- Session management and validation - Storing the session for subsequent client requests, validating / refreshing sessions
At the end of the workshop, we will also touch on another approach to code authentication using frontend Descope Flows (drag-and-drop workflows), while keeping only session validation in the backend. With this, we will also show how easy it is to enable biometrics and other passwordless authentication methods.
Table of contents- A quick intro to core authentication concepts- Coding- Why passwordless matters
Prerequisites- IDE for your choice- Node 18 or higher
All beginnings are hard. Even harder than choosing the technology is often developing a suitable architecture. Especially when it comes to GraphQL.
In this workshop, you will get a variety of best practices that you would normally have to work through over a number of projects - all in just three hours.
If you've always wanted to participate in a hackathon to get something up and running in the shortest amount of time - then take an active part in this workshop, and participate in the thought processes of the trainer.
Check out more articles and videos
We constantly think of articles and videos that might spark Git people interest / skill us up or help building a stellar career
Comments