BrycensRanch
Using Next.JS + Fastify
My node environment is Node 18, powered by PNPM.
What's wrong: I have a few requirements for my application. I don't want to use Next's API routes due to me wanting to provide a detailed open api definition to consumers automatically. Not to mention, I prefer building with Fastify. I have considered putting trpc's server on Fastify, but, I have no idea how I would drag this into my Next.JS application. Before I stumbled upon TRPC, I was planning to have an internal API for the frontend that was considered private, but, with TRPC I see there's more possiblities. I'm also planning to host the frontend and backend in different environments. For example, Frontend would be on Vercel, backend on Railway, connected via Environment Variables to point to each other. I'd love some guidance as TRPC is a lot to swallow and process what it's doing.
7 replies