3 ms·
This type of layout works well for big apps too. The OP doesn't mention how to deal with sharing code, but it's easy. This layout is similar to how I organize
by nickjj 8y ago
This type of layout works well for big apps too. The OP doesn't mention how to deal with sharing code, but it's easy.
This layout is similar to how I organize a fairly large real world project in my Flask course[0].
For example, here's some folders that house various functionality:
admin/
bet/
billing/
contact/
page/
user/
Each one has templates, views (route definitions), background tasks and models that are associated to that specific thing.
Sharing code is super simple between the 2. If you find yourself creating a general function that could be used in both, then you drop it in a lib/ folder that lives outside of those folders.
Overall this makes it very easy to skim a code base and see what it does. I've scaled this same pattern to having about 15 of those folders for distinct app functionality and hundreds of models, etc..
[0]: https://buildasaasappwithflask.com/ https://buildasaasappwithflask.com/