Sblog

Hello blog

Date: 2022-11-17

The most basic blog has started. Here are some not very well organized thoughts on what's happened so far.

Webdock

Webdock's cheapest plan makes this side project blog idea's monetary investment cheaper than the price of a meal, once per month. Their server setup couldn't be simpler and painless - the typical web stack was pre installed, which meant I could just set up the site with a little bit of Nginx config changes and some directory permission changes (admittedly those were not really needed).

Laravel

Laravel still has great dev UX, which is my favorite PHP framework or CMS. The bar is not high, considering my experience with other PHP sites is either WordPress or some homebrew Frankenstein's legacy monsters. Still, starting a new application takes seconds and the dependency injection, MVC wiring, the Eloquent ORM etc. make writing code breezy. I shouldn't forget to mention that Laravel has great documentation because when in doubt RTFM.

Something that I hadn't tried before is using Blade components instead of the classic includes/sections and the mental model is indeed easier, as Laravel's docs claim.

Vite

Coming from Webpack, Vite's configuration has been very simple in comparison. Live reload, file watch, Vue template file support and Laravel integration all in less than 20 LoC:

// vite.config.js
import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';
import vue from '@vitejs/plugin-vue';

export default defineConfig({
    plugins: [
        laravel({
            input: [
                'resources/css/app.css',
                'resources/js/app.js',
                'resources/js/post-edit.js',
            ],
            refresh: true,
        }),
        vue(),
    ],
});

On the Laravel side you just need to add a simple Blade directive wherever the assets should be loaded like this:

<head>
        <!-- ... -->
        @vite(['resources/css/app.css', 'resources/js/app.js'])
        <!-- ... -->
</head>

While running Vite in dev mode with the Laravel plugin, changing Laravel view files also refreshes the page(Laravel docs)

Tailwind CSS

This is definitely a different way of writing styles compared to the classical stylesheets and it takes some getting used to but getting something up and running was relatively easy. What I didn't like is just how long the markup becomes with all of these utility classes.