· laravel · 4 min read

Day 0-1: Building a SaaS with Laravel

A Flutter/Javascript/C# developer exploring Laravel to create a SaaS.

What am I… difficult to say … I’d say … I’m a versatile developer :) Sometimes I develop in Dart, sometimes in TypeScript, sometimes in Python, and now … well, in PHP!

I never thought I’d venture into the PHP world, but Aaron Francis took me in! @aaroondfrancis - if you read this, your videos are awesome - full of motivation!

Ok so! before going further … Why I’m writing a SaaS?

  1. I want to apply what I’m learning.
  2. I might have a potential project that would require a similar “configuration”.
  3. I might become the next Bill Gates by selling a million subscriptions!

I’m not going to reveal the idea yet… I might do a big reveal at some point, but for now, I’ll just describe what I’m doing day by day, the difficulties I encounter, and also the amount I’m spending to make this happen.


Day 0

About a week before kicking off this SaaS adventure, I dived into Laravel docs, watched tutorials, chatted with folks about Laravel, followed cool people on Twitter, checked out Reddit Laravel, tested some modules, and reached out to module owners with questions. I set up a notes repository to keep track of everything; you can check it out here: GitHub Everyday-laravel. I started writing articles, beginning on Medium, but later moved them to my website because, well, Medium didn’t quite click for me.

Oh, and I made a useful purchase: PHPStorm with Laravel Idea for $132.15.

I already know Visual Studio Code but it didn’t feel good for PHP/Laravel. A lot of missing features that I’m used in javascript with Visual Studio Code was not there but they are present in PHPStorm. It’s also part of the excitement of starting something new!

Day 1

Non-Coding stuff!

  • Found a name
  • Write in Notion the big idea / task to do for this project.
  • Purchased the domain name
  • Created a logo
  • Generated the favicon with favicon.io using the logo created

I won’t go into the details here, but I used Namecheap for my domain (cost: $30.48 for 3 years). I used an AI to create a logo ideogram, removed the background and edited it with Canva (I already had an account, so no extra cost).

Setting up the Base and Configuring the Environment

  • Created the private GitHub repo
  • Installed Laravel + Breeze with Volt API Class.
  • Discovered that Laravel Pint and Tools to format are “per project” in PHPStorm. Had to reconfigure, but it was a quick fix (thanks to Jeffrey Way - PHPStorm for Laravel Developers).
  • Created an account on Mailtrap and added the info to the .env file, but haven’t tested it yet.

Deployment

  • Deployed the app on Fly.io
  • Configured the domain name to point to the server hosted on Fly.io
  • Opted for MySQL, faced challenges on Fly.io to install MySQL
  • Added credit card information on Fly.io (Fingers crossed for not becoming the inverse Bill Gates). Fly.io spending
  • Switched from MySQL on Fly.io to MySQL on PlanetScale. (Tried everything in this doc but couldn’t make it work).
  • Added credit card information on PlanetScale (Credit card usage at an all-time high!)
  • Connection to PlanetScale working!
  • Set up Github Actions to deploy on Fly.io when pushing code to the repo. doc
  • Ensured HTTPS is working
  • Connected Sentry with Fly.io (Just because we can…)
  • Frustrated with the www not redirecting to non-www (Tried the .htaccess method, but it didn’t work)

Why Fly.io?

The documentation appealed to me, and the video from @Josh Cirre also caught my attention (he had more luck with Postgres in his video :D).

Everything is now deployed and configured. It wasn’t that hard (would’ve taken only 10 minutes if not for the MySQL issue).

I’ve also checked out some information about Laravel Bref, which I might try one day!

Development

  • Implemented a different title for the Dev environment and production. (So I will stop refreshing the page and thinking like … why it’s not working!!!!) (come on … it happens to all of us at least once).
  • Created a landing page featuring an email field and button for subscribing to a newsletter (component by TailwindUI).
  • Explored Laravel Blueprint to set up a “newsletter” model with controller, mailable, and Notifiable.
  • Watched a talk about “Building a maintainable Livewire application - Laracon AU 2023” by Josh Hanley. I might stop using Blueprint and create everything in Livewire component!!!

Tadaaa (current homepage)

landing-page

I’m quite satisfied of day 1 even if I didn’t code too much yet.

The goal of tomorrow is to make the subscription to the newsletter working and read the livewire docs and make the link available to everyone!

Total spending until now: $162.74

Back to Blog