The best way to organize code?

I’ve been downloading source files for multiple games and I’ve noticed that the file structure has deviated in one way or another. How do you organize your large projects?

I have my project split into two. I have a general “engine” which has a bunch of boilerplate (network stuff, enetity-component system, etc) which is a python package and will, eventually, be its own panda package.

On the game side I do the best I can to organize it as python packages by functionality, but I have very much failed here!