Architecture

Architecture Overview

Module Status

Module Status Notes
Core/Platform๐Ÿšง In ProgressAbstractId, Timestamps, DomainEventInterface, TenantId, FileStorage, org context contracts
Core/Identity๐Ÿšง In ProgressTenant, User, ApiKey aggregates, Zitadel OIDC auth, API key auth, admin CRUD
Module/Organization๐Ÿšง In ProgressFull DDD module: Organization + OrgMembership, ltree hierarchy, admin + API
Module/People๐Ÿ“‹ DesignedUser profiles, privacy, directory. Modeled on User aggregate.
Module/Groups๐Ÿšง In ProgressFull DDD module: Group + GroupMembership, member management, admin + API
Module/Events๐Ÿšง In ProgressFull DDD module: Event + EventRegistration, publish/cancel, recurrence, admin + API
Module/News๐Ÿ“‹ DesignedMulti-level feed, push notifications
Module/Givingโณ Phase 2Donations, pledges, campaigns
Module/Chatโณ Phase 2Group chat, 1:1 messaging
Pipeline/Audit๐Ÿšง In ProgressAuditEntry, async handler, superadmin UI
Pipeline/History๐Ÿšง In ProgressEntitySnapshot, versioned snapshots

Architecture Layers


โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                     Presentation Layer                       โ”‚
โ”‚            API Controllers ยท Admin (Twig + Vue 3)            โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                     Application Layer                        โ”‚
โ”‚         Commands ยท Queries ยท Handlers ยท DTOs                 โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                       Domain Layer                           โ”‚
โ”‚   Aggregates ยท Value Objects ยท Domain Events ยท Contracts     โ”‚
โ”‚                  โ† Pure PHP, no framework โ†’                  โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                   Infrastructure Layer                        โ”‚
โ”‚     Doctrine ยท Messenger ยท Flysystem ยท Zitadel ยท Redis       โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
  

Project Structure


src/
โ”œโ”€โ”€ Core/           โ† Platform, Identity (shared contracts)
โ”‚   โ”œโ”€โ”€ Platform/   โ† AbstractId, Timestamps, TenantId, events
โ”‚   โ””โ”€โ”€ Identity/   โ† User, Tenant, ApiKey, auth
โ”œโ”€โ”€ Module/         โ† Feature modules (DDD bounded contexts)
โ”‚   โ”œโ”€โ”€ Organization/
โ”‚   โ”œโ”€โ”€ Groups/
โ”‚   โ”œโ”€โ”€ Events/
โ”‚   โ”œโ”€โ”€ People/     โ† Designed, not yet implemented
โ”‚   โ””โ”€โ”€ News/       โ† Designed, not yet implemented
โ””โ”€โ”€ Pipeline/       โ† Observe & Protect (cross-cutting)
    โ”œโ”€โ”€ Audit/      โ† Append-only audit log
    โ””โ”€โ”€ History/    โ† Entity version snapshots
  

Key Architecture Rules

  1. Domain layer is pure PHP. No Doctrine, no Symfony, no framework imports.
  2. Modules communicate via domain events or contract interfaces. Never import another module's domain or infrastructure.
  3. Every domain event is JSON-serializable with a version field.
  4. Deptrac enforces all boundaries. If Deptrac fails, the code doesn't merge.
  5. No cross-module database queries. One module, one schema prefix.
  6. Tests accompany every feature. Unit tests for domain, integration for infrastructure.

Tech Stack

LayerTechnology
BackendSymfony 8.0, PHP 8.4+
DatabasePostgreSQL 16 + ltree
Cache/QueueRedis 7 + Symfony Messenger
IdentityZitadel (self-hosted OIDC)
FrontendReact Native (Expo) โ€” iOS, Android, Web
StorageCloudflare R2 + CDN
HostingHetzner, Docker, Cloudflare Pages
IaCOpenTofu
CI/CDGitLab CI/CD