---
title: "Comment by Tarun Sharma on \"How to Structure a Full-Stack Next.js Project for Production\" | Hashnode"
description: "Solid breakdown. The one thing that decides whether this holds up past the first sprint is enforcement. Folder conventions and \"dependency direction\" rot the mo"
url: "https://hashnode.com/posts/how-to-structure-a-full-stack-next-js-project-for-production/6a9706c28e84aff38536207f/comment/6a9826a510524a80809e0e10"
---

[Discussion](https://hashnode.com/posts/how-to-structure-a-full-stack-next-js-project-for-production/6a9706c28e84aff38536207f)

Comment [How to Structure a Full-Stack Next.js Project for Production](https://hashnode.com/posts/how-to-structure-a-full-stack-next-js-project-for-production/6a9706c28e84aff38536207f)

[Tarun Sharma](https://hashnode.com/@101beardo)

[Sep 2](https://hashnode.com/posts/how-to-structure-a-full-stack-next-js-project-for-production/6a9706c28e84aff38536207f/comment/6a9826a510524a80809e0e10)

Solid breakdown. The one thing that decides whether this holds up past the first sprint is enforcement. Folder conventions and "dependency direction" rot the moment they're only in a doc. Two mechanical guards worth adding: put import 'server-only' at the top of lib/db and lib/auth files so a stray import from a client component is a build error instead of a leaked connection string, and wire up eslint no-restricted-paths (or eslint-plugin-boundaries) so "lib importing from components" fails CI rather than getting waved through in review. After that the structure mostly maintains itself.

[Darshan Parmar](https://hashnode.com/@darshan-parmar)

[Sep 2](https://hashnode.com/posts/how-to-structure-a-full-stack-next-js-project-for-production/6a9706c28e84aff38536207f/comment/6a9826a510524a80809e0e10#reply-6a98484880a2505084e8f25e)

Great points,, I really like the idea of making these boundaries enforceable through tooling instead of relying only on conventions. Thanks for the detailed feedback
