Home

Writing

Notes from building things.

  1. Validating API input with Zod in TypeScript

    TypeScript checks nothing once your app is running. Here is how to validate request bodies, environment variables and API responses with one Zod schema that also gives you the type.

    TypeScriptValidationZod

  2. Implementing AES-256-GCM encryption at rest in Node.js

    TLS stops protecting your data once it reaches the database. Here is how to encrypt sensitive fields yourself, with Node's native crypto module.

    SecurityEncryptionNode.js