Aleksandar-Mitic / benjamincrozat.com

Source code for Benjamin Crozat's blog built using the TALL stack and getting more than 20K monthly visitors.

Home Page:https://benjamincrozat.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Laravel Forge Site Deployment Status

The logo of the blog of Benjamin Crozat.

This is the source code of my blog, benjamincrozat.com. This blog was built with the TALL stack and gets more than 20K visitors per month.

My Pirsch Analytics Dashboard. My Pirsch Analytics dashboard that is publicly accessible.

 

My Google Search Console. My Google Search Console. You can see the growth since I launched in September 2022.

 

I feel obligated to mention that my relative success is not correlated to my tech stack. I just want to own my piece of real estate online and do whatever I want with it. If you also want to create your blog, I don't recommend to copy and paste anything I did. While the code works for my specific needs, it might not be the ideal solution for everyone. But if you're curious, there you go, enjoy!

Before you proceed

  • I don't need pull requests. This is a project I'm working on alone, and I only have time for the bad code I write myself. 😅
  • This isn't an opportunity for mentoring. I don't have time for that either. Please try to resolve your issues on your own.
  • This isn't a reference for SEO. If you want to rank on Google, write content people search for and be patient. You can learn how I did it.

What you will learn

This is a small project that I work on alone. That being said, you will be able to learn more about:

  • Simplicity. Most developers underestimate the benefits of simple code.
  • Integrating AI to speed up your writing.
  • Creating admin pages based on Laravel Nova. (I'm working on Filament's integration in the feature/filament branch.)
  • Testing. A crucial part of ensuring everything stays stable.
  • How to use various frontend technologies such as Livewire v3 + Volt, Alpine.js, and Tailwind CSS.
  • But you will also learn what you should avoid. This codebase is far from what I consider perfect.

Requirements

This project requires Laravel Nova, which is a paid package. For now, I don't know how to make it optional, but meanwhile, you can switch to the feature/filament branch.

  • PHP 8.2+
  • MySQL 8+

Installation

I assume you are using Laravel Valet. But you can run it in whichever environment you want.

Clone the repository and cd into it:

git clone git@github.com:benjamincrozat/benjamincrozat.com.git

cd benjamincrozat.com

Create a .env file and generate the app key:

cp .env.example .env

php artisan key:generate

Install the dependencies (if you don't have a Laravel Nova license, switch to the feature/filament branch):

composer install

Create the database:

mysql -u root -e "CREATE DATABASE benjamincrozat"

Migrate the database with some fake data:

php artisan migrate --seed

Install the frontend dependencies and build the assets:

yarn && yarn build

Testing

To run the tests, execute the following command:

php artisan test

Deployment

Once the tests are green in the CI environment, a webhook from Laravel Forge is called, which triggers the deployment.

Some details about the production environment:

  • I host the blog on a $6 DigitalOcean VPS.
  • I could have stopped here, but I'm also using a managed MySQL database for frequent automatic backups and not having to deal with anything related to the configuration.
  • I use Sentry to monitor errors.

About

Source code for Benjamin Crozat's blog built using the TALL stack and getting more than 20K monthly visitors.

https://benjamincrozat.com


Languages

Language:PHP 77.1%Language:Blade 21.8%Language:JavaScript 0.6%Language:CSS 0.5%