What are Layers?

Understanding the core unit of OSDD architecture in Nuxt.

A layer is the core unit of OSDD architecture in nuxt-osdd. Each layer lives inside either functional/ or technical/ at your project root.

nuxt-osdd builds on Nuxt Layers, which are a core concept of Nuxt itself. OSDD does not replace that concept — it gives it a clearer organization model, a simpler configuration entrypoint, and commands to generate layers quickly.

Anatomy of a Layer

A generated layer typically looks like this:

functional/Contracts/
├── nuxt.config.ts
├── app/
│   ├── components/
│   ├── composables/
│   ├── pages/
│   └── assets/
└── README.md

A technical layer follows the same idea:

technical/Authentication/
├── nuxt.config.ts
├── app/
│   ├── composables/
│   ├── plugins/
│   └── utils/
└── README.md

The exact content can vary depending on your needs, but the goal stays the same: each layer owns a coherent part of the application.

What makes a directory a valid layer

In practice, nuxt-osdd creates a layer as a standard Nuxt layer with its own nuxt.config.ts. That is what allows Nuxt to extend and compose it with the rest of the app.

For example:

functional/Contracts/nuxt.config.ts
export default defineNuxtConfig({
  // layer-specific config
})
Nuxt Layers are native to Nuxt. nuxt-osdd simply helps you organize them into functional/ and technical/ buckets with a clear convention.

Layer declaration

nuxt-osdd uses a simple osdd key in your root nuxt.config.ts to declare the layers your app depends on.

nuxt.config.ts
import { defineOSDDNuxtConfig } from 'nuxt-osdd'

export default defineOSDDNuxtConfig({
  osdd: {
    technical: ['Authentication', 'Permissions'],
    functional: ['Contracts', 'Posts']
  }
})

This keeps the entrypoint explicit and easy to read.

functional/ vs technical/

BucketPurposeExamples
functional/Business and product domainsUsers, Contracts, Orders, Billing, Posts
technical/Infrastructure and cross-cutting concernsAuthentication, Permissions, ApiClient, Database, Monitoring

This distinction is mostly organizational: technically, both are Nuxt layers. The benefit is that responsibilities become immediately clearer for the team.

Creating a layer

Layer creation has its own dedicated page: see Creating Layers. You will find the CLI syntax, examples, and the generated file structure there.

Why this matters

The value of nuxt-osdd is not only in the folder names. It gives Nuxt teams a shared way to:

  • separate business features from infrastructure
  • declare layers with a simple config
  • generate new layers quickly
  • scale a codebase without losing clarity

That makes OSDD a practical way to apply Nuxt's native layers concept in real-world projects.