What’s the best backend and auth setup for my Next.js project?

0
21
Asked By CuriousCoder82 On

I'm starting a new project and need some advice on the right backend and authentication framework. I'm aiming for rapid development with low costs, and I want to avoid using any overly hyped libraries or frameworks. Ideally, I'd like to minimize dependencies and not build authentication from scratch. Supabase seems promising, but I'm concerned about vendor lock-in. Currently, I'm using Firebase, but dealing with syncing client and server sessions has been a nightmare, and it feels very clunky. I want to move away from that. What's the best option for authentication in this scenario? I really appreciate any insights you all can share, as I'm sure many of you have faced similar challenges.

3 Answers

Answered By DevDude2023 On

Honestly, I’d recommend skipping Next.js and going with Vite for SSR. Forget about these 'tools' and just code your own solution. It might be harder, but you won’t be stuck with a clunky service that was never actually saving you any development time. I really regret using Next.js—it’s just a lot of layers of complexity that aren’t necessary!

CuttingEdgeTech -

Haha, interesting take! What would you use alongside Vite?

Answered By TechGuru45 On

For quick development without the hassle of building your own authentication, I'd definitely recommend Supabase. It’s lighter than Firebase and comes with a Postgres backend, built-in auth, plus real-time capabilities. Plus, you won't get heavily locked in, since you can migrate your database later if needed. If you're looking for alternatives, you might want to check out Clerk.dev for smooth integration with Next.js, or NextAuth.js—it's flexible and has minimal dependencies, but keep in mind you'll have to manage sessions and database connections yourself. Overall, Supabase with Next.js seems to hit a good balance. Just be cautious about schema migrations and session handling!

ProjectSeeker99 -

Thanks for breaking this down! I’ll definitely look into these options.

Answered By CodeNinja22 On

The sync issues you've faced with Firebase can be avoided with solutions like Auth.js or Better Auth, specifically designed for Next.js' server-side and static generation patterns! 🙂

CuriousCoder82 -

That sounds great, thanks for the heads up!

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.