Node Validation Essentials Workshop

Node Validation Essentials Workshop with Simon Plenderleith

You know validation can help make your application more stable, secure and reliable, but...

You really wish you could be building valuable features instead.

The problem is, you can't trust the data your application receives. It's no surprise you're worried about your application crashing horribly when it receives invalid requests. And you definitely don't want to waste your time fixing a messy database full of junk data. Just the thought of accidentally leaking data because of a malicious attack sends shivers down your spine.

oh my god this seems complicated

You've written hundreds of lines of validation code, but it feels like a mess. You're overwhelmed trying to integrate a validation library, handle validation errors, and send effective error responses.

Why is it so hard to figure out what the established practices are for validation in a Node.js application?

What's the best validation library for Node?

You end up stuck trying to choose from a whole heap of different validation libraries.

Where would you put this code? In the API route? In the model? In a separate file called by either the route or model? How would you organize this?

You're terrified of putting validation in the wrong place. You don't have a clue what validation rules you need, and you're worried about screwing up the error handling.

What I have is working, but it's very clumsy

You feel totally confused about how to handle validation, but you don't want the refactoring headache of adding it in later.

Implementing validation in your Node.js applications is such a hassle. But it doesn't have to be that way.

Imagine if your applications could safely handle any data they receive without skipping a beat. You could have confidence in the quality of the data in your database. You'd be able to build secure applications with validation as your first line of defense.

What if you could consistently apply reliable validation tools and techniques? You'd know exactly where and how to integrate validation into your applications, and send effective error responses too.

Wouldn't it be awesome if you had a strategy for adding validation to every Node.js application you build? You could spend more time building valuable features for your users.

🧑‍💻 Learn how to skillfully apply the essentials of request validation in my hands-on workshop:

  • Combine powerful tools to create your own flexible validation rules
  • Catch bugs early with generated types (in JavaScript or TypeScript)
  • Learn how to send consistent and effective error responses
  • And how to create an effective strategy for request validation in Node.js

I thought the workshop was excellent! I learned a lot about Node and validation techniques. You were super knowledgeable, very approachable, and did a fantastic job teaching.

— Oscar Pagani, Senior Software Engineer at Zillow Group

About the workshop

  • This is an online workshop which will run for 3 hours via Zoom (including two short breaks). It will be hands-on, with live coding, exercises, and plenty of time for questions and discussion.
  • Your workshop ticket includes a copy of my Express API Validation Essentials book (normally $19).
  • Who's it for? This workshop requires you to know the fundamentals of JavaScript and have some experience building Node.js applications.
  • Do I need to use a specific Node.js framework? Nope! The tools and techniques you'll learn in this workshop can be used with any Node.js framework.
  • What tools and standards will be covered? The JSON Schema specification, the Ajv JSON Schema validator, and the Problem Details for HTTP APIs specification.
  • Do I need to know TypeScript? Not at all — we'll be primarily using JavaScript. The section on types applies to Node.js applications built with JavaScript or TypeScript.
  • Got a question? Email me simon@simonplend.co.uk.

📅 Workshop dates

There are no dates currently scheduled for this workshop.

Enter your email address and I'll let you know when I'm running it again.

    Great mix of teaching and exercises. The difficulty level was spot on. Thanks for a fantastic workshop, I'm looking forward to making use of it!

    — Anthony Linton, Full Stack Developer at LUMI

    Workshop outline

    • Why validation is an essential part of every Node.js application
      • Using validation to help us handle unsafe user data
      • How validation fits into the HTTP request/response lifecycle
      • Closing the validation loop with HTTP error responses
    • Creating flexible validation rules with JSON Schema and Ajv
      • The benefits of defining validation rules with JSON Schema
      • Validating our data against a JSON schema with Ajv
      • How schema builders can help us build our JSON schemas faster
      • Adding custom validation logic with Ajv keywords
    • Making our applications more robust with schema generated types
      • Using types in vanilla JavaScript with JSDoc and TypeScript
      • How static type checking in vanilla JavaScript helps reduce bugs
      • TypeScript options for generating types from schemas
    • Sending back validation errors in an effective response format
      • What makes an error response helpful
      • How the Problem Details specification can help us
      • Transforming Ajv errors into a Problem Details error response
    • Integrating validation with Node.js frameworks
      • Adding validation to an application's routes (Fastify)
      • How to send Problem Details error responses (Fastify)
      • Integrating JSON Schema based validation in other frameworks

    It was a really nice group environment to learn in, with a good vibe and hands on coding experience. A very useful and informative workshop, thank you!

    — Thomas Meaney, Full Stack Developer at LUMI

    Example application walkthrough

    The example Node.js application in this video incorporates the tools and techniques you'll learn in my workshop, and shows how they all fit together.

    About the instructor

    Simon Plenderleith

    Hey, I'm Simon 👋

    I'm an independent Node.js consultant and educator. Since the day I learnt HTML from a book in 1999, I've been hooked on coding. Over the past twenty years I've crafted web applications and tooling for many companies, big and small.

    I help companies use Node.js to ship great products that grow their businesses. I also help developers level up with Node.js through my blog.

    I'm the author of the book Express API Validation Essentials.