05-architecture

Feature Architecture

05-architecture/feature-architecture

Feature Architecture

Overview

Feature architecture is how a product capability is organized across UI, data, and behavior.


Why It Matters

Features become easier to ship when the boundaries between their parts are intentional.


Core Concepts

  • Keep feature code cohesive.
  • Separate feature-specific logic from shared infrastructure.
  • Design for the life cycle of the feature.

Mental Models

Think in slices: route, state, API, components, tests, and rollout.


Best Practices

  • Group related code together.
  • Keep feature state close to feature consumers.
  • Extract shared code only when it repeats.

Common Mistakes

  • Spreading one feature across many folders without a reason.
  • Pulling too much into shared layers.
  • Ignoring feature flags and rollout needs.

Trade-offs

Feature-local code is easier to change, but shared abstractions can reduce duplication when the pattern is stable.


Decision Framework

flowchart TD
  A[New feature] --> B[Local only?]
  B -->|Yes| C[Keep feature-contained]
  B -->|No| D[Extract shared layer]

Examples

  • Keep a settings flow inside one feature folder until multiple products need the same pattern.

Checklists

  • Is the feature still easy to navigate?
  • Is shared code actually shared?
  • Are rollout and rollback covered?

Senior Engineer Notes

Senior engineers try to keep features boring to change. When the shape is obvious, delivery is faster.


Further Reading

Use search, the sidebar, or the page links to keep moving.