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

nuxtrails

v1.2.4

Published

Rails-style scaffolding for Nuxt 4 with Prisma

Readme

Nuxtrails

What is nuxtrails ?

This is personal tool, let's see how it goes, and if someone else finds it useful, great!

It is a opinionated, Rails-inspired scaffolding CLI for Nuxt 4 + Prisma. It is powered by the amazing nuxi tool, it goes one step beyond with some of the things it will create for you.

  • Generate models,
  • APIs endpoints.
  • Pinia store for each model.
  • Page routes to view your data.
  • and components to render it.

... just like Rails, but with Vue & Nuxt! I hope it saves you time and makes building fullstack Nuxt apps easier!

You can paste this command to your LLM to to create the commands for you to generate your desired model.


✨ What It Does

nuxtrails is a fullstack CLI generator for Nuxt 4 projects.

When you run:

nuxtrails generate model Post title:string body:text published:boolean

It will:

✅ Create a Prisma model in prisma/schema.prisma
✅ Run prisma migrate dev
✅ Generate full RESTful API under server/api/posts
✅ Create a Pinia store in stores/posts.ts
✅ Scaffold CRUD pages in pages/posts/
✅ Generate reusable Vue components (PostForm.vue, PostTable.vue)
✅ Auto-generate routes based on file system

Optional Flags

--auth
  • Adds password field to your model (or creates a User model with email + password when used with User)
  • Installs and configures basic authentication scaffold: /api/auth/* endpoints, middleware and a Nuxt plugin using @sidebase/nuxt-auth + bcryptjs.

--policy
  • Generates an authorization policy stub (policies/<Model>Policy.ts) with default canRead / canCreate / canUpdate / canDelete helpers so you can plug in your own rules.

Use them individually or together:

# Full auth + policy scaffold for a User model
nuxtrails generate model User email:string --auth --policy

# Add policies to any other resource
nuxtrails generate model Post title:string body:text --policy

Quick Start

Option 1: Use via npx (no install)

npx nuxtrails new blog
cd blog
npx nuxtrails generate model Post title:string body:text published:boolean

Option 2: Install globally

npm install -g nuxtrails

# Create new Nuxt 4 project scaffolded with Prisma
nuxtrails new blog
cd blog

# Generate a full model with API + pages + store
nuxtrails generate model Post title:string body:text published:boolean

📁 Output Structure

blog/
├── prisma/
│   └── schema.prisma
├── server/api/posts/
│   ├── index.get.ts
│   ├── create.post.ts
│   ├── [id].get.ts
│   ├── [id].put.ts
│   └── [id].delete.ts
├── stores/posts.ts
├── pages/posts/
│   ├── index.vue
│   ├── create.vue
│   ├── [id].vue
│   └── [id]/edit.vue
└── components/
    ├── PostForm.vue
    └── PostTable.vue

📦 Dependencies It Sets Up

When you run nuxtrails new blog, it installs:

  • Nuxt 4 (via nuxi init)
  • Prisma + @prisma/client
  • Pinia (via @pinia/nuxt)

🛠 Requirements

  • Node.js >= 18
  • npm or pnpm
  • Internet access (to run nuxi, install dependencies)

📘 License

MIT