This article outlines a scalable project structure for medium-sized Node.js backend applications using Express. It details the use of Babel for compilation, Nodemon for development, and a modular routing architecture that separates route definitions from controller logic.
Key points
Use express-async-errors to ensure async/await errors properly propagate to Express middleware.
Babel allows the use of modern ES modules and plugins in Node.js environments that may not yet fully support them.
Structuring application routes into modular functions enables better separation of concerns and improves maintainability.
Separate source files in 'src' from production build artifacts in 'dist' to manage clean build cycles.