Skip to content

Latest commit

 

History

History
16 lines (12 loc) · 815 Bytes

File metadata and controls

16 lines (12 loc) · 815 Bytes

ADR: tRPC for Type-Safe API Communication

Context

We chose tRPC as the solution for API communication in this project to ensure type safety and simplify the development process.

1. Type Safety

  • tRPC provides end-to-end type safety, ensuring that the types defined on the server are automatically reflected on the client.
  • This reduces the risk of runtime errors and improves developer productivity.

2. Simplified Development

  • tRPC eliminates the need for manual API client generation or REST endpoint definitions.
  • It integrates seamlessly with TypeScript, making it a natural choice for our stack.

3. Alignment with Next.js

  • tRPC works well with Next.js, leveraging its API routes for server-side logic.
  • This integration simplifies the overall architecture and reduces boilerplate code.