TYPO3 Project setup

What do we need❓

  • LAMP stack including configuration and services (e.g. solr)
  • Package-Manager
  • Site package
  • QA Tools / Analyzer
  • Versioning
  • Bundler
  • Tests (unit, functional, acceptance)
  • Continous integration

LAMP stack

To run the website we need a webserver, a database and PHP.

Either set this up all yourself or you can use DDEV:

  • Easy to set up
  • Share configuration with your team using VCS
  • Flexible configuration
  • Integrate services (e.g. solr)

Package-Manager / Dependency Manager

To get third party dependencies in place:

  • PHP - Composer, the one and only
  • Node - NPM, yarn will do the job as well

Site package

The place where your website will life in.

It contains all the code that makes up the website.

QA Tools / Analyzer

Tools to enfore coding standards and prevent bugs might come in handy improving the code.

  • PHPStan* - Find bugs before they reach production
  • PHP CS Fixer* - Apply coding standards
  • EditorConfig* - helps maintain consistent coding styles

* used by the TYPO3 Core

Versioning

Using a version control system it makes it easier to understand what,

when and why a change was done to the code.

  • Git
  • Subversion
  • Mercurial
  • ...

Most likely Git due to adoption in GitHub/GitLab.

It is rare to see the others out in the wild these days.

Bundler

Pack up and process SCSS, Javascript files and more to be ready for the browser.

There are many different bundlers around like gulp, grunt, webpack, vite.

Nowadays, i prefer to use vite because of its simple configuration and speed.

Tests (unit, functional, acceptance)

Tests are always good practice. It will ensure that the changed code is still working.

  • Unit/functional tests - PHPUnit*
  • Acceptance tests - Codeception*, Cypress

* used by the TYPO3 Core

Continous integration

On every change in the codebase a pipeline should run to execute the QA tool, bundle and testing.

Finally, ship your code.

  • CI Tools: GitHub Actions, GitLab (Runner)
  • Ship code: TYPO3 Surf, Deployer or a plain bash script if you prefer

Wait wait wait ....

… we have a gazillion of tools to install and configure ⁉️

There is a solution

… for GitLab users.

The GitLab Project Template for TYPO3

Let me show you …

https://gitlab.com/projects/new

Summary

Wanted Available and preconfigured in the Template
LAMP ✅ DDEV
Package-Manager ✅ Composer, NPM
Site package
QA Tools / Analyzer ✅ PHPStan, PHP-CS-Fixer
Versioning ✅ Git
Bundler ✅ ViteJS
Tests (unit, functional, acceptance)
Continous integration ⚠️ GitLab Runner + deployer (needs additional configuration)

Contribute

Project (maintained by GitLab):

https://gitlab.com/gitlab-org/project-templates/typo3-distribution/

Workflow:

  • Fork project
  • 🚀 do awesome stuff 🚀
  • Open a merge request and give a detailed description
  • Request a reviewer: @gitlab-bot ready
  • 🥁 Wait for it to get merged
  • Create an issue: https://gitlab.com/gitlab-org/gitlab/
    • ⚠️ Try to keep changes small

Merge Request example

Task: Update template zip archive

Stats: 25 participants, 3 approvers, 11 labels

https://gitlab.com/gitlab-org/gitlab/-/merge_requests/125094

Thanks for listening

Inspiring People To Share

Everyone can contribute