npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

domain-driver

v0.0.5

Published

A CLI scaffolding tool for domain-driven development in Next.js. Generate feature folder structures instantly — like Laravel's `php artisan make` but for Next.js.

Readme

domain-driver 🚀

A CLI scaffolding tool for domain-driven development in Next.js. Generate feature folder structures instantly — like Laravel's php artisan make but for Next.js.


Installation

npm install -g domain-driver

Or use without installing:

npx domain-driver make:feature <n>

Commands

make:feature

Scaffold a full feature folder structure.

domain-driver make:feature <n>
domain-driver make:feature <n> -a

The -a flag scaffolds all files inside each folder automatically.

domain-driver make:feature coffee-type        # folders + .gitkeep only
domain-driver make:feature coffee-type  -a    # folders + all files

make:component

Scaffold a component inside an existing feature. Defaults to client if no type is specified.

domain-driver make:component <feature> <n>
domain-driver make:component <feature> <n> client
domain-driver make:component <feature> <n> server
domain-driver make:component coffee-type CoffeeTypeList
domain-driver make:component coffee-type CoffeeTypeForm client
domain-driver make:component coffee-type CoffeeTypeCard server

make:container

Scaffold a smart container component inside an existing feature.

domain-driver make:container <feature> <n>
domain-driver make:container coffee-type CoffeeTypeContainer

make:hook

Scaffold a custom hook inside an existing feature.

domain-driver make:hook <feature> <n>
domain-driver make:hook coffee-type useCoffeeType

make:service

Scaffold a set of single-responsibility service files inside an existing feature.

domain-driver make:service <feature> <n>
domain-driver make:service coffee-type CoffeeType

Generates:

app/coffee-type/services/
├── ListCoffeeType.service.ts
├── ShowCoffeeType.service.ts
├── CreateCoffeeType.service.ts
├── UpdateCoffeeType.service.ts
└── DeleteCoffeeType.service.ts

make:repository

Scaffold a set of single-responsibility repository files inside an existing feature.

domain-driver make:repository <feature> <n>
domain-driver make:repository coffee-type CoffeeType

Generates:

app/coffee-type/repositories/
├── ListCoffeeType.repository.ts
├── ShowCoffeeType.repository.ts
├── CreateCoffeeType.repository.ts
├── UpdateCoffeeType.repository.ts
└── DeleteCoffeeType.repository.ts

make:schema

Scaffold Zod schemas for create and update operations inside an existing feature.

domain-driver make:schema <feature> <n>
domain-driver make:schema coffee-type CoffeeType

Generates:

app/coffee-type/schemas/
├── CreateCoffeeType.schema.ts
└── UpdateCoffeeType.schema.ts

What make:feature -a generates

Running domain-driver make:feature coffee-type -a creates the full structure:

app/
└── coffee-type/
    ├── components/
    │   ├── server/
    │   └── client/
    │       └── CoffeeType.tsx
    ├── containers/
    │   └── CoffeeTypeContainer.tsx
    ├── hooks/
    │   └── useCoffeeType.ts
    ├── services/
    │   ├── ListCoffeeType.service.ts
    │   ├── ShowCoffeeType.service.ts
    │   ├── CreateCoffeeType.service.ts
    │   ├── UpdateCoffeeType.service.ts
    │   └── DeleteCoffeeType.service.ts
    ├── repositories/
    │   ├── ListCoffeeType.repository.ts
    │   ├── ShowCoffeeType.repository.ts
    │   ├── CreateCoffeeType.repository.ts
    │   ├── UpdateCoffeeType.repository.ts
    │   └── DeleteCoffeeType.repository.ts
    ├── schemas/
    │   ├── CreateCoffeeType.schema.ts
    │   └── UpdateCoffeeType.schema.ts
    └── page.tsx

Philosophy

This tool follows a strict domain-driven folder structure where everything related to a feature lives together. No more hunting across /components, /hooks, and /services top-level folders.

The layer responsibilities are:

  • repositories — data fetching only, no business logic
  • services — business logic, calls repositories
  • hooks — React state and side effects, calls services
  • containers — wire hooks into UI, no direct data fetching
  • components — pure presentational UI, no data dependencies
  • schemas — Zod validation for create and update operations

Requirements

  • Node.js 18+

Framework Support

This tool is optimised for Next.js App Router projects. All files are scaffolded into the app/ directory following Next.js conventions (page.tsx, server/client component separation, etc.).

If no app/ directory exists, it will be created automatically. This means the tool can also be used in any project where an app/<feature> folder structure makes sense.

Local Development

# Clone the repo
git clone https://github.com/IsaacHatilima/domain-driver
cd domain-driver

# Install dependencies
npm install

# Build
npm run build

# Link globally for local testing
npm link

# Test it
domain-driver make:feature test-feature
domain-driver make:feature test-feature -a

Roadmap

  • [x] make:feature — scaffold feature folder structure
  • [x] make:feature -a — scaffold feature with all files
  • [x] make:component — scaffold a component
  • [x] make:container — scaffold a container
  • [x] make:hook — scaffold a custom hook
  • [x] make:service — scaffold single-responsibility services
  • [x] make:repository — scaffold single-responsibility repositories
  • [x] make:schema — scaffold Zod schemas
  • [ ] Interactive mode — prompt for name if not provided
  • [ ] Config file — customize folder structure per project

License

MIT