Let's Build A Wallpaper Website in Symfony 3


In this Symfony 3 tutorial series we are going to expand on the knowledge we've gained during the previous course - the "Symfony 3 for Beginners" tutorial.

In this tutorial we are going to takes a hands-on approach to building a Wallpaper / Desktop Background sharing website. These websites were particularly popular a few years back, but regardless of how "cool" they are currently, I believe they make an interesting example of a website that we can take from idea to production / online in a very short space of time.

This short feedback loop is a brilliant motivator in getting started, but more importantly, in finishing.

There's nothing more demotivating than having a bunch of projects sat on your hard disk at various states of completion - 10% done is as good as 90% done if you never see your projects through to completion.

Now, as mentioned, perhaps a wallpaper / desktop background site as our example isn't doing it for you. Don't be discouraged, as without too much alteration this very same foundation could be repurposed as a real estate listing site, or a personal photography portfolio, or if image heavy sites aren't your thing, then a job listings site.

The point here is not to cover how to make a wallpaper / desktop background site. The end product is simply a nice bonus of expanding our knowledge of Symfony, and continuing our learning into what the Symfony framework can offer.

The outcome of this course is to:

  • Continue our exploration of the Symfony framework
  • Build something we can show others
  • Have a base for learning some really cool stuff (keep reading)

This course is split into three parts.

In this first part we are going to focus on getting the MVP (minimum viable product) up and running. There's a lot to learn along the way, with plenty of new concepts to cover.

The only requirement to get started is to have complete the "Symfony 3 for Beginners" tutorial, or have the equivalent knowledge.

One thing I have found is that the more I learn about software development, the more I desire perfection before I release my projects into the wild. Outside of a learning environment, this is incredibly counter productive for two major reasons:

  • Perfect software with no audience is a waste of time
  • Without an audience you have no urge to improve

Let's quickly address these two before going further.

"Perfect software with no audience is a waste of time" - I would hazard a guess that we all wish to make our code the best, the most clean, the most extensible and maintainable that we can achieve. There's nothing wrong with this from a theoretical standpoint, but sooner or later we must ship our code.

So long as the site works, our visitors don't care if we shaved point 2 nanoseconds off our foreach loop. They also don't care if we wrote our site as a mess of procedural spaghetti, or the neatest example of MVC known to human kind.

This isn't to say we won't be doing things to the best of our ability throughout this course. However, it is the reason that we are going with Symfony and Twig, as opposed to building out a full JSON API with a React front end.

After all, it's better to get something online even if it's a little rough around the edges, rather than having yet another unfinished project littering up our hard disk.

"Without an audience you have no urge to improve" - Once our site is online, hopefully we will have some visitors come by and check it out. Seeing as we know how to do so, we could add a "Contact Form" and let our visitors tell us exactly what they think of our amazing creation (shields up!).

If given the chance, visitors to our site will - hopefully - give us feedback / suggestions / ideas that we may never have dreamed up. I know that's been the case for me with CodeReviewVideos.

As an example of this, we might want to add in some simple statistics to our website. Sure, we can add in Google Analytics without too much fuss, but what if we wanted to track page visits to our various wallpapers / categories?

There's a bunch of ways we could do this. And these sorts of improvements will be the focus of the second part of this series.

To give you a sneak peak into this part of the course, we might start off by creating a query that updates a counter in our database whenever a visitors hits our page. This is the sort of thing that actually works really well, to begin with. But as our site visitor count grows in number, this solution may no longer be suitable, so we will cover alternatives such as using Redis, and RabbitMQ.

For the final part of the series, we are going to take our MVP and re-write it using Test Driven Development techniques. What's most interesting about this is that the code we create when using TDD is often subtly different from that which we create without concerning ourselves with tests.

There's plenty to cover along the way, so without further ado, let's get started.

Episodes

# Title Duration
1 Introduction and Site Demo 02:14
2 Setup and a Basic Wallpaper Gallery 08:43
3 Pagination 08:24
4 Adding a Detail View 04:47
5 Creating a Home Page 11:14
6 Creating our Wallpaper Entity 07:50
7 Wallpaper Setup Command - Part 1 - Symfony Commands As a Service 05:57
8 Wallpaper Setup Command - Part 2 - Injection Is Easy 08:53
9 Wallpaper Setup Command - Part 3 - Doing It With Style 05:37
10 Doctrine Fixtures - Part 1 - Setup and Category Entity Creation 08:52
11 Doctrine Fixtures - Part 2 - Relating Wallpapers with Categories 05:56
12 EasyAdminBundle - Setup and Category Configuration 06:02
13 EasyAdminBundle - Wallpaper Setup and List View 07:46
14 EasyAdminBundle - Starting with Wallpaper Uploads 05:57
15 Testing with PhpSpec to Guide Our Implementation 03:39
16 Using PhpSpec to Test our FileMover 05:34
17 Symfony Dependency Testing with PhpSpec 08:47
18 Defensive Counter Measures 06:33
19 No Tests - Part 1 - Uploading Files in EasyAdminBundle 11:01
20 No Tests - Part 2 - Uploading Files in EasyAdminBundle 07:05
21 Don't Mock What You Don't Own 09:36
22 You've Got To Take The Power Back 07:36
23 Making Symfony Work For Us 08:56
24 Testing The Wallpaper File Path Helper 15:11
25 Finally, It Works! 14:56
26 Why I Prefer Not To Use Twig 16:51
27 Fixing The Fixtures 11:20
28 Untested Updates 14:30
29 Untested Updates Part Two - Now We Can Actually Update 06:33
30 Adding an Image Preview On Edit 12:31
31 Delete Should Remove The Wallpaper Image File 11:02
32 Getting Started Testing Wallpaper Updates 10:02
33 Doing The Little Before The Big 08:13
34 Tested Image Preview... Sort Of :) 07:36
35 Finishing Up With a Tested Wallpaper Update 10:41
36 Test Driven Wallpaper Delete - Part 1 11:06
37 Test Driven Wallpaper Delete - Part 2 11:57
38 EasyAdminBundle Login Form Tutorial 08:01

Code For This Course

Get the code for this course.

Presented By

Christopher Moss

Christopher Moss

Hi, I'm Chris and welcome to CodeReviewVideos.com. In this video you will learn about... :)