Create Three Symfony Back Ends - Part #28 - Introducing the API Platform

17K views Feb 14, 2023

We've previously covered how to create a 'RESTful' API (more accurately a JSON API) using Symfony 4. We've covered how to create a Symfony 4 JSON API with as few extra dependencies as possible, and also a separate build using FOSRESTBundle. Now, let's take a look at recreating our Album API using the API Platform. If you haven't heard of API Platform before I genuinely think your socks are about to be knocked clean off. Out of the box, this is the most fully featured API I have ever found in any programming language. We get: Either a Hypermedia or GraphQL API A full React-based admin panel Lovely autogenerated Open API (previously called Swagger) documentation React, Vue, or React Native front end generators A ready-to-go Docker stack This barely scratches the surface of what's in there. And this isn't meant to be a sales pitch. But I would be amazed if you aren't about to be impressed. Is there a downside? Yes - there is one. This is just my opinion. This doesn't work like most every other Symfony site I've ever built. This won't be like FOSRESTBundle. We won't be working with forms, building our own controllers, defining routes, or most anything you'd do typically.