• Stars
    star
    22,823
  • Rank 942 (Top 0.02 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created almost 8 years ago
  • Updated 8 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A frontend Framework for building B2B applications running in the browser on top of REST/GraphQL APIs, using ES6, React and Material Design

react-admin Build status FOSSA Status StandWithUkraine

A frontend Framework for building data-driven applications running in the browser on top of REST/GraphQL APIs, using ES6, React and Material Design. Open sourced and maintained by marmelab.

Home page - Documentation - Examples - Blog - Releases - Support

react-admin-demo

Features

  • ๐Ÿ”Œ Backend Agnostic: Connects to any API (REST or GraphQL, see the list of more than 45 adapters)

  • ๐Ÿงฉ All The Building Blocks You Need: Provides hooks and components for authentication, routing, forms & validation, datagrid, search & filter, relationships, validation, roles & permissions, rich text editor, i18n, notifications, menus, theming, caching, etc.

  • ๐Ÿชก High Quality: Accessibility, responsive, secure, fast, testable

  • ๐Ÿ’ป Great Developer Experience: Complete documentation, IDE autocompletion, type safety, storybook, demo apps with source code, modular architecture, declarative API

  • ๐Ÿ‘‘ Great User Experience: Optimistic rendering, filter-as-you-type, undo, preferences, saved queries

  • ๐Ÿ›  Complete Customization: Replace any component with your own

  • โ˜‚๏ธ Opt-In Types: Develop either in TypeScript or JavaScript

  • ๐Ÿ‘จโ€๐Ÿ‘ฉโ€๐Ÿ‘งโ€๐Ÿ‘ฆ Powered by Material UI, react-hook-form, react-router, react-query, TypeScript and a few more

Installation

React-admin is available from npm. You can install it (and its required dependencies) using:

npm install react-admin
#or
yarn add react-admin

Documentation

At a Glance

// in app.js
import * as React from "react";
import { render } from 'react-dom';
import { Admin, Resource } from 'react-admin';
import restProvider from 'ra-data-simple-rest';

import { PostList, PostEdit, PostCreate, PostIcon } from './posts';

render(
    <Admin dataProvider={restProvider('http://localhost:3000')}>
        <Resource name="posts" list={PostList} edit={PostEdit} create={PostCreate} icon={PostIcon} />
    </Admin>,
    document.getElementById('root')
);

The <Resource> component is a configuration component that allows you to define sub components for each of the admin view: list, edit, and create. These components use Material UI and custom components from react-admin:

// in posts.js
import * as React from "react";
import { List, Datagrid, Edit, Create, SimpleForm, DateField, TextField, EditButton, TextInput, DateInput, useRecordContext } from 'react-admin';
import BookIcon from '@mui/icons-material/Book';
export const PostIcon = BookIcon;

export const PostList = () => (
    <List>
        <Datagrid>
            <TextField source="id" />
            <TextField source="title" />
            <DateField source="published_at" />
            <TextField source="average_note" />
            <TextField source="views" />
            <EditButton />
        </Datagrid>
    </List>
);

const PostTitle = () => {
    const record = useRecordContext();
    return <span>Post {record ? `"${record.title}"` : ''}</span>;
};

export const PostEdit = () => (
    <Edit title={<PostTitle />}>
        <SimpleForm>
            <TextInput disabled source="id" />
            <TextInput source="title" />
            <TextInput source="teaser" options={{ multiline: true }} />
            <TextInput multiline source="body" />
            <DateInput label="Publication date" source="published_at" />
            <TextInput source="average_note" />
            <TextInput disabled label="Nb views" source="views" />
        </SimpleForm>
    </Edit>
);

export const PostCreate = () => (
    <Create title="Create a Post">
        <SimpleForm>
            <TextInput source="title" />
            <TextInput source="teaser" options={{ multiline: true }} />
            <TextInput multiline source="body" />
            <TextInput label="Publication date" source="published_at" />
            <TextInput source="average_note" />
        </SimpleForm>
    </Create>
);

Does It Work With My API?

Yes.

React-admin uses an adapter approach, with a concept called Data Providers. Existing providers can be used as a blueprint to design your API, or you can write your own Data Provider to query an existing API. Writing a custom Data Provider is a matter of hours.

Data provider architecture

See the Data Providers documentation for details.

Batteries Included But Removable

React-admin is designed as a library of loosely coupled React components and hooks exposing reusable controller logic. It is very easy to replace any part of react-admin with your own, e.g. using a custom datagrid, GraphQL instead of REST, or Bootstrap instead of Material Design.

Examples

There are several examples inside the examples folder:

  • simple (StackBlitz): a simple blog with posts, comments and users that we use for our e2e tests.
  • e-commerce: (demo, source) A fictional poster shop admin, serving as the official react-admin demo.
  • CRM: (demo, source) A customer relationship management application
  • helpdesk: (demo, source) A ticketing application with realtime locks and notifications
  • tutorial (Stackblitz): the application built while following the tutorial.

You can run those example applications by calling:

# At the react-admin project root
make install
# or
yarn install

# Run the simple application
make run-simple

# Run the tutorial application
make build
make run-tutorial

# Run the demo application
make build
make run-demo

And then browse to the URL displayed in your console.

Support

Versions In This Repository

  • master - commits that will be included in the next patch release

  • next - commits that will be included in the next major or minor release

Bugfix PRs that don't break BC should be made against master. All other PRs (new features, BC breaking bugfixes) should be made against next.

Contributing

If you want to give a hand: Thank you! There are many things you can do to help making react-admin better.

The easiest task is bug triaging. Check that new issues on GitHub follow the issue template and give a way to reproduce the issue. If not, comment on the issue to ask precisions. Then, try and reproduce the issue following the description. If you managed to reproduce the issue, add a comment to say it. Otherwise, add a comment to say that something is missing.

The second way to contribute is to answer support questions on StackOverflow. There are many beginner questions there, so even if you're not super experienced with react-admin, there is someone you can help there.

Pull requests for bug fixes are welcome on the GitHub repository. There is always a bunch of issues labeled "Good First Issue" in the bug trackerโ€”start with these.

If you want to add a feature, you can open a Pull request on the next branch. We don't accept all featuresโ€”we try to keep the react-admin code small and manageable. Try and see if your feature can't be built as an additional npm package. If you're in doubt, open a "Feature Request" issue to see if the core team would accept your feature before developing it.

For all Pull requests, you must follow the coding style of the existing files (based on prettier), and include unit tests and documentation. Be prepared for a thorough code review, and be patient for the mergeโ€”this is an open-source initiative.

Tip: Most of the commands used by the react-admin developers are automated in the makefile. Feel free to type make without argument to see a list of the available commands.

Setup

Clone this repository and run make install to grab the dependencies, then make build to compile the sources from TypeScript to JS.

Testing Your Changes In The Example Apps

When developing, most of the time we use the simple example to do visual check. It's the same application that we use in Stackblitz to reproduce errors (see https://stackblitz.com/github/marmelab/react-admin/tree/master/examples/simple). The source is located under examples/simple/. Call make run to launch that example on port 8080 (http://localhost:8080). This command includes a watch on the react-admin source, so any of the changes you make to the react-admin packages triggers a live update of the simple example in your browser.

However, the simple example is sometimes too limited. You can use the demo example (the source for https://marmelab.com/react-admin-demo/), which is more complete. The source is located under examples/demo/. Call make run-demo to launch the demo example with a REST dataProvider, or make run-graphql-demo to run it with a GraphQL dataProvider. Unfortunately, due to the fact that we use Create React App for this demo, these commands don't watch the changes made in the packages. You'll have to rebuild the react-admin packages after a change (using make build, or the more targeted make build-ra-core, make build-ra-ui-materialui, etc.) to see the effect in the demo app.

Both of these examples work without serverโ€”the API is simulated on the client-side.

Testing Your Changes In Your App

Using yarn link, you can have your project use a local checkout of the react-admin package instead of downloading from npm. This allows you to test react-admin changes in your app.

The following instructions are targeting yarn >= v3 in the client app.

# Go to the folder of your client app
$ cd /code/path/to/myapp/

# Use the latest version of yarn package manager
$ corepack enable && yarn set version stable

# Replace the npm-installed version with a symlink to your local version 
$ yarn link /code/path/to/react-admin/packages/react-admin

# If you modified additional internal packages in the react-admin monorepo, e.g. ra-core, also make a link
$ yarn link /code/path/to/react-admin/packages/ra-core

# Build all of the react-admin package distribution
$ cd /code/path/to/react-admin/ && make build

# Return to your app and ensure all dependencies have resolved 
$ cd /code/path/to/myapp/ && yarn install

# Start your app
$ yarn start

Tip: If you are still using yarn v1 as your package manager in your client app, we strongly recommend you to update as it is frozen and no longer maintained.

Automated Tests

Automated tests are also crucial in our development process. You can run all the tests (linting, unit and functional tests) by calling:

make test

Unit tests use jest, so you should be able to run a subset of tests, or run tests continuously on change, by passing options to

yarn jest

Besides, tests related to the modified files are run automatically at commit using a git pre-commit hook. This means you won't be able to commit your changes if they break the tests.

When working on the end-to-end tests, you can leverage cypress runner by starting the simple example yourself (make run-simple or yarn run-simple) and starting cypress in another terminal (make test-e2e-local or yarn test-e2e-local).

Coding Standards

If you have coding standards problems, you can fix them automatically using prettier by calling

make prettier

However, these commands are run automatically at each commit so you shouldn't have to worry about them.

Documentation

If you want to contribute to the documentation, just call:

make docker-doc

And then browse to http://localhost:4000/

License

React-admin is licensed under the MIT License, sponsored and supported by marmelab.

FOSSA Status

Donate

This library is free to use, even for commercial purpose. If you want to give back, please talk about it, help newcomers, or contribute code. But the best way to give back is to donate to a charity. We recommend Doctors Without Borders.

More Repositories

1

gremlins.js

Monkey testing library for web apps and Node.js
JavaScript
8,971
star
2

ng-admin

Add an AngularJS admin GUI to any RESTful API
JavaScript
3,968
star
3

awesome-rest

A collaborative list of great resources about RESTful API architecture, development, test, and performance
3,457
star
4

json-graphql-server

Get a full fake GraphQL API with zero coding in less than 30 seconds.
JavaScript
1,899
star
5

universal.css

The only CSS you will ever need
CSS
1,260
star
6

EventDrops

A time based / event series interactive visualization using d3.js
JavaScript
1,236
star
7

restful.js

A pure JS client for interacting with server-side RESTful resources. Think Restangular without Angular.
JavaScript
969
star
8

gaudi

Gaudi allows to share multi-component applications, based on Docker, Go, and YAML.
Go
566
star
9

ng-admin-react

Add a ReactJS admin GUI to any RESTful API. Deprecated: see admin-on-rest for a full rewrite
JavaScript
544
star
10

FakeRest

Patch fetch/XMLHttpRequest to fake a REST API server in the browser, based on JSON data.
JavaScript
407
star
11

admin-on-rest

A frontend framework for building admin SPAs on top of REST services, using React and Material Design.
JavaScript
400
star
12

admin-on-rest-demo

Source of the admin-on-rest react.js demo, using a dummy REST service powered by FakeRest
JavaScript
329
star
13

ng-admin-demo

Source of the ng-admin angular.js demo, using a dummy REST service powered by FakeRest
JavaScript
305
star
14

sedy

A GitHub bot bringing the sed command to code reviews
JavaScript
266
star
15

javascript-boilerplate

Node.js+Koa.js+PostgreSQL+React.js+Webpack+Mocha+Makefile, a starter kit for new apps
JavaScript
253
star
16

ArchitectureTree

Draw and share your software architecture without diagramming software. Uses d3.js and Angular.js.
JavaScript
218
star
17

comfygure

Encrypted and versioned configuration store built with collaboration in mind
JavaScript
192
star
18

microrest.php

A micro web application providing a REST API on top of any relational database, using Silex and Doctrine DBAL
PHP
186
star
19

graphql-schema-from-json

Guess a GraphQL schema from json data
JavaScript
182
star
20

tree.js

Tree.js is a JavaScript library to build and manipulate hookable trees.
JavaScript
148
star
21

greenframe-cli

Estimate the carbon footprint of a user scenario on a web application
TypeScript
137
star
22

ra-supabase

Supabase adapter for react-admin, the frontend framework for building admin applications on top of REST/GraphQL services.
TypeScript
127
star
23

ng-admin-postgrest

Demo of an integration between ng-admin and PostgREST
JavaScript
111
star
24

phpcr-browser

Web interface for browsing PHPCR repositories, using Silex and AngularJS
CSS
103
star
25

sketch-by-phone

A proof-of-concept of Augmented Reality with HTML5
JavaScript
97
star
26

ArcheoloGit

Where should you focus the maintenance efforts? ArcheoloGit is a visualization of age and dev activity for software, powered by d3.js.
JavaScript
95
star
27

phpunit-d3-report

Visualize the slowest parts of a PHPUnit testsuite using d3.js
JavaScript
93
star
28

GraphQL-example

An example code structure for a GraphQL-powered mobile app. Contains client and server code.
JavaScript
86
star
29

make-docker-command

Seamlessly execute commands (composer, bower, compass) in isolation using docker and make.
Makefile
83
star
30

aor-graphql

Packages related to using GraphQL with Admin-on-rest
JavaScript
81
star
31

react-admin-demo

Source of the react-admin react.js demo, using a dummy REST service powered by FakeRest
67
star
32

ra-auth-acl

Access Control List authProvider and helpers for React Admin
TypeScript
64
star
33

aor-dependent-input

A component for displaying input depending on other inputs values in Admin-on-rest
JavaScript
60
star
34

argos

docker monitoring experiment
58
star
35

react-md-motion

Material design motions with react
JavaScript
54
star
36

Raphael.InlineTextEditing

Raphael Plugin allowing inline edition of SVG text elements
JavaScript
54
star
37

ra-example-oauth

An example of OpenID Connect implementation on React Admin
TypeScript
53
star
38

aor-simple-graphql-client

A simple GraphQL client for admin-on-rest
JavaScript
48
star
39

ZeroDollarHomePage

A decentralized ad server running on the blockchain
JavaScript
45
star
40

SonataElasticaBundle

Power the Sonata Admin list view and filters by an ElasticSearch index to speed up navigation.
PHP
43
star
41

aor-permissions

A component for Admin-on-rest allowing to switch views depending on user permissions. Eg: having different PostEdit components for different users
JavaScript
42
star
42

react-admin-crm

A CRM build with react-admin, used as a demo for the capabilities of the framework
HTML
40
star
43

ra-in-memory-jwt

Manage React-admin authentication with jwt in memory, not in local storage
JavaScript
39
star
44

koa-multifetch

A Koa.js middleware for performing internal batch requests
JavaScript
36
star
45

gollabedit

Experimental collaborative editor written in Go
Go
33
star
46

admin-config

Configuration API to describe an administration interface. Used by ng-admin and react-admin.
JavaScript
31
star
47

ocaml-invader

Ocaml Space-Invader implementation using OpenGL
OCaml
29
star
48

admin-on-rest-graphql-demo

JavaScript
29
star
49

ra-data-google-sheets

A data provider for react-admin, based on Google Sheets
JavaScript
26
star
50

ra-datagrid

Integration of Material-ui's <Datagrid> into react-admin
TypeScript
26
star
51

battery-friendly-timer

Mobile applications using setInterval to poll a server are a battery hogs. Save battery life by fetching data at the right moment.
JavaScript
25
star
52

MobileInsight

A Mobile web app to browse PHP code analyses made by SensioLabsInsight, built with Angular.js and Ionic.
JavaScript
25
star
53

yolo

Typo-tolerant runtime object proxy for fast JavaScritp typers
JavaScript
24
star
54

aor-rich-text-input

<RichTextInput> component for admin-on-rest, useful for editing HTML code in admin GUIs
CSS
23
star
55

timeline-react-admin

Support for a tutorial about custom List views with react-admin
JavaScript
23
star
56

strapi-beerdex

StrapiJS Example Application For Beer Management
JavaScript
23
star
57

chrome-bug-report-wizard

Chrome plugin automating Bug Tracker issue creation with screenshot and browser details
JavaScript
23
star
58

argos-cli

19
star
59

aor-realtime

JavaScript
17
star
60

solid-admin

TypeScript
17
star
61

ra-enterprise-demo

TypeScript
16
star
62

svelte-sse-chat

Chat Example Application Using SvelteJS and Chat
Svelte
15
star
63

uptime

A prototype of website monitoring tool, written in Go and React.js, modeled after fzaninotto/uptime
JavaScript
15
star
64

reactive-beers

Reactive Beers is an example application using CouchDB and PouchDB
JavaScript
15
star
65

reversi-reason

๐Ÿช ReasonML implementation of Reversi Game
OCaml
13
star
66

MobileAudience

Mobile Webapp mixing D3.js with a touch UI ; shows TV audiences and market shares for 8 fictive TV channels across several days.
JavaScript
13
star
67

ng-tree

An Angular.js module for using tree.js
JavaScript
12
star
68

docker-parallel-phpunit-demo

How to use Docker to run PHPUnit tests in parallel
PHP
12
star
69

skelt

{ } Skelt is a simple templating engine for object literals.
JavaScript
12
star
70

redux-form-inspector

An HOC for computing dynamic props from values inside an existing redux-form component.
JavaScript
12
star
71

virothello

๐Ÿ’ซ Othello Game Using Augmented Reality And Viro
JavaScript
12
star
72

coPostgresQuery

Query builder for PostgreSQL in Node.js, built for async
JavaScript
11
star
73

phpcr-api

PHP
11
star
74

svg_to_png

Convert an SVG file to a PNG image. Uses headless Chrome for rendering.
JavaScript
11
star
75

aor-json-rest-client

A local REST client for admin-on-rest
JavaScript
10
star
76

ra-keycloak

TypeScript
10
star
77

docker-compass

Dockerfile
10
star
78

dobble

Generate a valid deck of cards for Dobble in ECMAScript6
JavaScript
10
star
79

ra-sqlite-dataprovider

POC of a dataprovider using a sqlite database hosted on a static server
JavaScript
9
star
80

checkoid

Experimental validator library allowing to combine validator like you would lego piece.
TypeScript
9
star
81

gql-profiler

A standalone performance profiler for GraphQL resolvers
JavaScript
9
star
82

liMonade

A Monad library to make Monad simple.
TypeScript
9
star
83

dedale

A wood labyrinth game in the browser
JavaScript
9
star
84

curator-ai

An AI-powered news curator. It reads a list of articles, selects the best ones depending on a list of interests, and summarizes them into an easy-to-read news feed. Powered by the OpenAI API.
TypeScript
9
star
85

silex-multifetch

A Silex provider for performing internal batch requests
PHP
9
star
86

treedu

Graphical Disk Usage command for the terminal, using Node.js, d3.js, blessed, and Drawille
JavaScript
9
star
87

ra-auth-cognito

An auth provider for [react-admin](https://github.com/marmelab/react-admin) which handles authentication with AWS [Cognito](https://docs.aws.amazon.com/cognito/latest/developerguide/what-is-amazon-cognito.html).
TypeScript
9
star
88

docker-composer-hhvm

8
star
89

Asteroids.js

A one day experiment to bringing the Asteroids game to the browser, using a mobile device as controller, Node.js, Raphaรซl, and socket.io.
JavaScript
8
star
90

docker-bower

Dockerfile
8
star
91

ra-richtext-tiptap

TypeScript
7
star
92

puppeteer-accessibility

JavaScript
7
star
93

web-myna

Record then emulate your api.s for testing and development
JavaScript
7
star
94

ninja-coder

Code with your entire body like a Ninja
JavaScript
7
star
95

configurable.js

A small JS snippet to make a function configurable through its closure
JavaScript
7
star
96

sg

Side Effect Handling library - Think Redux-Saga without Redux
JavaScript
6
star
97

selenium-smart-wait

JavaScript
6
star
98

dobble-php

PHP
6
star
99

marriage-algorithms

Experiments with stable marriage algorithms
TypeScript
6
star
100

ra-strapi-demo

JavaScript
6
star