What convention keeps a growing Node.js codebase navigable — both at the file-naming level and the folder level?
Fix: Two complementary, real conventions: (1) role-suffix file naming (<domain>.<kind>.js, e.g. user.controller.js) — this is exactly NestJS's official convention (cats.controller.ts, scaffolded by `nest g controller`), not a made-up pattern. (2) Organize folders by business domain/feature, not by technical layer — both classic Node.js best practices ("structure by business components/bounded contexts", each owning its own entry-point/domain/data-access folders) and the modern Feature-Sliced Design methodology (slice by domain like user/, post/, comment/, with role-based segments ui/, api/, model/ inside each slice) converge on this.
nodejsjavascriptnaming-conventionproject-structurenestjs
References
- https://raw.githubusercontent.com/nestjs/docs.nestjs.com/master/content/controllers.md — NestJS names files with a type suffix, e.g. cats.controller.ts, and scaffolds them via `nest g controller [name]`.
- https://github.com/goldbergyoni/nodebestpractices — Structure your app by business components/bounded contexts rather than technical layers; each component owns entry-point/domain/data-access folders.
- https://feature-sliced.design/docs/get-started/overview — Feature-Sliced Design partitions code into slices by business domain (e.g. user, post, comment), with conventional role-based segments inside each slice: ui, api, model.