JSPM

  • Created
  • Published
  • Downloads 126
  • Score
    100M100P100Q63740F
  • License MIT

Generate Next.js components from your Prisma Schema

Package Exports

  • nexquik
  • nexquik/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (nexquik) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme


Logo
Nexquik

Transform your Prisma Models into stunning Next.js Server Components in seconds.

Auto-generate pieces of your app, allowing you to focus on refining your more custom components.

CLI UsagePrisma Generator UsageOptionsUse Cases

CLI Usage

Example - Creating an entire Next.js app from scratch using all of your models

npx nexquik group --name Main --init

Example - In an existing Next.js app, create an Admin route group for your user-related db models, and auto-install Nexquik dependencies.

npx nexquik group --name Admin --include User,Role,Capability --deps

Example - Create multiple groups

npx nexquik group --name Tasks --include Task,Comment,Attachment --name Admin --include User,Role,Capability

Prisma Generator Usage

Install

npm install nexquik

Add to your Prisma schema

generator nexquik {
    provider = "prisma-generator-nexquik"
    command  = "group --name Admin --include User,Role,Capability"
}

Generate

npx prisma generate

Options

Option Description Default Value
--schema <schemaLocation> Path to prisma schema file. "schema.prisma"
--output <outputDir> Path to output directory. "./"
--init Initializes a full Next.js app from scratch.
--extendOnly Only creates the models specified in the current command, and leaves previously created ones alone.
--appTitle <title> Title to be used in the header of your app. "App"
--rootName <dirName> Desired name for the root app dir for your generated groups (this is the first directory nested under your 'app' directory). "gen"
--deps Auto npm install dependencies in your output directory. (Not necessary when using --init) false
--depth <depthValue> Maximum recursion depth for your models. Changing this for large data models is not recommended, unless you filter down your models with the 'include' or 'exclude' flags also. "5"
--prismaImport <prismaImportString> Import location for your prisma client if it differs from the standard setup. "import prisma from "@/lib/prisma";"
--disabled Disable the generator. false
-h, --help Display help for command.
Command Description
group [options] Create a group to organize your models into route groups. You may create One-to-many of these.
help [command] Display help for command.

Disabled

To disable Nexquik from generating during a Prisma generate, you can either use the --disabled CLI option or set the following env var.

DISABLE_NEXQUIK=true

Use Cases

Portions of your app that rely on simple CRUD operations are prime candidates for auto-generation. Here are some examples.

User Management

A user management section typically involves creating, reading, updating, and deleting user accounts. This could include functionalities like user registration, profile management, password reset, and account deletion.

Admin Screens

Admin screens often require CRUD operations to manage various aspects of the application or website. This could include managing content, users, roles, permissions, settings, and more.

Product Catalog

An e-commerce website's product catalog might involve creating, reading, updating, and deleting products. Admins could add new products, update product details, and remove products that are no longer available.

Content Management System (CMS)

In a CMS, content creators might need to perform CRUD operations on articles, blog posts, images, and other types of content. They can create, edit, delete, and publish content.

Task Management

For a task management app, users may need to perform CRUD operations on tasks. This includes adding new tasks, marking tasks as completed, updating task details, and deleting tasks.

Customer Relationship Management (CRM)

CRM systems require basic CRUD operations to manage customer information. Users can add new contacts, update contact details, log interactions, and delete contacts if needed.

Event Calendar

An event calendar app may involve CRUD operations for adding, updating, and deleting events. Users can create new events, edit event details, and remove events from the calendar.

Inventory Management

For an inventory management system, CRUD operations could be used to manage stock items. Users can add new items, update quantities, adjust prices, and mark items as discontinued.

Feedback or Comment System

Websites with user-generated content might need CRUD operations for handling feedback, comments, or reviews. Users can post new comments, edit their comments, and delete them.

Polls or Surveys

Poll or survey applications may involve CRUD operations to manage questions, options, and responses. Admins can create new polls, update question wording, and analyze collected responses.