graviton/graviton

The base package for graviton

Installs: 6 986

Dependents: 1

Suggesters: 0

Security: 0

Stars: 12

Watchers: 16

Forks: 8

Open Issues: 4

Type:project

v4.6.1 2020-07-09 09:08 UTC

This package is auto-updated.

Last update: 2020-07-09 09:09:56 UTC


README

Build Status Scrutinizer Code Quality Code Coverage Latest Stable Version Total Downloads License

Graviton is a Symfony and Doctrine Mongo ODM based REST server generation toolkit. So it stores all data in MongoDB.

You can define your REST service in an simple JSON format, run the generator - and voilà - your REST API is ready to go.

Let's say you define this file:

{
  "id": "Example",
  "service": {
    "readOnly": false,
    "routerBase": "/example/endpoint/"
  },
  "target": {
    "fields": [
      {
        "name": "id",
        "type": "string"
      },
      {
        "name": "data",
        "type": "string"
      }
    ]
  }
}

Then you run the generator

php bin/console graviton:generate:dynamicbundles

And once running, you will have a full RESTful endpoint at /example/endpoint, supporting GET, POST, PUT, DELETE and PATCH as well as a valid generated JSON schema endpoint, pagination headers (Link as github does it) and much more.

The generated code are static PHP files and configuration for the Serializer and Symfony and is regarded as disposable. You can always regenerate it - don't touch the generated code.

The application is highly optimized for runtime performance, particurarly in the context of PHP-FPM with activated opcache.

It boasts many additional features (such as special validators and many flags and configurations) which are currently mostly undocumented as this project was not built for public usage in mind. But if there is interest and support from outside users, we welcome questions and contributions.

Install

composer install

Usage

./dev-cleanstart.sh

and

php bin/console

Documentation

There are some general docs on interacting with the codebase as a whole.

Some even broader scoped docs in a seperate repo.

The bundle readme files which show how to interact with the various subsystems.

And not to forget, the all important CHANGELOG.