I'm a junior full-stack developer from Alexandria, Egypt. This is another post about FaceMark, my face-recognition attendance system (a NestJS API plus a Python AI service), and it's about the two smallest files in the repo that touch every request: the interceptors.
The problem they solve
An API with twenty endpoints drifts. One controller returns the entity, another returns { message: "ok" } , a third returns whatever the service felt like. The frontend ends up with a different parsing rule per screen, and nobody knows how slow anything is until a user complains.
NestJS's answer is interceptors: code that wraps every handler, sees the request going in and the response going out, and can transform either.…