Typed env parsing with zod

10532
0

Shipping a deploy with a missing env var is an easy way to create a confusing outage. process.env is just a bag of strings, so I parse env at startup, validate required variables, and fail fast with a clear message. The other win is type safety: once env is parsed, the rest of the code uses a typed config object instead of sprinkling process.env.FOO everywhere. I also keep secrets out of logs by redacting config when printing it. This approach makes local development less painful and deployments safer because misconfigurations get caught immediately, not after the first request hits production.