• Stars
    star
    469
  • Rank 93,595 (Top 2 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created almost 9 years ago
  • Updated 6 months ago

Reviews

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

Repository Details

A beautiful and fully-featured administration interface builder for hypermedia APIs

API Platform Admin

GitHub Actions npm version

API Platform Admin is a tool to automatically create a beautiful (Material Design) and fully-featured administration interface for any API supporting the Hydra Core Vocabulary or exposing an OpenAPI documentation, including but not limited to all APIs created using the API Platform framework.

Demo of API Platform Admin in action

The generated administration is a 100% standalone Single-Page-Application with no coupling to the server part, according to the API-first paradigm.

API Platform Admin parses Hydra or OpenAPI documentations, then uses the awesome React-admin library (and React) to expose a nice, responsive, management interface (Create-Retrieve-Update-Delete) for all available resources.

You can also customize all screens by using React-admin components and even raw JavaScript/React code.

Demo

Click here to test API Platform Admin in live.

The source code of the demo is available in this repository.

Installation

yarn add @api-platform/admin

Usage

import React from 'react';
import ReactDOM from 'react-dom';
import { HydraAdmin, OpenApiAdmin } from '@api-platform/admin';

// To use Hydra:
const Admin = () => <HydraAdmin entrypoint="https://demo.api-platform.com" />; // Replace with your own API entrypoint
// To use OpenAPI (with a very simple REST data provider):
const Admin = () => <OpenApiAdmin
  docEntrypoint="https://demo.api-platform.com/docs.json" // Replace with your own OpenAPI documentation entrypoint
  entrypoint="https://demo.api-platform.com" // Replace with your own API entrypoint
/>;

ReactDOM.render(<Admin />, document.getElementById('root'));

Or alternatively:

import React from 'react';
import ReactDOM from 'react-dom';
import {
  AdminGuesser,
  hydraDataProvider,
  hydraSchemaAnalyzer,
  openApiDataProvider,
  openApiSchemaAnalyzer
} from '@api-platform/admin';
import simpleRestProvider from 'ra-data-simple-rest';

// Use your custom data provider or resource schema analyzer
// Hydra:
const dataProvider = hydraDataProvider({ entrypoint: 'https://demo.api-platform.com' });
const schemaAnalyzer = hydraSchemaAnalyzer();
// OpenAPI:
const dataProvider = openApiDataProvider({
  // Use any data provider you like
  dataProvider: simpleRestProvider('https://demo.api-platform.com'),
  entrypoint: 'https://demo.api-platform.com',
  docEntrypoint: 'https://demo.api-platform.com/docs.json',
});
const schemaAnalyzer = openApiSchemaAnalyzer();

const Admin = () => (
  <AdminGuesser
    dataProvider={dataProvider}
    schemaAnalyzer={schemaAnalyzer}
  />
);

ReactDOM.render(<Admin />, document.getElementById('root'));

Features

  • Automatically generates an admin interface for all the resources of the API thanks to the hypermedia features of Hydra or to the OpenAPI documentation
  • Generates 'list', 'create', 'show', and 'edit' screens, as well as a delete button
  • Generates suitable inputs and fields according to the API doc (e.g. number HTML input for numbers, checkbox for booleans, selectbox for relationships...)
  • Generates suitable inputs and fields according to Schema.org types if available (e.g. email field for http://schema.org/email)
  • Handles relationships
  • Supports pagination
  • Supports filters and ordering
  • Automatically validates whether a field is mandatory client-side according to the API description
  • Sends proper HTTP requests to the API and decodes them using Hydra and JSON-LD formats if available
  • Nicely displays server-side errors (e.g. advanced validation)
  • Supports real-time updates with Mercure
  • All the features provided by React-admin can also be used
  • 100% customizable

Documentation

The documentation of API Platform Admin can be browsed on the official website.

Check also the documentation of React-admin on their official website.

Credits

Created by Kévin Dunglas. Sponsored by Les-Tilleuls.coop. Commercial support available upon request.

More Repositories

1

api-platform

Create REST and GraphQL APIs, scaffold Jamstack webapps, stream changes in real-time.
TypeScript
8,306
star
2

core

The server component of API Platform: hypermedia and GraphQL APIs in minutes
PHP
2,366
star
3

api-pack

A Symfony pack for API Platform
526
star
4

schema-generator

PHP Model Scaffolding from Schema.org and other RDF vocabularies
PHP
452
star
5

create-client

Generate React or Vue.js-based Progressive Web Apps from an Hydra-enabled API. Also support React Native.
TypeScript
365
star
6

demo

Demo app for the API Platform framework
PHP
295
star
7

docs

API Platform documentation
163
star
8

api-doc-parser

Transforms a Hydra API doc in an intermediate representation that can be used for various tasks such as creating smart API clients, scaffolding code or building administration interfaces.
TypeScript
99
star
9

activity-pub

API Platform ActivityPub Support
PHP
73
star
10

website

The API Platform website
TypeScript
48
star
11

laravel

[READ ONLY] API Platform for Laravel
PHP
45
star
12

postman-collection-generator

Generator for Postman collection based on API Platform
PHP
30
star
13

admin-pack

A Symfony pack for API Platform Admin
23
star
14

openapi

[READ ONLY] API Platform OpenAPI component
PHP
13
star
15

docker-compose-prod

Shell
13
star
16

esa

Edge side APIs for front-end developpers
CSS
8
star
17

json-schema

[READ ONLY] Generate a JSON Schema from a PHP class
PHP
7
star
18

api-platform-doc-parsing-check

API-Platform Documentation parsing check
JavaScript
6
star
19

symfony

[READ ONLY] API Platform for Symfony
PHP
6
star
20

symfonycon-berlin-workshop-eod

SymfonyCon Berlin Workshop End of the day repository
PHP
5
star
21

docs-website

Documentation website
CSS
5
star
22

doctrine-orm

[READ ONLY] Doctrine ORM support for API Platform
PHP
4
star
23

.github

Default community health files
3
star
24

jsonld

[READ ONLY] API Platform JSON-LD component
PHP
3
star
25

graphql

[READ ONLY] API Platform GraphQL component
PHP
2
star
26

ramsey-uuid

[READ ONLY] API Platform Ramsey UUID component
PHP
2
star
27

http-cache

[READ ONLY] API Platform HttpCache component
PHP
2
star
28

doctrine-common

[READ ONLY] Doctrine Common support for API Platform
PHP
2
star
29

metadata

[READ ONLY] API Resource-oriented metadata attributes and factories
PHP
2
star
30

hydra

[READ ONLY] API Platform Hydra component
PHP
2
star
31

serializer

[READ ONLY] API Platform Serializer component
PHP
2
star
32

documentation

[READ ONLY] API Platform Documentation component
PHP
2
star
33

state

[READ ONLY] API Platform State component
PHP
2
star
34

elasticsearch

[READ ONLY] API Platform Elasticsearch support
PHP
2
star
35

validator

[READ ONLY] API Platform Validator component
PHP
2
star
36

parameter-validator

[READ ONLY] API Platform Parameter Validator component
PHP
1
star
37

doctrine-odm

[READ ONLY] Doctrine MongoDB ODM support for API Platform
PHP
1
star
38

admin-meta

A meta package to install API Platform Admin in Symfony projects
1
star