Improving Developer Experience with tRPC and OpenAPI in AWS Lambda
The article discusses how to improve the developer experience when using tRPC and OpenAPI in AWS Lambda. The author explains that while tRPC is typically used in a mono repo project, it is possible to use it in separate repos by generating an API SDK from the backend and consuming it in the frontend. The previous approach of writing the OpenAPI spec and generating TS types from it is not ideal as it relies on multiple watch processes and leaves it up to the developer to use them correctly and consistently. Instead, the author suggests using tRPC to write code first and then generating the OpenAPI spec from it, making the code the source of truth. The article provides a detailed example of using tRPC in Lambda and highlights some important considerations, such as handling CORS and organizing the directory structure. Overall, this approach offers a better and smoother developer experience for working with tRPC and OpenAPI in AWS Lambda.