r/node • • 1d ago

Fastify as a separate API in a Next.js starter: useful boundary or needless overhead?

I maintain create-tigra, an MIT-licensed npm generator, and would like a Node-focused review of its backend defaults.

The scaffold has a Next.js 16 frontend and an independently deployable Fastify 5 API. Request handling follows route → controller → service → repository → Prisma/MySQL. Redis supports rate limits, login lockouts, and IP blocks. Auth/session code, integration tests, CI, and Docker configuration are included.

Source: https://github.com/blessandsoul/create-tigra

The frontend supplies forms and API/auth wiring; application pages are yours to build. The part I most want challenged is the cost of the backend structure before a project has much business logic.

Would you keep the separate API for a small project? Which layer or integration would you simplify first? What auth/session or installer edge case would you want a regression test for before trusting the scaffold?

Recommendations, honest criticism, and a code roast are welcome, especially with a file or example to discuss. The public baseline has known dependency advisories documented in KNOWN_ISSUES.md; passing tests is not a claim that it can be deployed unchanged.

1 Upvotes

8 comments sorted by

2

u/Beginning-Seat5221 1d ago

I use tRPC because I don't want to deal with handling the types and validation of data going across the net. I put the API and the frontend in the same project folder, with a shared common folder, and something like a lint rule to prevent cross imports between the backend and frontend files.

1

u/V_Trautwein 18h ago

I'd keep Fastify separate if independent scaling matters.