Peers Conference 2014: Lamplighter.io on Laravel Slide Walkthrough

May 12, 2014

This is a presentation slide walkthrough for my talk at Peers Conference 2014 titled "Building Lamplighter.io on Laravel." There is no audio or video of the talk, so I thought annotations and notes relating to the slides would help better explain the talk.

This is a walkthrough of my presentation slides from my talk at Peers Conference 2014 about how we selected the Laravel PHP framework to develop Lamplighter.io. I spoke to a wonderful group of people who asked some great questions after my presentation (that will undoubtedly dictate what we work on next).

I'm posting this recap because I feel that slide decks posted on Speakerdeck are too easy to take out of context, making them meaningless.

I spent 18.5 hours on my talk and Keynote slides, so I would like to share the thoughts behind them with more people than just those folks who were at the talk.

This is not an exhaustive recap, but it might help clarify the slides, as there is no audio or video. The presentation is posted on Speakerdeck: Building Lamplighter.io on Laravel. I have direct links to the slides throughout the write-up below.

Introduction

Slide 2

I'm Ryan Masuga, owner of Masuga Design, a small web studio in Grand Rapids, Michigan. Our client work is mostly ExpressionEngine work. We started devot:ee in 2009 to serve the ExpressionEngine community.

To try something new, we built placeIMG.com, on the Slim PHP framework. (At the time of this recap, it just surpassed 10 million images served)

This year we decided to build a SaaS (software as a service) product for monitoring websites – particularly those sites built on ExpressionEngine or Craft.

The "Comfort Zone" and Trying Something New

Slide 3

We have a "Comfort Zone" at Masuga Design: ExpressionEngine development. We also run devot-ee.com, which is devoted to ExpressionEngine. We're in and around that CMS all day. PHP is the main language we use every day. When you use the same system day in and day out, you get a deep understanding of it, but this can lead to getting stale. It's good to shake things up periodically, because, as Mike Taber mentioned when speaking at MicroConf this year (Slide 4), doing something new:

Old projects can feel bogged down. Sometimes the simplest things are molehills, but they feel like mountains. Who hasn't started a new project and just gone tearing in with an energy and gusto you don't have for older projects?

Let's Make a Product!

So, what's the big idea?

Slide 6

We didn't decide to build a product in a vacuum. Lamplighter came from something we had already built. We had previously developed a monitoring add-on for ExpressionEngine sites that checked installed add-ons against their current versions on devot-ee.com to let you know what needed updating.

From there, we thought we should be able to view that information in one secure place, rather than having to log into every site to see this info.

From that idea, we asked ourselves: "Why stop at add-ons? Why stop at ExpressionEngine? Why stop at just info being sent back from the site? How about storing any and all that sort of info you need to make sure you or anyone on your team has what they need to do their work?"

We thought that if we could gather information from—and store information about—your sites in one secure, centralized place, regardless of CMS, then we might have a product.

Great! Sounds good! Many people stop here, or they might go so far as to buy a domain name and put up a holding page. Actual execution of an idea is what separates the wheat from the chaff.

So we had our idea. We called it Lamplighter and got to work.

What is the Purpose of Building This Product?

Slide 8

First, this scratches our own itch for organization. I wrote about this in more detail in my Story over at Lamplighter. Second, we think Lamplighter can help other web shops like us. Third, let's be real: we're not just in business for our health. If we're going to offer this to others and support it, we'll need to get from $0 to sustainable as quickly as possible.

What should we use?

Slide 9

There are seemingly endless choices when selecting what to use to build anything online. How are we going to execute this idea?

CMS:

Hand Roll:

Framework:

That was easy. Framework it is. How to decide which one? Our first goal is to stay within the realm of feasibility. We're not just going to drop everything we know as a team and build something using Ruby on Rails when we have zero experience with that. This is a business, and we don't want to just go off a cliff because we can. What do we already know? PHP. That led us to a few options such as Zend 2, or Symfony 2. But the framework that really caught our developers' eyes was Laravel.

Laravel has a number of things going for it ( Slide 12 & Slide 13).

Importantly for a business owner, building a project on Laravel satisfies the Beer-Truck Rule. That is, if the dev team collectively gets hit by a beer truck and doesn't show up tomorrow, it would be reasonably easy to find PHP developers who could step in and make sense of the application.

Making the Product

Use the Right Tool for the Job

I believe in using the right tool for the job, instead of trying to shoehorn systems I know into places where they aren't the best fit ( Slide 18). For Lamplighter, we needed a blog and a knowledge-base as well, and we weren't about to build those things ourselves when another system has them covered. We decided to use Craft for the blog and KB, while using Laravel for the app and the main marketing pages of the site. Craft also controls a small news feed that we bring into the Laravel-side client dashboards.

Laravel Highights

These were the determining factors for us in light of how we wanted to build Lamplighter.

Routing

Slide 21 & Slide 22

These are things we needed in regards to routing:

The syntax for the routes, groups and filters in Laravel is the cleanest of the modern frameworks.

We needed nice URLs so we could easily make flexible landing pages. For example, if I wanted to target ExpressionEngine users who came from devot-ee.com (or other sources), I could easily setup a route like this:

// Specific CMS-targeted landing pages
Route::get('expressionengine/{source?}',[
 'as' => 'front.expressionengine',
 'uses' => 'FrontController@getExpressionengine'
]);

to give us custom URLs like the following:

https:lamplighter.io/expressionengine/devotee
https:lamplighter.io/expressionengine/peers2014

With those nice looking URLs, we can then tailor specific marketing geared towards the visitor based on where they came from.

In many online applications you get a custom subdomain for your company, and we wanted to do that with Lamplighter. Laravel made that easy to do. The ability to easily nest the route groups and use before and after filters allowed us a lot of control over all the requests. For example, it's easy to require an authenticated user, but put that inside a company subdomain check, and have that within an SSL route group.

Commands (Artisan)

Slide 23

Artisan is the command line tool for Laravel. With one line, we can do five things in sequence:

php artisan deploy:heavy --stage=prod
  1. Put site in maintenance mode
  2. Deploy the code changes
  3. Install, update, or remove necessary dependencies
  4. Make database changes
  5. Bring the site back up

We also need to run a lot of cron jobs, and Artisan helps manage those:

Eloquent ORM

Slide 26

ORM (Object-Relational Mapping) is a tool that lets you query and manipulate data from a database using an object paradigm. What? That means almost nothing to me! What I do know is that Lamplighter is a relationship-heavy application.

There are deep relationships, and Eloquent handles these relationships very well, and it helps keep the code readable (e.g., which sites belong to Company X? $company->sites). This is great because it saves the developers time, which ultimately saves us money on the bottom line.

Front Templating (Blade)

Slide 27

Some of the Lamplighter app is front-facing (such as the custom landing pages mentioned previously) so the front-end people need to be able to get in here and work with things as well. It's similar to Twig, which is the template language used by Craft, which, as I previously mentioned, is what we're using for the blog and the knowledge base. We could alternatively use Twig, but Blade was similar enough and easy enough to pick up.

Drawbacks

Slide 30 & Slide 31

One man. One framework. What could go wrong? A beer truck? In this case, you might say Laravel being a "one man show" is a bad thing. If the creator gets taken out, what happens?We're not too concerned with this issue at the moment. The Laravel community seems to be thriving - look at the rise of conferences like Laracon.

We've run into one sticky situation that we haven't been able to find a quick fix for…but what system wouldn't potentially have this problem?

Conclusion

Slide 32

Ship it.

Slide 33

As Patrick McKenzie says, nothing you do in business is worse than doing nothing. Ship it.

We shipped, and we're very proud of that fact. Slide 34

Some people come up with ideas, others do so and then execute. We launched and are very proud of that fact. Lamplighter is currently a fraction of our overall income, so we're still free to experiment. If we fail, the failure will be on the business and marketing side, not because of the tech.

Lamplighter Stats

Slide 35

At the time of this talk, I had some basic stats to share:

As I write this now, a little over two weeks after my talk:

The majority of the sites are ExpressionEngine (80%) with Craft and WordPress making up another 7% each.

Resources

Slide 36

Laravel Resources:

SaaS (+Bootstrapping) Resources:

Thank You!

Thanks to Jessica D'Amico for inviting me to talk at Peers. Thanks to all of you who attended the talk and had follow-up questions.

Ryan spends most of his time as Mystery Supply Co. He's been floating through space with you since the 70's. King of Michigan.

More Reading