Do projects still apply layered architecture or just choose a simpler approach?
What architecture do projects now usually follow? Considering nextjs, does it have an opinionated approach or convention?
Example on my React + Express project, my architecture is:
Web > API > Service > Repo > DB (raw sql)
The above approach, I can immediately swap Web layer with an Android/iOS app like this:
Android/iOS > API > Service > Repo > DB (raw sql)
Now, I'm creating a nextjs boilerplate, I want to know what's the best practice so it can be reusable but not over-engineered. Do you use server actions initially, like this...
Web > Action > Service > Repo > DB (prisma)
...then only implement API layer if needed for other clients? Ex.
Android/iOS > API > Service > Repo > DB (prisma)
As you can see the concern would be maintaining code in two different places (API and server action) that is basically doing the same thing.
Do you skip server actions and just use API routes? Is there a better approach in nextjs? Should I follow YAGNI? I'd love to hear what your architecture looks like.
Posted Aug 12, 2026, 11:04 AM UTC