• Stars
    star
    400
  • Rank 107,843 (Top 3 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 6 years ago
  • Updated almost 2 years 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 admin SPAs on top of REST services, using React and Material Design.

admin-on-rest Build Status

A frontend Framework for building admin applications running in the browser on top of REST services, using ES6, React and Material Design. Open sourced and maintained by marmelab.


Admin-on-rest 1.x is in maintenance mode. Version 2.x lives at https://github.com/marmelab/react-admin.


Demo - Documentation - Releases - Support

admin-on-rest-demo

Features

  • Adapts to any REST backend
  • Complete documentation
  • Optimistic rendering (renders before the server returns)
  • Relationships (many to one, one to many)
  • Internationalization (i18n)
  • Conditional formatting
  • Themeable
  • Supports any authentication provider (REST API, OAuth, Basic Auth, ...)
  • Full-featured Datagrid (sort, pagination, filters)
  • Filter-as-you-type
  • Supports any form layout (simple, tabbed, etc.)
  • Data Validation
  • Custom actions
  • Large library of components for various data types: boolean, number, rich text, etc.
  • WYSIWYG editor
  • Customize dashboard, menu, layout
  • Super easy to extend and override (it's just React components)
  • Highly customizable interface
  • Can connect to multiple backends
  • Leverages the best libraries in the React ecosystem (Redux, redux-form, redux-saga, material-ui, recompose)
  • Can be included in another React app
  • Inspired by the popular ng-admin library (also by marmelab)

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, bugfix with BC break) should be made against next.

Installation

Admin-on-rest is available from npm. You can install it (and its required dependencies) using:

npm install --save-dev admin-on-rest

Documentation

Read the Tutorial for a 15 minutes introduction. After that, head to the Documentation, or checkout the source code of the demo for an example usage.

At a Glance

// in app.js
import React from 'react';
import { render } from 'react-dom';
import { simpleRestClient, Admin, Resource } from 'admin-on-rest';

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

render(
    <Admin restClient={simpleRestClient('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 to define sub components for each of the admin view: list, edit, and create. These components use Material UI and custom components from admin-on-rest:

// in posts.js
import React from 'react';
import { List, Datagrid, Edit, Create, SimpleForm, DateField, TextField, EditButton, DisabledInput, TextInput, LongTextInput, DateInput } from 'admin-on-rest';
import BookIcon from 'material-ui/svg-icons/action/book';
export const PostIcon = BookIcon;

export const PostList = (props) => (
    <List {...props}>
        <Datagrid>
            <TextField source="id" />
            <TextField source="title" />
            <DateField source="published_at" />
            <TextField source="average_note" />
            <TextField source="views" />
            <EditButton basePath="/posts" />
        </Datagrid>
    </List>
);

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

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

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

Does It Work With My REST API?

Yes.

Admin-on-rest uses an adapter approach, with a concept called REST client. Existing rest clients can be used as a blueprint to design your API, or you can write your own REST client to query an existing API. Writing a custom REST client is a matter of hours.

REST client architecture

See the REST clients documentation for details.

Batteries Included But Removable

Admin-on-rest is designed as a library of loosely coupled React components built on top of material-ui, in addition to controller functions implemented the Redux way. It is very easy to replace one part of admin-on-rest with your own, e.g. to use a custom datagrid, GraphQL instead of REST, or bootstrap instead of Material Design.

Run the example

You can run the example app by calling:

npm install
make run

And then browse to http://localhost:8080/. The credentials are login/password

Contributing

Pull requests are welcome. 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.

You can run the tests (linting, unit and functional tests) by calling

make test

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

make prettier

If you want to contribute to the documentation, install jekyll, then call

make doc

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

Note: if you have added a section with heading to the docs, you also have to add it to docs/_layouts/default.html (the links on the left) manually.

If you are using admin-on-rest as a dependency, and if you want to try and hack it, here is the advised process:

# in myapp
# install admin-on-rest from GitHub in another directory
$ cd ..
$ git clone [email protected]:marmelab/admin-on-rest.git && cd admin-on-rest && make install
# replace your node_modules/admin-on-rest by a symbolic link to the github checkout
$ cd ../myapp
$ npm link ../admin-on-rest
# go back to the checkout, and replace the version of react by the one in your app
$ cd ../admin-on-rest
$ npm link ../myapp/node_modules/react
$ make watch
# in another terminal, go back to your app, and start it as usual
$ cd ../myapp
$ npm run

Tip: If you're on Windows and can't use make, try this Gist.

License

Admin-on-rest is licensed under the MIT Licence, sponsored and supported by marmelab.

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

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
TypeScript
22,823
star
2

gremlins.js

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

ng-admin

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

awesome-rest

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

json-graphql-server

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

universal.css

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

EventDrops

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

restful.js

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

gaudi

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

ng-admin-react

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

FakeRest

Patch fetch/XMLHttpRequest to fake a REST API server in the browser, based on JSON data.
JavaScript
407
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
183
star
20

tree.js

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

ra-supabase

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

greenframe-cli

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

atomic-crm

A full-featured CRM built with React, react-admin, and Supabase.
TypeScript
113
star
24

ng-admin-postgrest

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

phpcr-browser

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

sketch-by-phone

A proof-of-concept of Augmented Reality with HTML5
JavaScript
96
star
27

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
28

phpunit-d3-report

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

GraphQL-example

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

make-docker-command

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

aor-graphql

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

react-admin-demo

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

ra-auth-acl

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

aor-dependent-input

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

argos

docker monitoring experiment
58
star
36

react-md-motion

Material design motions with react
JavaScript
54
star
37

Raphael.InlineTextEditing

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

ra-example-oauth

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

aor-simple-graphql-client

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

ZeroDollarHomePage

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

SonataElasticaBundle

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

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
43

react-admin-crm

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

ra-in-memory-jwt

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

koa-multifetch

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

gollabedit

Experimental collaborative editor written in Go
Go
33
star
47

admin-config

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

ocaml-invader

Ocaml Space-Invader implementation using OpenGL
OCaml
29
star
49

admin-on-rest-graphql-demo

JavaScript
29
star
50

ra-data-google-sheets

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

ra-datagrid

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

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
53

MobileInsight

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

yolo

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

aor-rich-text-input

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

timeline-react-admin

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

strapi-beerdex

StrapiJS Example Application For Beer Management
JavaScript
23
star
58

chrome-bug-report-wizard

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

highlight-search-term

Highlight search term in a page. Vanilla JS, compatible with frontend frameworks (React, Vite, Angular, etc).
JavaScript
22
star
60

ra-enterprise-demo

TypeScript
20
star
61

solid-admin

TypeScript
20
star
62

argos-cli

19
star
63

aor-realtime

JavaScript
17
star
64

svelte-sse-chat

Chat Example Application Using SvelteJS and Chat
Svelte
15
star
65

uptime

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

reactive-beers

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

reversi-reason

🐪 ReasonML implementation of Reversi Game
OCaml
13
star
68

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
69

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
13
star
70

ng-tree

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

docker-parallel-phpunit-demo

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

skelt

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

redux-form-inspector

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

virothello

💫 Othello Game Using Augmented Reality And Viro
JavaScript
12
star
75

coPostgresQuery

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

phpcr-api

PHP
11
star
77

ra-keycloak

TypeScript
11
star
78

svg_to_png

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

aor-json-rest-client

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

docker-compass

Dockerfile
10
star
81

dobble

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

ra-sqlite-dataprovider

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

checkoid

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

gql-profiler

A standalone performance profiler for GraphQL resolvers
JavaScript
9
star
85

liMonade

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

dedale

A wood labyrinth game in the browser
JavaScript
9
star
87

silex-multifetch

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

treedu

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

ra-shadcn-demo

An example showing how to use react-admin in headless mode with shadcn
TypeScript
9
star
90

ra-auth-cognito

An auth provider for react-admin which handles authentication with AWS Cognito.
TypeScript
9
star
91

ra-richtext-tiptap

TypeScript
8
star
92

ra-strapi-demo

JavaScript
8
star
93

ra-example-kanban

Example of a Kanban board built with React Admin
TypeScript
8
star
94

docker-composer-hhvm

8
star
95

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
96

docker-bower

Dockerfile
8
star
97

ra-tailwind-demo

An example showing how to use react-admin in headless mode with tailwind
TypeScript
8
star
98

web-myna

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

puppeteer-accessibility

JavaScript
7
star
100

ninja-coder

Code with your entire body like a Ninja
JavaScript
7
star