A simple, type-safe middleware system for Next.js with route protection and built-in authentication rules