1.0.86 • Published 1 year ago

react-crud-generator v1.0.86

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Installation

npm i react-crud-generator --save-dev OR yarn add react-crud-generator --save-dev

Usage with example project

You can also read this guide: https://medium.com/@bans.cowboy/rhino-react-crud-generator-complete-guide-bfc5e71e812a

For easier understanding how can you use this package, you can download the example project from here. https://github.com/WingsDevelopment/rhino-consumer After downloading the project, you can run it by following the instructions in the README.md file.

Usage

After adding config files you can list all the available commands by running: npx rhino -h

First you can add all dependency components implementation by running the following command: npx rhino -i

Then you can generate the CRUD by running the following command (if you copied json schema from example this exact command will work, if not you might need to change your schema model name): npx rhino -f tag -c Tag -u Tag -d Tag -a Tag

Imports inside of components and prittier doesn't come out of the box for at this moment, so you need to add import on save to vscode settings.json file: or import manually.

Config

Add rhinoConfig.json and rhinoOpenApiSchema.json files to your root directory More about how to config those files can after about.

About

Rhino is a code generator for React projects. It generates a CRUD for a given feature. Rhino is currently very opiniated with data fetching and state management technologies, it uses axios and react-query for data fetching and state management.

Folder structure and architecture is semi opiniated, but also very configurable. By default this is the folder structure:

This folder structure can be configured! if you take a look at the rhinoConfig.json file you will see that you can change the folder structure. notice this part of configuration:

by changing the values you can change the folder structure.

Dependencies

Rhino won't work without the following dependencies: axios react-query react-router-dom typescript react-hook-form

Also you will need to provide few components, wrappers for the generated components. You can eaither implement it yourself, or generate it by running init command.

Coming soon: Configurable renaming of the components. Configurable file extensions, enabling jsx & js files instead of tsx & ts

Config rhinoOpenApiSchema

rhinoOpenApiSchema configuration is very straightforward. copy the open api schema from the swagger editor and paste it in rhinoOpenApiSchema.json

swagger open api schema example: https://petstore.swagger.io/v2/swagger.json for quick test, copy json from this link and paste it in rhinoOpenApiSchema.json copy json from under Config rhinoConfig section into rhinoConfig.json and run the command: npx rhino -f anyName -c Tag

Config rhinoConfig

This is default config that is suggested to be a starting point.

1.0.62

1 year ago

1.0.61

1 year ago

1.0.60

1 year ago

1.0.66

1 year ago

1.0.65

1 year ago

1.0.64

1 year ago

1.0.63

1 year ago

1.0.69

1 year ago

1.0.68

1 year ago

1.0.67

1 year ago

1.0.73

1 year ago

1.0.72

1 year ago

1.0.71

1 year ago

1.0.70

1 year ago

1.0.77

1 year ago

1.0.76

1 year ago

1.0.75

1 year ago

1.0.74

1 year ago

1.0.79

1 year ago

1.0.78

1 year ago

1.0.80

1 year ago

1.0.84

1 year ago

1.0.83

1 year ago

1.0.82

1 year ago

1.0.81

1 year ago

1.0.86

1 year ago

1.0.85

1 year ago

1.0.59

1 year ago

1.0.58

1 year ago

1.0.57

1 year ago

1.0.56

1 year ago

1.0.55

1 year ago

1.0.54

1 year ago

1.0.53

1 year ago

1.0.52

1 year ago

1.0.51

1 year ago

1.0.50

1 year ago

1.0.49

1 year ago

1.0.48

1 year ago

1.0.47

1 year ago

1.0.46

1 year ago

1.0.45

1 year ago

1.0.44

1 year ago

1.0.43

1 year ago

1.0.42

1 year ago

1.0.41

1 year ago

1.0.40

1 year ago

1.0.39

1 year ago

1.0.38

1 year ago

1.0.37

1 year ago

1.0.36

1 year ago

1.0.35

1 year ago

1.0.34

1 year ago

1.0.33

1 year ago

1.0.32

1 year ago

1.0.31

1 year ago

1.0.30

1 year ago

1.0.29

1 year ago

1.0.28

1 year ago

1.0.27

1 year ago

1.0.26

1 year ago

1.0.25

1 year ago

1.0.24

1 year ago

1.0.23

1 year ago

1.0.22

1 year ago

1.0.21

1 year ago

1.0.20

1 year ago

1.0.19

1 year ago

1.0.18

1 year ago

1.0.17

1 year ago

1.0.16

1 year ago

1.0.15

1 year ago

1.0.14

1 year ago

1.0.13

1 year ago

1.0.12

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago