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 🙏

© 2024 – Pkg Stats / Ryan Hefner

refisma

v0.0.42

Published

Refisma is a CLI to create full-stack resources with Next JS, Prisma and Refine

Downloads

55

Readme

Refisma

Refisma is a tool to help you create CRUD applications by using Prisma. It generates services and endpoints for you, so you can focus on the business logic.

Description

Refisma is a tool to help you create CRUD applications by using Prisma. It generates services and endpoints for you, so you can focus on the business logic.

Supported Platforms

  • [x] Next.js
  • [ ] Node.js (Express)

Supported UI Frameworks

  • [x] MaterialUI
  • [ ] ChakraUI
  • [ ] Ant Design
  • [ ] Mantine

Upcoming Features

  • [x] Types will be based on the Prisma schema
  • [x] Zod validation
  • [ ] Pagination
  • [ ] Sorting
  • [ ] Filtering
  • [ ] Generating services and endpoints for Relations
    • [x] One to One
    • [x] One to Many
    • [x] Many to Many
  • [x] Refine Pages (Only for Next.js & MaterialUI)
    • [x] List Page
    • [x] Create Page
    • [x] Edit Page
    • [x] Show Page
  • [ ] Custom identifier for resources
  • [ ] Providers
    • [ ] Auth
    • [ ] i18n
    • [ ] Access Control
  • [ ] Compiler For Refisma
    • [ ] hide fields on views (list, create, edit, show)
    • [ ] fields accessiblities (list, create, edit, show)
  • [ ] Middlewares
    • [x] Zod validation
    • [ ] Access Control

Installation

npm install refisma

Usage

npx refisma

Packages Needed

npm install @prisma/client zod
npm install prisma --save-dev

.env file

DATABASE_URL=""
NEXT_PUBLIC_SERVER_API_URL='http://localhost:3000/api'

Adding Aliases

You need to add aliases to your tsconfig.json file.

{
  ...
    "paths": {
      "@services/*": ["services/*"],
      "@schemas/*": ["schemas/*"],
      ...
    }
  ...
}

### Adding New Resources to _app.tsx file

The example below shows how to add a new resource to the _app.tsx file.

  <Refine
    ...
    resources={[
      ...
      {
          name: '{{resourceName}}',
          list: '/{{resourceName}}',
          create: '/{{resourceName}}/create',
          edit: '/{{resourceName}}/edit/:id',
          show: '/{{resourceName}}/show/:id',
          meta: {
              canDelete: true,
          },
      }
      ...
    ]}
    ...
  >

Generating Types for Prisma

npx prisma generate