phil / conversation-bundle
Private messages in Symfony, sealed at rest: direct and group conversations, who may write to whom, blocks, read and unread, optional notifications and Mercure.
Package info
github.com/parler-haut-interagir-librement/conversation-bundle
Type:symfony-bundle
pkg:composer/phil/conversation-bundle
Requires
- php: >=8.5
- ext-mbstring: *
- ext-sodium: *
- doctrine/dbal: ^4.5
- psr/clock: ^1.0
- psr/event-dispatcher: ^1.0
- psr/log: ^3.0
- symfony/config: ^8.2
- symfony/dependency-injection: ^8.2
- symfony/http-foundation: ^8.2
- symfony/http-kernel: ^8.2
- symfony/key-management: ^8.2
- symfony/uid: ^8.2
Requires (Dev)
- ext-pdo: *
- doctrine/doctrine-bundle: ^3.3
- doctrine/orm: ^3.7
- phil/notifications-bundle: ^0.1@dev || ^0.2@dev
- phil/privacy-bundle: ^0.1@dev
- phil/ux-kit: ^0.5@dev
- phpunit/phpunit: ^13.4
- symfony/browser-kit: ^8.2
- symfony/clock: ^8.2
- symfony/console: ^8.2
- symfony/css-selector: ^8.2
- symfony/dom-crawler: ^8.2
- symfony/event-dispatcher: ^8.2
- symfony/event-dispatcher-contracts: ^3.6
- symfony/framework-bundle: ^8.2
- symfony/mercure: ^0.10
- symfony/messenger: ^8.2
- symfony/process: ^8.2
- symfony/routing: ^8.2
- symfony/security-core: ^8.2
- symfony/security-csrf: ^8.2
- symfony/translation: ^8.2
- symfony/twig-bridge: ^8.2
- symfony/twig-bundle: ^8.2
- symfony/ux-twig-component: ^3.7
- twig/twig: ^3.21
Suggests
- doctrine/orm: For the tables added to the schema the ORM generates
- phil/notifications-bundle: To notify the recipients of each new message
- phil/privacy-bundle: For the conversations in the export and the erasure of a member's data
- phil/ux-kit: For the recipes Button, Badge and Textarea the pages draw, through the Symfony UX Toolkit
- symfony/asset-mapper: To serve the Stimulus controller of the real time without a build step
- symfony/console: For phil:conversation:rotate-keys
- symfony/mercure-bundle: To tell the open pages that a message came
- symfony/routing: For the pages of the conversations
- symfony/security-core: To name the current participant from the authenticated user
- symfony/security-csrf: For the forms of the pages
- symfony/twig-bundle: For the pages of the conversations
- symfony/ux-twig-component: For the recipes of the kit the pages draw
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-11-21 03:05:47 UTC
README
Private messages for Symfony: conversations between two members or in groups, sealed at rest.
phil/conversation-bundle gives an application private messages. A member writes to another, and the two share one direct conversation; or a member starts a group, with a subject, and brings others in. Participants are named by the stable identifier the application gives its members — never an email address, which the bundle refuses. Every subject and every message is sealed at rest by Symfony's KeyManagement component: a fresh data key per text, wrapped by a master key of the application's key management service, bound to its row, in a format that names its version and its algorithm. A rotation command seals the old texts again under a new master key.
Each member decides what they receive: whether everyone, their contacts or nobody may start a conversation with them, and whom they block. Each conversation keeps what each participant read, the inbox counts what is unread, and a participant may mute a conversation or leave it. The pages — the inbox, a conversation and its reply form, the form that writes to a member, the reception settings — work without JavaScript and draw their buttons, badges and text areas with the recipes of the kit, installed by the Symfony UX Toolkit.
It is for a site whose members talk to each other: a club, a community, a marketplace between buyers and sellers. It is also the ground other packages build on: a help desk whose requests are conversations, a live chat with visitors.
The bundle keeps its tables through DBAL, without the ORM, so that a long conversation and a full inbox are read by page. phil/notifications-bundle, Mercure and phil/privacy-bundle are optional: with the first, the recipients of a message are notified, those who muted the conversation or blocked the author excepted; with Mercure, the open pages load the new messages as they come; with the last, a member's conversations take part in the export and the erasure of their data. The services keep no state between requests and are safe in a long-running worker.
Status
| Part | State |
|---|---|
Direct and group conversations, participants named by stable identifiers, an @ refused |
Implemented and tested |
Subjects and bodies sealed at rest by the KeyManagement component, pcv1.a256gcm., bound to their row |
Implemented and tested |
The rotation of the master key and phil:conversation:rotate-keys |
Implemented and tested |
| Reception settings: everyone, contacts or nobody, and blocks | Implemented and tested |
| Read and unread, muting, leaving, inbox and thread read by page | Implemented and tested |
DBAL stores, the schema by Schema::editor(), moments in UTC; MySQL 8.4, PostgreSQL 17 and SQLite |
Implemented and tested |
| The pages: inbox, conversation, writing to a member, reception settings, with the recipes of the kit, English and French | Implemented and tested |
The notification of each message through phil/notifications-bundle |
Implemented and tested |
| The Mercure update of each message and its Stimulus controller, a hub that cannot be reached caught | Implemented and tested |
The export and the erasure of a member's conversations through phil/privacy-bundle |
Implemented and tested |
ConversationReader, startOpen() and join(), for the packages built on the bundle |
Implemented and tested |
| The Flex recipe: the bundle, its configuration and its routes | Written in recipe/0.1, for the recipes repository of PHIL |
Documentation
| Document | What it covers |
|---|---|
| Installation | Requirements, the key management service, the tables, the routes, the recipes of the kit, the recipe. |
| Configuration | Every option, with an example. |
| Conversations | Starting, writing, reading, unread, muting, leaving, the reception settings and the pages. |
| Encryption at rest | The sealed format, its context, the master keys and their rotation. |
| Notifications, real time and privacy | What the bundle does with phil/notifications-bundle, Mercure and phil/privacy-bundle. |
| Building on the bundle | ConversationReader, open conversations and join(), for a help desk or a live chat. |
| Extension points | The ports, the events, the services to replace, and when they are stable. |
| Testing | The bundle's tests, the servers its integration tests read, and testing code that uses it. |
| Reference | Every class and file of the bundle. |
Quick start
composer require phil/conversation-bundle php bin/console ux:install button badge textarea --kit=github.com/parler-haut-interagir-librement/ux-kit
# config/packages/key_management.yaml key_management: clients: local: 'sodium://?keys[conversations]=%env(CONVERSATIONS_MASTER_KEY)%' # config/packages/phil_conversation.yaml phil_conversation: encryption: key: conversations # config/routes/phil_conversation.yaml phil_conversation: resource: '@PhilConversationBundle/config/routes.php' prefix: /messages
$conversation = $conversations->startDirect(ParticipantId::fromString($me), ParticipantId::fromString($seller), 'Is the lamp still for sale?');
Requirements
PHP 8.5 or later with ext-sodium, Symfony 8.2 or later with its KeyManagement component, and Doctrine DBAL 4.
Contributing
Contributions are welcome on the PHIL monorepo: read the contribution guide and the code of conduct. Report a vulnerability privately, as the security policy explains, never in a public issue.
License
MIT, © Philippe Gamache, doing business as Le Gnome Archiviste; a Parler Haut Interagir Librement project. See LICENSE.