• Stars
    star
    469
  • Rank 91,479 (Top 2 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created over 8 years ago
  • Updated about 2 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
291
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

postman-collection-generator

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

admin-pack

A Symfony pack for API Platform Admin
23
star
13

docker-compose-prod

Shell
13
star
14

openapi

Models to build and serialize an OpenAPI specification.
PHP
11
star
15

json-schema

Generate a JSON Schema from a PHP class
PHP
6
star
16

api-platform-doc-parsing-check

API-Platform Documentation parsing check
JavaScript
6
star
17

symfonycon-berlin-workshop-eod

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

.github

Default community health files
3
star
19

graphql

Build GraphQL API endpoints
PHP
2
star
20

ramsey-uuid

API Platform RamseyUuid bridge
PHP
2
star
21

doctrine-orm

API Platform Doctrine ORM component
PHP
2
star
22

http-cache

API Platform HttpCache component
PHP
1
star
23

docs-website

Documentation website
CSS
1
star
24

doctrine-common

API Platform Doctrine Common component
PHP
1
star
25

parameter-validator

API Platform Parameter Validator component
PHP
1
star
26

metadata

API Resource-oriented metadata attributes and factories
PHP
1
star
27

symfony

Symfony API Platform integration
PHP
1
star
28

hydra

API Platform Hydra component
PHP
1
star
29

documentation

API Platform Documentation component
PHP
1
star
30

serializer

API Platform Serializer component
PHP
1
star
31

jsonld

API Platform JSON-LD component
PHP
1
star
32

state

API Platform state interfaces
PHP
1
star
33

elasticsearch

API Platform Elasticsearch bridge
PHP
1
star
34

validator

API Platform Validator component
PHP
1
star
35

doctrine-odm

API Platform Doctrine MongoDB ODM component
PHP
1
star
36

laravel

Laravel component
1
star
37

admin-meta

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