How to recognise architecture patterns in a codebase
Layered, MVC, feature folders, hexagonal, clean architecture, microservices and modular monoliths: how to spot which one a codebase uses and what that tells you.
Recognising a codebase's architecture early saves hours, because it tells you where to look for things before you look. Most codebases follow one or two common patterns, often imperfectly.
Layered architecture
Signs: folders named controllers, services, repositories or models; requests flow down the layers.
What it tells you: HTTP concerns are in controllers, business rules in services, data access in repositories. To understand a feature, read its controller, then its service.
Watch for: business logic leaking into controllers, and services calling each other in tangled ways.
MVC
Signs: models, views and controllers folders; common in Rails-inspired frameworks like AdonisJS and older Express apps.
What it tells you: controllers handle requests, models hold data and rules, views render output.
Feature folders (vertical slices)
Signs: top-level folders named after product features (checkout, catalog, accounts), each containing its own components, API code and tests.
What it tells you: everything about a feature is in one place. Read one folder to understand one feature. Shared code lives in a shared or common folder.
Hexagonal (ports and adapters) and clean architecture
Signs: folders like domain, application, infrastructure, adapters or ports; interfaces with several implementations.
What it tells you: core business logic in domain has no dependencies on frameworks or databases. Adapters connect it to the outside world. To understand rules, read the domain; to understand integration, read the adapters.
Modular monolith
Signs: one deployable app with clear internal modules, each with its own public interface, sometimes enforced by lint rules.
What it tells you: modules talk through defined interfaces. Look for each module's index file or public API.
Microservices
Signs: several services in one or many repositories, each with its own deployment config; HTTP clients, message queues and API contracts between them.
What it tells you: a feature may cross services. Following it means following network calls and events, not imports.
Framework-defined architecture
Many modern apps follow their framework's structure: file-based routes in Next.js, SvelteKit or Nuxt; modules in NestJS. The framework is the architecture, and our codebase guides describe each one.
Most codebases are a mix
Real projects combine patterns and drift over time: a layered core with feature folders added later, or a clean architecture with shortcuts. Look for the dominant pattern and note the exceptions.
Ask for the overview
Ask RepoGrasp "give me an architecture overview of this repo: the main layers or modules and how a request moves between them." You'll get a structured overview with file:line citations for each part, which is a fast way to test your guess about the pattern.