Coder Social home page Coder Social logo

nikolasmelui / react-admin-nestjsx-crud-dataprovider Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fusionworks/react-admin-nestjsx-crud-dataprovider

0.0 2.0 0.0 399 KB

Data provider which integrates React Admin with NestJS CRUD library

HTML 5.44% CSS 2.97% JavaScript 69.44% TypeScript 19.12% Shell 3.03%

react-admin-nestjsx-crud-dataprovider's Introduction

@FusionWorks/ra-data-nest-crud

GitHub package.json version NPM

@FusionWorks/ra-data-nest-crud is a dataprovider for react-admin, that has been designed to make easier communication between a frontend application built with react-admin, and a backend application built with nestjs framework and nestjsx/crud.

Install

Using npm: npm i @fusionworks/ra-data-nest-crud

Using yarn: yarn add @fusionworks/ra-data-nest-crud

Usage

// in app.js file

import React from 'react';
import { Admin, Resource, ShowGuesser } from 'react-admin';
import crudProvider from '@fusionworks/ra-data-nest-crud'
import { UsersList, UserCreate, UserEdit } from './Users'

const dataProvider = crudProvider('http://localhost:3000');
const App = () => (
  <Admin dataProvider={dataProvider}>
    <Resource name="users" list={UsersList} create={UserCreate} edit={UserEdit} show={ShowGuesser} />
  </Admin>
);
export default App;

Note: In case of REST verb "CREATE" consider that the response body is the same as the request body but with the object ID injected .

case CREATE:
return { data: { ...params.data, id: json.id } };

This is because of backwards compatibility compliance.

Example

You can find an example of a project that uses nestjs and nestjsx/crud on backend and admin-ui with @fusionworks/ra-data-nest-crud data provider.

If you need to run it, you need to go to api folder, install dependencies, change by your needs the config file for nestjs that is located in example/api/src/config/, and run application.

  • cd api
  • npm i
  • npm run start:dev

For frontend part you need just to go to admin-ui folder, install dependencies, and run the app:

  • cd admin-ui
  • npm i
  • npm start

react-admin-nestjsx-crud-dataprovider's People

Contributors

gganebnyi avatar nzuza avatar tfarras avatar dependabot[bot] avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.