The Code Architecture

If you are searching for :

  • organizing your own app code, see symfony good practices or look at the demo app
  • organizing the code for a pushword extension : see extensions and extension points

Else, you are at the good place.

Here, we will speak about :

  • code organisation for Pushword core and officially maintained extensions
  • how to prepare a development environment to be able to contribue

Code Architecture

The code for all officially maintained extension and the core is kept in an unique repository.

It's a mono-repository.

It's kind of majestic monolith.

The core contain the minimum features, then everything is done via extensions.

The core code follows as much as it can the symfony good practices and has a special folder named component for bigger features like the Entity Filter system if they do not have their own independent package.

Each extension is optional.

Keeping all these extensions in one repository permits testing that everything works easily, understanding the code faster and refactoring much quicker.

The skeleton isn't a real skeleton (copy and install).

It's used for testing, demo, using for generating the docs and a few class from skeleton are extracted by the default installer.

On top of Symfony

Each package (except skeleton, installer and js-helper) is built as a symfony bundle.

The core package requires a Symfony app installed to be functional.

Want a particular details about the way the code is organized ?

Feel free to ask, I will list answers here.

Development environement

This is only for contribution, if you are searching to develop a new application with Pushword, see installation.

  1. Check you have installed all the required dependencies.
  1. (Fork and) Clone the repository
  1. Install dependencies and initialize default app
composer update && composer reset-skeleton

Useful commands

# php-cs-fixer
composer format

# run rector, format and tests
composer rector

# run phpstan
composer stan

# to play with default app console (skeleton)
composer console ...

Packages

PackagePurposeDepends on
coreBase entities (Page, Media, User), entity filters, events, controllers, Twig extensions
adminCRUD interface for Page, Media, User built on EasyAdmincore
admin-block-editorRich text / block editor for the admincore
advanced-main-imageMain image format options (hidden, hero, etc.) and default templatescore, admin
conversationComments, contact forms, user inputcore, flat
docsProject documentation (ships to end users as vendor/pushword/docs/content/)
flatFlat-file CMS mode: sync pages/media between database and filesystemcore
installerBootstraps a new Pushword projectcore
js-helperShared JavaScript utilities (Node package)
admin-monaco-editorMonaco code editor for admin (Node package)
newMeta-package that pulls in core + admin + common extensionscore
page-scannerDead link detection, 404/301 checks, TODO scanningcore
page-update-notifierEmail notifications on page editscore
searchOptional SQLite full-text search via Loupe (zero infra)core
skeletonDev/test/demo app (not a real skeleton for end users)core
snippetReusable content fragments + dev-registered components, via snippet()core
static-generatorGenerate static HTML sitescore
template-editorEdit Twig templates from the admin UIcore
versionPage versioningcore