Menu

📰
0

Reddit - Please wait for verification

Full-stack Development·/u/WetThrust258·3 days ago
#yWMMeww6
Reading 0:00
15s threshold

I’ve been trying to properly understand and implement Clean Architecture on the frontend with Next.js (frontend-focused, not backend), but I’m getting confused once third-party libraries enter the picture especially auth libraries and query libraries. Most examples online are either: too theoretical, too backend-oriented, or avoid real-world libraries entirely. My setup is something like: Next.js App Router Monorepo (Turborepo) Shared packages Auth library (like Better Auth / NextAuth / Clerk / etc.) TanStack Query or RTK Query TypeScript What I’m struggling with is: 1. Where should auth libraries live in Clean Architecture? For example: should the auth client be wrapped behind interfaces/adapters? should the UI directly call the auth library hooks/functions? where do auth-related side effects belong? how much abstraction is “too much”? Example: authClient.signIn.email(...) Should this be hidden behind: AuthRepository.signIn() or is that unnecessary abstraction on the frontend? 2.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More