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

schemacn

v0.1.0

Published

Schema to shadcn CRUD pages

Readme

SchemaCN

SchemaCN turns Prisma schemas into ready-to-use shadcn CRUD pages for Next.js App Router.

SchemaCN demo

Why

Indie devs ship CRUD apps every week. SchemaCN removes the glue work between schema, forms, tables, and pages.

Features (MVP)

  • Prisma schema input
  • Next.js App Router output
  • List, detail, create, and edit pages
  • shadcn components + TanStack Table-ready structure
  • Zod schemas for validation

Quickstart

npx schemacn generate --schema ./prisma/schema.prisma --out ./

By default, SchemaCN writes pages and components to your app folder. Adjust output with --out.

Config file

Create a schemacn.json in your app root (or pass --config):

{
  "schema": "./prisma/schema.prisma",
  "out": ".",
  "skipAuth": true,
  "includeModels": ["Video", "Subscription"],
  "excludeModels": ["Session"],
  "force": false
}

SchemaCN looks for schemacn.json in --config, your --out directory, or the current working directory. Paths in schemacn.json are resolved relative to the config file location. If schema is set in the config, you can omit --schema.

Requirements

The generated code expects these dependencies in your app:

  • shadcn/ui components (button, form, input, textarea, checkbox, select, table)
  • react-hook-form
  • @hookform/resolvers
  • zod

SchemaCN will also report any missing shadcn/ui components or npm deps after generation.

CLI

schemacn generate \
  --schema ./prisma/schema.prisma \
  --out ./

Options:

  • --schema: Path to Prisma schema file
  • --out: Output directory (usually your app root)
  • --models: Comma-separated list of models to generate (optional)
  • --config: Path to schemacn.json
  • --include-auth: Include auth models (User, Account, Session, VerificationToken)
  • --force: Overwrite existing files

By default, auth models are skipped unless you pass --include-auth or explicitly list them with --models.

Example

Schema:

model Video {
  id        String   @id @default(cuid())
  title     String
  createdAt DateTime @default(now())
}

Output (paths):

app/videos/page.tsx
app/videos/new/page.tsx
app/videos/[id]/page.tsx
app/videos/[id]/edit/page.tsx
components/schemacn/video-form.tsx
components/schemacn/video-table.tsx
lib/schemacn/video.schema.ts
lib/schemacn/video.data.ts

Output Structure

app/
  users/
    page.tsx
    new/page.tsx
    [id]/page.tsx
    [id]/edit/page.tsx
components/
  schemacn/
    user-form.tsx
    user-table.tsx
lib/
  schemacn/
    user.schema.ts
    user.data.ts

Notes

  • Data access is scaffolded. Swap in your own db calls.
  • The generated code is plain React + shadcn. No runtime lock-in.

License

MIT