0.0.42 • Published 11 months ago

refisma v0.0.42

Weekly downloads
-
License
ISC
Repository
github
Last release
11 months 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

11 months ago

0.0.41

11 months ago

0.0.42

11 months ago

0.0.22

12 months ago

0.0.23

12 months ago

0.0.24

12 months ago

0.0.25

12 months ago

0.0.37

11 months ago

0.0.38

11 months ago

0.0.39

11 months ago

0.0.30

12 months ago

0.0.31

12 months ago

0.0.32

12 months ago

0.0.33

12 months ago

0.0.34

12 months ago

0.0.35

12 months ago

0.0.36

12 months ago

0.0.26

12 months ago

0.0.27

12 months ago

0.0.28

12 months ago

0.0.29

12 months ago

0.0.21

12 months ago

0.0.20

12 months ago

0.0.19

12 months ago

0.0.18

12 months ago

0.0.17

12 months ago

0.0.16

12 months ago

0.0.15

12 months ago

0.0.14

12 months ago

0.0.13

12 months ago

0.0.12

12 months ago

0.0.11

12 months ago

0.0.10

12 months ago

0.0.9

12 months ago

0.0.8

12 months ago

0.0.7

12 months ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago