RestyaPlatform / board

Trello like kanban board. Based on Restya platform.
http://restya.com/board/
Open Software License 3.0
2.03k stars 381 forks source link

Migrate legacy web service API code base to framework based stack #1250

Open rrjanbiah opened 7 years ago

rrjanbiah commented 7 years ago

Expected Behavior

Migrate current web service API to framework based.. so that it will be easy for others to contribute

Current Behavior

Current web service code is directly tied to PostgreSQL's JSON support. Original idea was that heavy lifting is handled in PostgreSQL level (less PHP handling codes) for high performance.

Possible Solution

Need suggestion to choose the right web service stack (for PHP). Current "possible" options are:

1. API Platform https://github.com/api-platform/api-platform

Pros

  1. Easy (?) schema.org and Swagger support
  2. Test case support
  3. Supports https://github.com/marmelab/admin-on-rest

Cons

  1. Poor documentation for edge cases:
    1. Authentication handling. Especially how to add login & register endpoints in API doc
    2. oAuth support
    3. Handling file upload https://github.com/api-platform/core/issues/1242
    4. How to save related fields?
  2. Symfony based (Performance concerns ?)
  3. No easy options to generate quick CRUD for database tables with relations (?)

2. Rester https://github.com/moddity/Rester

Pros

  1. Direct database to API generation
  2. Swagger support
  3. Support for custom endpoints

Cons

  1. No updates since 2015
  2. Not sure about relations handling

3. PHP-CRUD-API https://github.com/mevdschee/php-crud-api

Pros

  1. Direct database to API generation
  2. Swagger support
  3. Active development

Cons

  1. Relations handling
  2. Custom endpoint handling is a pain
  3. Code is more tight and not component based. For example, Swagger API generation

4. DreamFactory https://github.com/dreamfactorysoftware/dreamfactory

Pros

  1. Easy API generation admin interface (Apigility like)
  2. Swagger support
  3. Active

Pros/Cons

  1. Laravel based (Composer based, but usually huge lib size)

Cons

  1. Relations handling (Or, how?)
  2. Adoption or lock-in (?)
  3. Performance & security (Or, how to hide endpoints or rename URLs?)

5. Apigility https://github.com/zfcampus/zf-apigility

Pros

  1. Easy API generation admin interface. First of its kind
  2. Awesome coding standard
  3. Extensive documentation
  4. Has skeleton https://github.com/zfcampus/zf-apigility-skeleton

Cons

  1. ZF based
  2. Not very active now

6. Dingo API https://github.com/dingo/api

Pros

  1. Basic good skeleton
  2. Slim like easy syntax
  3. Test case support

Pros/Cons

  1. Lumen (Laravel) based

Cons

  1. Relationship handling (?)
  2. Too much coding for database CRUD
  3. Active fork? https://github.com/dingo/api/network

Wishlist

  1. Quick CRUD from database, without code generation. PHP-CRUD-API a la
  2. Relations support (save & read)
  3. Swagger support
  4. Test case support
  5. oAuth support
  6. Rate limit handling
  7. Roles, ACL and security - easy handling. Don't expose all fields to everyone
  8. Quick code generation for custom endpoints (meaning, other than those are from database) from swagger yml https://swagger.io/swagger-editor/ (Preferably in Slim)
  9. Quick automated test from Swagger doc. Some available (or misunderstood) options:
    1. https://github.com/whq731/swagger-mock-file-generator *
    2. https://www.npmjs.com/package/swagger-mock
    3. https://www.npmjs.com/package/swaggest-test
    4. https://github.com/earldouglas/swagger-test
    5. https://github.com/dzdrazil/swagger-mock-api
    6. https://www.npmjs.com/package/swagger-mock-file-generator
    7. https://github.com/cybertk/abao *
    8. https://github.com/swagger-api/swagger-node
rrjanbiah commented 6 years ago

Another option is Fusio; but it seems to have rough edges at this moment https://github.com/apioo/fusio/issues/75

BlackDark commented 6 years ago

I would probably stick with Laravel because of the given possibilities to restructure the structure to common standards. But I do not have much experience with it so i can't say it for sure. I think your best bet would to be to try it out in small parts of the app and see the results.

rrjanbiah commented 5 years ago

Internal note

Another active fork of ArrestDB & Rester:

https://github.com/geekypedia/pRESTige