Skip to content
develop
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
app
 
 
bin
 
 
 
 
 
 
var
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Graviton

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.

About

A Symfony based framework to generate REST services from JSON service definition files.

Resources

License

Packages

No packages published
You can’t perform that action at this time.