Server-only integration (microservices stay off the browser)
We do not call internal microservices from the browser.
Why:
- security: secrets/tokens must not be exposed
- control: auth, rate limits, and validation enforced server-side
- stability: fewer client breakages when internal APIs change
- observability: consistent logs/traces on the server boundary
Recommended request flow
Boundaries
- Browser:
- UI, user interactions
- display errors
- never holds microservice secrets
- Next.js server:
- validation + auth enforcement
- microservice integration
- safe logging (no sensitive data)
Exercises
content/exercises/04-trpc/01-protected-procedure.mdx
Last updated on