MostGenerator
MostGenerator copied to clipboard
Support REST and/or GraphQL APIs
Goal
Generated bundles should be able to provide REST and/or GraphQL APIs. Those are pretty near to CRUD, but may be enhanced and/or customised manually of course.
Concept
- Behaviour should be disabled by default and configurable using generator settings.
- Preferrably use API Platform against other solutions like FOSRestBundle or GraphQLBundle
- One separate module should centrally implement an authentication method for JWT support.
- Versioning, e.g. like this
Resources
Check out first
- http://raml.org
- https://github.com/mulesoft/api-designer
- https://www.smashingmagazine.com/2018/01/graphql-primer-new-api-part-1/
- https://www.smashingmagazine.com/2018/01/graphql-primer-new-api-part-2/
- https://dev.twitter.com/overview/api/response-codes
- https://swagger.io/tools/swagger-ui/
- https://dunglas.fr/2019/11/vulcain-http-2-server-push%e2%80%a8-and-the-rise-of-client-driven-rest-apis/
- https://medium.com/q-software/symfony-5-the-rest-the-crud-and-the-swag-7430cb84cd5
- APIs with CQRS
- https://dev.to/hantsy_26/-building-restful-apis-with-symfony-5-and-php-8-1p2e
- https://github.com/tarlepp/symfony-flex-backend
- https://www.strangebuzz.com/en/blog/simple-api-mocking-with-the-symfony-http-client
- https://anastasionico.uk/blog/restful-apis-with-symfony-building-web-services
- https://towardsdev.com/mastering-api-development-with-symfony-a-comprehensive-tutorial-6111ff219c94
API Platform
- Website
- Repository
- Other components
- Recipes
- https://dunglas.fr/2017/11/api-platform-and-symfony-a-framework-for-api-driven-projects/
- https://dunglas.fr/2018/01/api-platform-2-2-graphql-json-api-admin-and-pwa-kubernetes-instant-deployment-and-many-more-new-features/
- https://gist.github.com/sstok/a3050a96a4df852cfd3edc976d7d9f3d
- https://stefanoalletti.wordpress.com/2018/03/07/symfony-api-platform-cqrs-part-1/
- https://dunglas.fr/2018/03/symfonylive-paris-slides-rest-vs-graphql-illustrated-examples-with-the-api-platform-framework/
- https://speakerdeck.com/dbrumann/enable-highend-spas-using-rest-apis-with-symfony-4
- https://dunglas.fr/2018/06/api-platform-a-framework-for-api-driven-projects/
- https://mobile.twitter.com/dunglas/status/906179569144778752
- https://dunglas.fr/2017/11/api-platform-admin-0-2-a-dynamic-admin-for-your-apis-react-progressive-web-app/
- https://weknowinc.com/blog/creating-modern-web-application-using-symfony-api-platform
- https://dunglas.fr/2019/01/api-platform-2-4/
- https://medium.com/@coopTilleuls/api-platform-2-4-beta-mongodb-elasticsearch-mercure-symfony-messenger-et-bien-plus-381c1a479053
- https://medium.com/@bpolaszek/expose-a-rest-api-to-different-kinds-of-users-with-api-platform-part-1-4-713f3c6db86f
- https://medium.com/@bpolaszek/expose-a-rest-api-to-different-kinds-of-users-with-api-platform-part-2-4-9c1977ae2fac
- https://medium.com/@bpolaszek/expose-a-rest-api-to-different-kinds-of-users-with-api-platform-part-3-4-a259f338546f
- https://medium.com/@bpolaszek/expose-a-rest-api-to-different-kinds-of-users-with-api-platform-part-4-4-25c7dfb8b057
- https://locastic.com/blog/having-troubles-with-implementing-translations-in-apiplatform/
- https://dunglas.fr/2019/09/api-platform-2-5-revamped-admin-new-api-testing-tool-next-js-and-quasar-app-generators-patch-and-json-schema-support-improved-openapi-and-graphql-support/
- https://medium.com/@stfalconcom/a-quick-api-platform-hands-on-review-for-symfony-app-development-a56a3fed1393
- https://medium.com/@stefanoalletti_40357/lockdown-diaries-react-symfony-api-platform-the-perfect-combination-205bc03d9153
- https://medium.com/@arnaout.slimen/graphql-between-angular-and-symfony-f2ec927b819
- https://medium.com/swlh/formats-supported-by-the-api-platform-35013626c79f
- https://locastic.com/blog/populating-elasticsearch-with-serialization-groups/
- https://medium.com/@benellis.nz.eu/managing-a-changelog-with-api-platform-openapi-7f05b463266e
- https://dev.to/aratinau/how-to-create-a-collection-data-provider-and-keep-doctrine-extension-filters-and-pagination-on-it-api-platform-59ih
Authentication, docs, testing
- https://geshan.com.np/blog/2014/07/3-bundles-to-get-started-with-rest-in/
- http://json-schema.org/
- Auth
- https://jwt.io/
- https://github.com/lexik/LexikJWTAuthenticationBundle
- https://www.symfony.fi/entry/symfony-and-jwt-json-web-token
- https://www.codevate.com/blog/12-securing-client-side-public-api-access-with-oauth-2-and-symfony
- https://github.com/paragonie/past
- https://medium.com/@joeymasip/how-to-create-an-api-with-symfony-4-and-jwt-b2334a8fbec2
- https://symfony.com/doc/current/security/json_login_setup.html
- https://digitalfortress.tech/php/jwt-authentication-with-symfony/
- https://jolicode.com/blog/why-you-dont-need-jwt
- https://medium.com/@h.benkachoud/symfony-rest-api-without-fosrestbundle-and-using-jwt-authentication-part-1-944aa4faf946
- https://medium.com/@h.benkachoud/symfony-rest-api-without-fosrestbundle-using-jwt-authentication-part-2-be394d0924dd
- if there is some kind of login, logout after response (see waka commit 158301eb7753bb657332226fa1d95b268483e154)
- https://medium.com/@biberogluyusuf/jwt-authentication-and-refresh-token-on-api-platform-7c6ecaa8e236
- https://hicham-benkachoud.medium.com/symfony-rest-api-without-fosrestbundle-using-jwt-authentication-part-1-f5cb186ba9ed
- https://hicham-benkachoud.medium.com/symfony-rest-api-without-fosrestbundle-using-jwt-authentication-part-2-5cd92df83497
- https://www.strangebuzz.com/en/blog/securing-an-api-with-jwt-and-api-platform
- https://helmi-bejaoui.medium.com/a-beginners-guide-on-jwt-authentication-symfony-5-api-based-bd6622bfe975
- https://medium.com/@edouard.courty/how-to-enable-jwt-authentication-with-symfony-83a05ab2592f
- https://dev.to/jszutkowski/securing-api-with-jwt-in-symfony-36dk
- https://dev.to/nabbisen/symfony-6-and-lexikjwtauthenticationbundle-2-json-web-token-jwt-auth-41mp
- https://dev.to/nabbisen/symfony-6-and-jwt-bundles-refresh-token-2jlj
- Docs
- https://github.com/nelmio/NelmioApiDocBundle
- https://medium.com/@ScullWM/api-doc-for-a-symfony-project-737d38fc0c0f
- https://medium.com/fusonic/a-pragmatic-architecture-api-docs-5-5-e57056d42c8e
- https://timobakx.dev/php/api-platform/2021/06/06/altering-api-documentation-generated-by-apip.html
- https://timobakx.dev/php/api-platform/2021/06/21/alternative-for-altering-api-documentation-generated-by-apip.html
- Tests
- https://gnugat.github.io/2016/03/24/ultimate-symfony-api-example.html
- https://andrewadcock.com/a-simple-restful-api-tutorial-with-symfony-3/
- https://improveandrepeat.com/2014/04/testing-a-web-api-with-postman/
- https://seesparkbox.com/foundry/api_testing_with_postman
- https://medium.com/@ideneal/symfony-4-a-good-way-to-deal-with-exceptions-for-rest-api-afd8b615c923
- https://medium.com/infostud/using-symfony-serializer-to-consume-rest-apis-in-oop-way-9c5de319ef7b
- https://symfony.com/blog/new-in-symfony-5-2-rate-limiter-component
- https://dev.to/bornfightcompany/access-control-in-graphql-using-symfony-io
- https://jolicode.com/blog/rate-limit-your-symfony-apis
- https://pierrebelin.medium.com/secure-symfony-api-end-to-end-with-x509-certificates-1ab06c142017
- https://medium.marco.zone/manually-implement-oauth-client-functionality-in-symfony-1dcc8a80c680
GraphQLBundle
- Repository
- https://symfony.fi/entry/state-of-graphql-php-libraries-and-symfony-integrations-in-2017
- https://symfony.fi/entry/adding-a-graphql-api-to-your-symfony-flex-app
- https://medium.com/@syl.fabre/how-to-set-up-a-graphql-server-with-symfony-4-14a9b977dc4c
- http://blog.michaelperrin.fr/2018/09/19/implementation-of-agraphql-mutation-with-file-upload/
- https://abhishekkumar20.medium.com/graphql-server-with-symfony-4-fc1f761f059b
FOSRestBundle
- Repository
- Docs
- http://justthisguy.co.uk/fosrestbundle-symfony/
- Tutorial Part 1 2 3 4 5 6 7 8
- http://jeremycurny.com/2016/03/27/symfony3-rest-api/
- https://www.cloudways.com/blog/rest-api-in-symfony-3-1/
- https://github.com/codereviewvideos/symfony-3-rest-api-example
- http://www.goetas.com/blog/how-to-add-custom-error-codes-to-your-symfony-api-responses/
- https://medium.com/@ankit.yadav726/rest-api-65c6da4d59b7
- https://medium.com/@ideneal/symfony-manage-json-api-requests-saving-a-lot-of-time-d6fae1e5ee60
Please make the Api "version aware", just like GitHub does (https://developer.github.com/v3/#current-version). You should put all api related things into a v1
subnamespace. That way it's easy to add new api versions.
@Guite this will be very hard to accomplish. I have played with REST using FosRestBundle our core security is not REST compatible second there is a problem with routes and route module as well. There are ways to "fix" the second one.