FORM FOLLOWS DOMAIN. DOMAIN COMES FIRST.NODE.JS / REACT

Not another framework.
The part frameworks leave to you.

Domain First does not replace Next.js, Nest or anything else, and it does not compete with them. It fills the gap they leave.

YOUR FRAMEWORK●
  1. Routing, middleware, rendering, the request lifecycle — and it is good at all of it.
  2. The architecture is left to you: a dozen terms that every team, book and agent reads a little differently.
  3. The files go wherever you put them, and nothing checks that a dependency points the right way.
DOMAIN FIRST■
  1. One meaning for every term: aggregate, repository, use case, port — written down in the conventions.
  2. A scaffolder that puts each piece in its place and keeps the layers honest.
  3. A few small libraries that make domain code pleasant to write. Nothing more.

Keep the framework you have. We take care of everything that is not it.

Small parts.
One foundation.

Focused tools for the code inside your application — and one structure that holds them together.

THE BUILDING BLOCKS●
  1. Compact NPM libraries: types, errors, wire, handlers.
  2. Each one solves a single problem. Take the ones you need, leave the rest.
  3. Plain TypeScript at runtime — no framework to adopt, nothing to fight.
THE PROJECT STRUCTURE■
  1. The scaffolder gives every domain model, handler and endpoint a predictable home.
  2. Layers stay apart: domain, application, infrastructure, presentation.
  3. Wiring connects the pieces, so every part works with the rest.

Use one library or all of them. They were built to fit together.

How to start.
Three steps.

From an empty package to your first bounded context in less than a minute.

  1. STEP 01 / INSTALL●

    Add the CLI.

    npm i -D @domain-first/project-structure

    Project Structure is a dev dependency: it generates code and never ships with your app.

  2. STEP 02 / INITIALIZE■

    Choose your packages.

    npx df-ps

    Answer the setup questions. Pick the @domain-first packages you need with space, or press a to select them all.

    THEN

    Copy the install command the CLI prints for your selection and run it.

  3. STEP 03 / SCAFFOLD▲

    Generate the structure.

    npx df-ps

    Run it again to open the scaffolder menu: create a bounded context, pick a layer, generate one piece at a time.

That's the whole setup. Everything after is your domain.

Human first.
AI friendly.

Code you enjoy writing and maintaining — and that your agent finds its way around too.

FOR YOU●
  1. Names come from the business: Order, CancelOrder, not managers and utils.
  2. Every component has one predictable home. You know where to look before you open the editor.
  3. Bounded contexts stay apart, so changing one never surprises you in another.
FOR YOUR AGENT■
  1. Conventions instead of guesswork: the same rules you follow, written down where it can read them.
  2. New files come from df-ps, not improvisation. Every scaffold looks like the last one.
  3. Skills teach the workflow: plan, get your approval, scaffold, implement.

Nothing here is written for the machine. That's exactly why it works for one.