What tech stack should i choose?
what should i choose for better auth ?
react + express
or
nextjs + express
i want to go with NextJs because of easy routing and fast development
What's your thoughts ???
7 Replies
Easiest for me is just nextjs. No need for express
I would go with express for the backend and React + React Router for the frontend.
React Router V7 has everything NextJS has (SSR, SSG, etc.). In addition, types are automatically generated for route parameters, which can reduce errors. Above all, it is ideal if you prefer a separate backend. Personally, I always prefer that.
RR7 is independent of Vercel and can be deployed on any infrastructure.
Next.js is optimized for Vercel and is more dependent on its ecosystem.
I also recommend considering Fastify over Express, as it offers better performance, integrated data validation with JSON schemas, a more modular plugin system, and tighter integration with TypeScript, making it easier to develop more efficient and maintainable Node.js applications.
The problem is that integrating Fastify with Better Auth can be a bit tricky.
Here is the documentation for integrating Fastify
https://www.better-auth.com/docs/integrations/fastify
And here is an example:
Better Auth Fastify Integration Guide | Better Auth
Learn how to seamlessly integrate Better Auth with your Fastify application.
Reddit
From the reactjs community on Reddit: React Router v7 has to be a p...
Explore this post and more from the reactjs community
As with every big frameworks, there will be people who hate it and who love it. These are only tools and you should pick them based on the scope of your project. React is not always the best choice (NextJS is based on react, so lemme lump them together for a moment)
That post mixes up a few things. Remix isn’t a separate framework anymore; it’s now part of React Router 7, which actually has three modes:
- Library Mode → classic React Router (pure client-side)
- Data Mode → client-side with loaders and actions (no server required)
- Framework Mode → full Remix-style setup (server rendering, data on the server, etc.)
You don’t need a server unless you go full framework mode.
The branding and docs are confusing, I totally agree, but technically the merge makes sense: one shared codebase, easier upgrades, and a smoother path from client-only apps to fullstack.
So yeah, bad communication, not bad engineering. Remix isn’t gone — it just lives inside React Router now.
I believe the outlash is undeserved too, I wanted to point out, whatever technology you pick, it will have haters/lovers, so asking internet for advice one should expect very biased opinions.
I was in the same spot as the @Luv Sharma not so long ago and wanted to find the "best stack", but honestly it's wrong kind of thinking and I believe you should do research of the frameworks, their cons and prons and decide on your own. Shuffling this decision onto randoms from internet, when they don't know what your project needs, is an example of self handicapping or learned helplessness
And yes, some stacks seem arguably better, but often with complexity the speed of development lowers. We're in a world of tradeoffs
Self-handicapping
Self-handicapping is a cognitive strategy by which people avoid effort in the hopes of keeping potential failure from hurting self-esteem. It was first theorized by Edward E. Jones and Steven Berglas, according to whom self-handicaps are obstacles created, or claimed, by the individual in anticipation of failing performance.
Self-handicapping ca...
Learned helplessness
Learned helplessness is the behavior exhibited by a subject after enduring repeated aversive stimuli beyond their control.
In humans, learned helplessness is related to the concept of self-efficacy, the individual's belief in their innate ability to achieve goals.
Learned helplessness theory is the view that clinical depression and related men...