By week 2 of building my SaaS (Flask + Next.js), my app.py was 800+ lines.
Routes. Stripe webhooks. Auth. Emails. Config.
All in one place.
Every small change broke something unrelated.
So I refactored into a layered architecture:
– Routes handle HTTP
– Services handle business logic
– Models handle data
– Config split per environment
Here’s the full breakdown with code:
launchstack.space/blog/flask-saas-project-structure-production-architecture
Curious how others structure their Flask SaaS projects.