Image for Redoing the backend

Redoing the backend

In short: I remade my domain site by getting rid of WordPress and implementing a backend powered by Symfony in conjunction with Doctrine.

Why would I get rid of WordPress? Counter question: Why not? It’s BOLD and brazen! It’s also so that I can get practice with Symfony. It’s a framework that I completely enjoy and find challenging. I want to utilize the flexibility of Symfony to expand femteArenan to include my portfolio site anders.femtearenan.se, some of my projects and any API:s that I want to develop further on. So how was it?

Symfony comes with a couple of CLI-tools which makes the process somewhat easier. The easy integration with Doctrine makes it wonderful to work with database transactions. An entity (a PHP Model object) created with the CLI-tools comes with annotations making clear its relation to other entities. Persisting and fetching an object is therefore almost always a breeze. There are tools to create forms and controllers for these entities but you can easily be swarmed with a lot of forms that are not needed (as you may want to consolidate them) and controllers with paths you don’t intend to use. That’s an experience I have had previous, so this time I opted to customize my forms and controllers the way I liked it.

So did everything go smoothly? No, not at all. I often came upon a problem that I didn’t immediately know how to solve. But I remembered to have met these problems before so I knew where to look to solve them. Sometimes it was that a route was named the same as another route. Other times it was that I passed wrong instructions to the forms. But I came upon one struggle that got the better of me: including multiple files through a form and extracting the images from them. I got the form to recognize that I entered an image file, and so created a new element (by the power of JavaScript) so I could insert another one. The problem was that when my controller was to fetch these images, no image was to be found. It’s a mystery I will have to return to when I have more Symfony experience under my belt. For now, I have limited image file uploads to one at a time.

So, was it a mistake to swap out WordPress for Symfony? The answer to this question depends on the intention for the swap. If I wanted a blog with all the bells and whistles at a moments notice, then Yes. I should not have swapped WordPress out. HOWEVER, that was not why. This is a journey of learning and growing. I am happy to have Symfony on my backend to power my website.