Like most people reading this, I've worked on several side projects over the years, but what I've noticed is that I start out with raw enthusiasm and excitement about building the next big thing but that enthusiasm and excitement quickly dissipates with all the setup crap that I repeat for each new project.
I've got a git repo to create, a Symfony web application to install and configure, Tailwind to install so the UI doesn't look like it was built back in 1994, xdebug to set up, coding analyzers and test suites (ahem) to build, blog functionality to port over (because we all need to be blogging about what we've done before we've done it) etc, etc. Often there is a bit of time gone by since I last spun up a new project and my old processes & guides are out of date, slowing things down further as I try and figure out what I'm supposed to be doing now.
My most recent example was when I was setting up a new project and tried to follow my guide for setting up Symfony & Tailwind with Webpack Encore (https://chrisshennan.com/blog/using-tailwind-css-with-symfony-asset-mapper) to make sure the instructions were still correct and I found that I should be setting up Symfony & Tailwind with Asset Manager now (https://chrisshennan.com/blog/using-tailwindcss-with-symfony-encore). Still, it did give me another blog article, but, I digress.
As I've got a few projects on the go, and they're all using slightly different stacks, this was getting somewhat unwieldy. Each time I switched projects, I had to relearn what was being used before I could move forward, upgrades were a nightmare as each one was slightly different, so I took a step back, looked at what I was using, and started to piece together "Scaffold",
So what is "Scaffold"?
In a nutshell, Scaffold is "A Symfony & Tailwind boilerplate to create a functional project ready for use within minutes rather than days". Currently, it consists of
- Symfony
- Tailwind
- Docker / Docker compose files
- Traditional LEMP stack (nginx, MySQL, PHP)
- with development builds (includes xdebug & composer)
- with production builds (I've still got to work out how to deploy the prod containers).
- PHP Static Analysers (PHP CS Fixer / PHPStan)
- Makefile with common commands (make build-tailwind, make composer-install)
- Stub test class
- Semantic Versioning
- GitLab .gitlab-ci.yml file with working build, test, semantic versions & production build steps
Symfony, Tailwind and Docker were mandatory requirements as these are the products I use with each of my projects. Although I could create a project without the static analysers, tests, and makefile, these are all things I use in my 9-5 job and I want to standardize my processes and reduce the cognitive overhead when switching contexts i.e. I could run docker run -it php-container bash -c "composer update"
on my local projects and make composer-update
at work, but it's much easier to use make composer-update
in both contexts and then I don't even have to think about it.
Semantic versioning was something I always wanted to know how to do, especially as I want to (later on) include Sentry within the Scaffold project and I want the semantic version number to be included so Sentry and accurately report which version is being run when an error is encountered. I've spent far too long on this, and a large portion of that was trying to figure out how to pass the release number down through the different CI jobs i.e. tags the code with the appropriate version number but also tag the production docker builds with the correct number too. I'm sure I'll change how this works further down the line but I'm happy with it so far.
And no project is complete without a CI pipeline, so it's included too, at least for GitLab (let me know if you want it for GitHub), with build, test, semantic versioning and production build steps.
So there you have it, A Symfony & Tailwind project, a lot of cruft around the edges, and no actual code (yet).
You can find Scaffold on GitHub via https://github.com/chrisshennan/scaffold
What's next for Scaffold?
There's a lot that I want to do into this, so it's going to take time to pull it all together. I'm also looking to port my existing projects into new "Scaffold" projects all the good functionality from all of them can be brought into some kind of "core" and all projects can benefit from this. The roadmap includes (not in any particular order)
- Stock Terms & Conditions & Privacy Policy pages - they won't be all-encompassing but enough for a basic project.
- Stock pricing page
- Blog
- Beehiiv integration
- Paddle Integration
- Register / Login with authenticated user areas
- Static Site Generator
- SEO
- Google Sitemap
- IndexNow
- Breadcrumbs
- Schema markup
But for now, I'm going to have fun and try to figure out how to use/build/extend Scaffold to build the "Build with Scaffold" website.
If this interests you in any way, please consider signing up to my newsletter for updates on my progress - https://chrisshennan.com/newsletter
Links
- Scaffold GitHub Repository - https://github.com/chrisshennan/scaffold
Originally published at https://chrisshennan.com/blog/build-with-scaffold-a-symfony-and-tailwind-css-boilerplate-for-your-next-project