https://github.com/sfinx13/poc-mercure-messenger
App to simulate an extract large data in asynchronous way using Messenger and Mercure for live notification
https://github.com/sfinx13/poc-mercure-messenger
asynchronous docker docker-compose github-actions jwt mercure php php8 phpunit phpunit-tests realtime server-sent-events symfony symfony-messenger
Last synced: 17 days ago
JSON representation
App to simulate an extract large data in asynchronous way using Messenger and Mercure for live notification
- Host: GitHub
- URL: https://github.com/sfinx13/poc-mercure-messenger
- Owner: sfinx13
- Created: 2021-07-14T15:37:53.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-06-05T21:12:34.000Z (over 2 years ago)
- Last Synced: 2023-06-05T22:38:01.046Z (over 2 years ago)
- Topics: asynchronous, docker, docker-compose, github-actions, jwt, mercure, php, php8, phpunit, phpunit-tests, realtime, server-sent-events, symfony, symfony-messenger
- Language: PHP
- Homepage:
- Size: 3.11 MB
- Stars: 8
- Watchers: 1
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README


# Asynchronous export with real-time notifications
> Demo made with mercure and messenger symfony components
Extract csv data in asynchronous way using messenger and and get real-time notifications about what happened using mercure components

## Installation
```bash
cp .env.dist .env
make build
```
Export CSV | Notification center
:-------------------------:|:-------------------------:
 | 
Login: [localhost:8080](http://localhost:8080)
Notification: [http://localhost:8080/app/notifications](http://localhost:8080/app/notifications)
### Credentials
* Login: `demo-1`, Password: `demo-1`
* Login: `demo-2`, Password: `demo-2`
* Login: `admin`, Password: `admin`
### Command
> Send a notification with random message with option if you want to push more messages
```bash
docker exec -it poc-php-fpm bin/console app:send-notif -i 50
```
### Debugging
* Debugging tool: http://localhost:9000/.well-known/mercure/ui/
* Upload postman collection [postman/](postman/)
## Usage
|Commands |Description |
|---------|-------------|
|make build| Installation |
|make run| Start containers |
|make shutdown| Shutdown containers |
|make restart| Restart containers |
|make php-fpm| Connect php-fpm container |
|make php-worker| Connect php-worker container |
|make mysql| Connect mysql container |
|make mercure| Connect mercure container |
|make composer| Install composer dependencies |
|make npm install| Install npm dependencies |
|make npm build| Build npm dependencies |
|make rebuild-database| Rebuild database |
|make test| Execute phpunit tests |
|make test-coverage| Generate phpunit coverage report in html |
|make help | Show list of commande available
## Links
* [Pushing Data to Clients Using the Mercure Protocol](https://symfony.com/doc/current/mercure.html)
* [Messenger: Sync & Queued Message Handling](https://symfony.com/doc/current/messenger.html)
* [Getting started with mercure](https://mercure.rocks/docs/getting-started)
* [Mercure documentation](https://mercure.rocks/docs)
* [Awesome Mercure Resources](https://mercure.rocks/docs/ecosystem/awesome)
* [Using server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events)