All Projects → josx → Ra Data Feathers

josx / Ra Data Feathers

Licence: mit
A feathers rest client for react-admin

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Ra Data Feathers

Admin On Rest
A frontend framework for building admin SPAs on top of REST services, using React and Material Design.
Stars: ✭ 392 (+190.37%)
Mutual labels:  rest, admin-dashboard, react-admin
React Admin
A frontend Framework for building B2B applications running in the browser on top of REST/GraphQL APIs, using ES6, React and Material Design
Stars: ✭ 18,525 (+13622.22%)
Mutual labels:  rest, admin-dashboard, react-admin
React Admin Low Code
react-admin (via ra-data-hasura-graphql provider) + hasura = :)
Stars: ✭ 161 (+19.26%)
Mutual labels:  admin-dashboard, react-admin
Notus Nextjs
Notus NextJS: Free Tailwind CSS UI Kit and Admin
Stars: ✭ 152 (+12.59%)
Mutual labels:  admin-dashboard, react-admin
veact-admin
🔏 Admin client for surmon.me blog powered by React & @veactjs
Stars: ✭ 39 (-71.11%)
Mutual labels:  admin-dashboard, react-admin
tntweb-admin
react admin management system template
Stars: ✭ 25 (-81.48%)
Mutual labels:  admin-dashboard, react-admin
Ant Admin
基于 antd 的后台管理平台, 在 react 中玩转 D3.js
Stars: ✭ 455 (+237.04%)
Mutual labels:  admin-dashboard, react-admin
Notus React
Notus React: Free Tailwind CSS UI Kit and Admin
Stars: ✭ 173 (+28.15%)
Mutual labels:  admin-dashboard, react-admin
3yadmin
基于react全家桶+antd构建的专注通用权限控制与表单的后台管理系统模板
Stars: ✭ 381 (+182.22%)
Mutual labels:  admin-dashboard, react-admin
Ng Admin
Add an AngularJS admin GUI to any RESTful API
Stars: ✭ 4,006 (+2867.41%)
Mutual labels:  rest, admin-dashboard
Mailman
Mailman is a GUI to help you manage your email accounts stored in a MySQL/MariaDB database.
Stars: ✭ 62 (-54.07%)
Mutual labels:  rest, admin-dashboard
Tipple
A lightweight dependency-free library for fetching data over REST with React.
Stars: ✭ 133 (-1.48%)
Mutual labels:  rest
Typescript Rest Swagger
Swagger tools for typescript-rest
Stars: ✭ 129 (-4.44%)
Mutual labels:  rest
Online Shopping System Advanced
Demo site
Stars: ✭ 127 (-5.93%)
Mutual labels:  admin-dashboard
D2 Admin
An elegant dashboard
Stars: ✭ 11,012 (+8057.04%)
Mutual labels:  admin-dashboard
Forest Express Sequelize
🌱 Express/Sequelize Liana for Forest Admin
Stars: ✭ 134 (-0.74%)
Mutual labels:  admin-dashboard
Laravel Coreui Vue
Laravel 5.6 with CoreUI (VueJS Full Starter Template) >>> Deprecated, please go to https://coreui.io/laravel/
Stars: ✭ 132 (-2.22%)
Mutual labels:  admin-dashboard
Trestle
A modern, responsive admin framework for Ruby on Rails
Stars: ✭ 1,676 (+1141.48%)
Mutual labels:  admin-dashboard
Watsonwebserver
Watson is the fastest, easiest way to build scalable RESTful web servers and services in C#.
Stars: ✭ 125 (-7.41%)
Mutual labels:  rest
Anterofit
Strongly typed, asynchronous REST client framework for Rust.
Stars: ✭ 125 (-7.41%)
Mutual labels:  rest

ra-data-feathers

All Contributors

Feathers data provider for react-admin

The perfect match to build Backend and Frontend Admin, based on REST services. For using Feathers with react-admin.

If you are searching for admin-on-rest (older react-admin version), please use 1.0.0 version

Supported react-admin request types

ra-data-feathers currently supports the following request types. More information on react-admin request types is available for data providers and auth providers in the react-admin documentation.

  • Data Provider
    • GET_LIST
    • GET_ONE
    • CREATE
    • UPDATE
    • UPDATE_MANY
    • DELETE
    • DELETE_MANY
    • GET_MANY
    • GET_MANY_REFERENCE
  • Auth Provider
    • AUTH_LOGIN
    • AUTH_LOGOUT
    • AUTH_CHECK
    • AUTH_ERROR
    • AUTH_GET_PERMISSIONS

Installation

In your react-admin app just add ra-data-feathers dependency:

npm install ra-data-feathers --save

Usage

Feathers Client

Both restClient and authClient depend on a configured Feathers client instance.

Configuration of the Feathers client is beyond the scope of this document. See the Feathers documentation for more information on configuring the Feathers client. Both of the following need to be configured in the Feathers client for use with ra-data-feathers.

Data Provider (restClient)

The ra-data-feathers data provider (restClient) accepts two arguments: client and options.

clientshould be a configured Feathers client instance. This argument is required.

options contains configurable options for the ra-data-feathers restClient. The options argument is optional and can be omitted. In this case, defaults will be used.

const options = {
  id: 'id', // If your database uses an id field other than 'id'. Optional.
  usePatch: false, // Use PATCH instead of PUT for UPDATE requests. Optional.
  my_resource: { // Options for individual resources can be set by adding an object with the same name. Optional.
    id: 'id', // If this specific table uses an id field other than 'id'. Optional.
  },
  /* Allows to use custom query operators from various feathers-database-adapters in GET_MANY calls.
   * Will be merged with the default query operators ['$gt', '$gte', '$lt', '$lte', '$ne', '$sort', '$or', '$nin', '$in']
   */
  customQueryOperators: []
}

Performant Bulk Actions can be used by enabling multi options in the feathers application

Auth Provider (authClient)

authClient also accepts two parameters. client and options.

clientshould be a configured Feathers client instance. This argument is required.

options contains configurable options for the ra-data-feathers authClient. The options argument is optional and can be omitted. In this case, defaults shown below will be used.

const options = {
  storageKey: 'token', // The key in localStorage used to store the authentication token
  authenticate: { // Options included in calls to Feathers client.authenticate
    strategy: 'local', // The authentication strategy Feathers should use
  },
  permissionsKey: 'permissions', // The key in localStorage used to store permissions from decoded JWT
  permissionsField: 'roles', // The key in the decoded JWT containing the user's role
  passwordField: 'password', // The key used to provide the password to Feathers client.authenticate
  usernameField: 'email', // The key used to provide the username to Feathers client.authenticate
  redirectTo: '/login', // Redirect to this path if an AUTH_CHECK fails. Uses the react-admin default of '/login' if omitted.
  logoutOnForbidden: true, // Logout when response status code is 403
}

Usage with the react-admin <Admin> component

ra-data-feathers can be used by passing the restClient and authClient to the react-admin <Admin> component as the dataProvider and authProvider params respectively:

<Admin
  dataProvider={restClient(feathersClient, restClientConfig)}
  authProvider={authClient(feathersClient, authClientConfig)}
/>

Example

This example assumes the following:

  • A configured Feathers client is available at ./feathersClient
  • The Feathers authentication service includes a field called userroles
  • List components for AResource and AnotherResource are available in ./resources
import { Admin, Resource } from 'react-admin';
import feathersClient from './feathersClient';
import { AResourceList } from './resources/AResource/List';
import { AnotherResourceList } from './resources/AnotherResourceList';
import { restClient, authClient } from 'ra-data-feathers';

const restClientOptions = {
  id: '_id', // In this example, the database uses '_id' rather than 'id'
  usePatch: true // Use PATCH instead of PUT for updates
};

const authClientOptions = {
  usernameField: 'username', // Our example database might use 'username' rather than 'email'
  permissionsField: 'userroles', // Use the 'userroles' field on the JWT as the users role
  redirectTo: '/signin', // Our example login form might be at '/signin', redirect here if AUTH_CHECK fails
}

const App = () => (
  <Admin
    title='ra-data-feathers Example'
    dataProvider={restClient(feathersClient, restClientOptions)}
    authProvider={authClient(feathersClient, authClientOptions)}
  >
    {permissions => [
      <Resource
        name='a_resource'
        list={AResourceList}
      />
      permissions === 'admin' ? // Only show this resource if the user role is 'admin'
        <Resource
          name='another_resource'
          list={AnotherResourceList}
        /> : null;
    ]}
  </Admin>
);

Note: the permissions restriction above only affects whether a given resource is visible or not, and will not prevent users from accessing your API directly. In most projects, this option would be used with user/role restriction hooks on the server side such as feathers-authentication-hooks.

You can find a complete example in https://github.com/kfern/feathers-aor-test-integration

Running tests

Tests for the ra-data-feathers module are available from the root directory of the module with:

npm run test

License

This software is licensed under the MIT Licence, and sponsored by Cambá.

Contributors ✨

Thanks goes to these wonderful people (emoji key):


José Luis Di Biase

💻 📖

Nicholas Nelson

💻 📖

F.C

💻 📖

Amr Noman

💻 📖

Lijo Antony

💻 📖

tony kerz

💻 📖

Dmitrii Maganov

💻 📖

Dream

💻 📖

Wédney Yuri

💻 📖

Igor Berlenko

💻 📖

Tomasz Bak

💻 📖

Dan Stevens

💻 📖

Daniel Prentis

💻 📖

Facundo Mainere

💻 📖

Fernando Navarro

💻 📖

LoMing

💻 📖

Mohammed Faizuddin

💻 📖

Ryan Harmuth

💻 📖

Santiago Botta

💻 📖

Taylor Goodall

💻 📖

Alexander Friedl

💻 📖

Fábio Toi

💻 📖

jvke

💻 📖

nhkhanh

💻 📖

This project follows the all-contributors specification. Contributions of any kind welcome!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].