One of the most important things you can do to keep your web app scalable is to always ensure you’re writing clean code. Clean code means organizing modules and functions into their own independent files once things get a little too unwieldy. I pretty much always optimize as I go—once a file gets too large or too hard to understand, that’s when I begin cleaning things up and refactoring, otherwise, I’m just wasting time over-optimizing.
Learn how to utilize an independent router file and controllers to make your web app as clean and scalable as possible