Working in web field it seems that every project that gets older than 3 years, while being in active use and in active development (paying customers wanting new features and customizations), seems to be total mess, awful to maintain and make changes.
Do you have experience of older project that is still nice to work with, what's the stack and what's it's secret ?
Keeping a project clean and well organised requires a lot of effort, discipline in addition to rigorous code reviews, as people leave and new ones join, things get interesting too!
As the project grows, its normal that you get some messy code here and there remember what they say about perfection being bad? The best you can do is to make that happen in non-core parts of the project that you convince yourself with a comment that it will be refactored in the future (it will not).
You could do it well for months, years, then the code base passes to a new team and in just a couple of months they mess it in a way you never imagined, I guess that’s the nature of software development!