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 dev-app isn't a copy-and-install starter (it was formerly, and misleadingly, named skeleton).

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

On top of Symfony

Each package (except dev-app, 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-dev-app

Useful commands

# php-cs-fixer
composer format

# run rector, format and tests
composer rector

# run phpstan
composer stan

# to play with default app console (dev-app)
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
ai-skillsAI authoring skills (the /pw router skill and its reference playbooks) — Node package
apiToken-authenticated REST API mirroring the admin, with an OpenAPI endpointcore
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
newsletterAudiences, contacts, segmented campaigns and criteria-driven automationscore
page-scannerDead link detection, 404/301 checks, TODO scanningcore
page-update-notifierEmail notifications on page editscore
quizInteractive client-side QCM / personality tests via a {% quiz %} blockcore
repurposeTurn a page into social carousels rendered as SVG slides (PNG/PDF export)core
searchOptional SQLite full-text search via Loupe (zero infra)core
dev-appDev/test/demo app (not a copy-paste starter for end users; formerly named skeleton)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