What is Screaming Architecture?
The term “Screaming Architecture” comes from Uncle Bob Martin’s principle that:Your architecture should scream about the use cases of the application, not about the frameworks and tools you’re using.When you look at the project structure, it should immediately tell you what the application does, not how it’s built.
The Problem with Technical Architecture
Most codebases organize by technical concerns:Screaming Architecture in Practice
Next.js Example
From the Next.js Scope Rule Architect:- “I’m an e-commerce application”
- “I have authentication with login and registration”
- “I have shopping, cart, and wishlist functionality”
- “I have a user dashboard with profiles”
- Instantly understand the business domains
- Know where to find authentication logic (in
(auth)/) - See what the shop feature includes (shop listing, cart, wishlist)
- Understand shared vs. feature-specific components at a glance
Angular Example
From the Angular Scope Rule Architect:- “I’m an e-commerce application”
- “I have user authentication”
- “I have a product catalog with search and filtering”
- “I have a shopping cart system”
- “I support user profiles with order history”
Astro Example
From the Astro Scope Rule Architect:- “I’m a content-driven site with e-commerce”
- “I have a blog with comments”
- “I have a shop with products and cart”
- “I have an about section with team information”
- “I use islands architecture for selective interactivity”
Contrast: Technical vs. Business Architecture
❌ Technical Focus
✅ Business Focus
Principles of Screaming Architecture
1. Feature Names Describe Business Functionality
- Good
- Bad
authentication/- clearly a login/signup featureproduct-catalog/- clearly product browsingshopping-cart/- clearly cart functionalityuser-profile/- clearly user account managementorder-history/- clearly past orders
2. Structure Mirrors User Mental Model
Users think in terms of:- “I want to log in” →
authentication/ - “I want to browse products” →
product-catalog/ - “I want to manage my cart” →
shopping-cart/ - “I want to view my profile” →
user-profile/
3. Container Components Match Feature Names
From the React/Angular agents:- Angular
- Next.js
- React
4. Immediate Understanding for New Developers
A new developer should be able to:How the Scope Rule Enables Screaming Architecture
The Scope Rule is what makes screaming architecture possible:Local Code
1 feature = local placementFeature-specific code stays within the feature, making it obvious what code belongs to what business capability.
Shared Code
2+ features = shared placementTruly shared code lives in
shared/, making it obvious what’s reusable across the application.- Business domains are obvious (feature folders)
- Relationships are clear (shared vs. local)
- Intent is communicated (names describe functionality)
Testing the Architecture
Common Questions
Doesn't this mean reorganizing the entire codebase?
Doesn't this mean reorganizing the entire codebase?
Initially, yes. But this is a one-time cost that pays dividends forever. Once your architecture screams, maintenance becomes dramatically easier. Every new feature added reinforces the pattern instead of degrading it.
What if I have shared UI components like Button, Input, etc.?
What if I have shared UI components like Button, Input, etc.?
How granular should features be?
How granular should features be?
Features should represent cohesive business capabilities from the user’s perspective. In an e-commerce app:
product-catalog/, shopping-cart/, checkout/, order-history/ are all separate features. In Next.js, these might be route groups. In Angular, they’re feature modules or standalone features.Can I still use framework conventions?
Can I still use framework conventions?
Yes! In Next.js, use App Router conventions (
page.tsx, layout.tsx, route groups). In Angular, use standalone components and modern patterns. In Astro, use file-based routing. Screaming architecture works within framework conventions, not against them.Further Reading
The Scope Rule
Learn the fundamental principle that enables screaming architecture
Co-location
Understand how keeping related code together supports clear architecture
