0.0.42 • Published 2 years ago

refisma v0.0.42

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

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

  • Next.js
  • Node.js (Express)

Supported UI Frameworks

  • MaterialUI
  • ChakraUI
  • Ant Design
  • Mantine

Upcoming Features

  • Types will be based on the Prisma schema
  • Zod validation
  • Pagination
  • Sorting
  • Filtering
  • Generating services and endpoints for Relations
    • One to One
    • One to Many
    • Many to Many
  • Refine Pages (Only for Next.js & MaterialUI)
    • List Page
    • Create Page
    • Edit Page
    • 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
    • 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
0.0.40

2 years ago

0.0.41

2 years ago

0.0.42

2 years ago

0.0.22

2 years ago

0.0.23

2 years ago

0.0.24

2 years ago

0.0.25

2 years ago

0.0.37

2 years ago

0.0.38

2 years ago

0.0.39

2 years ago

0.0.30

2 years ago

0.0.31

2 years ago

0.0.32

2 years ago

0.0.33

2 years ago

0.0.34

2 years ago

0.0.35

2 years ago

0.0.36

2 years ago

0.0.26

2 years ago

0.0.27

2 years ago

0.0.28

2 years ago

0.0.29

2 years ago

0.0.21

2 years ago

0.0.20

2 years ago

0.0.19

2 years ago

0.0.18

2 years ago

0.0.17

2 years ago

0.0.16

2 years ago

0.0.15

2 years ago

0.0.14

2 years ago

0.0.13

2 years ago

0.0.12

2 years ago

0.0.11

2 years ago

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago