Skip to content
Discussion options

You must be logged in to vote

For large Node.js projects, I've found that maintainability comes less from the specific folder structure and more from having clear boundaries, automation, and ownership.

A few practices that have worked well in production:

1. Organize by feature, not by file type

Instead of:

src/
├── controllers/
├── services/
├── models/
└── routes/

consider grouping related functionality together:

src/
├── users/
│   ├── controller.js
│   ├── service.js
│   ├── routes.js
│   └── tests/
├── auth/
├── billing/
└── shared/

This scales much better as the codebase grows.

2. Keep CI/CD mandatory

At minimum:

  • Linting
  • Unit tests
  • Dependency auditing
  • Build verification

Run these checks on every pull request …

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by xsunzukz
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Apps API and Webhooks Discussions related to GitHub's APIs or Webhooks Question Ask and answer questions about GitHub features and usage Welcome 🎉 Used to greet and highlight first-time discussion participants. Welcome to the community! source:ui Discussions created via Community GitHub templates
4 participants