This project is a starter webapp with Symfony 7 to setup webhooks.
References :
This project require the following to get started :
- PHP 8.2
Clone Symfony webhook repository
git clone https://github.com/marsender/symfony-webhook.git
cd symfony-webhookInstall php dependencies
composer install
sudo chown -R www-data:$USER varInstall importmap vendor files
bin/console importmap:installBuild for production
composer cache-clear
bin/console asset-map:compileor use the command
composer deploySetup mattermost config in the env file
nano .env.local
# Set authentication: either the permanent auth token or the mattermost login user and password
# Set board api v2 url and yaml config fileSetup Github to send the webhooks to your application url
- Go to Settings | Webhooks | Settings tab
- Set the Payload URL with your app url, eg: https://webhook.host/webhook/github
- Set the Content type to: application/json
- Set "Which events would you like to trigger this webhook?" to "Let me select individual events."
- Select at least the "Issues" checkbox
bin/console debug:asset-map --full## Update importmap packages
# List outedated packages
bin/console importmap:outdated
# Update oudated packages
bin/console importmap:update # add packagename to update only one package## Install ES Module Shims for older browsers compatibility
bin/console importmap:require es-module-shimsbin/console make:webhookIf not already done, install Docker Compose
Read the official doc
Build the docker images
docker compose build --no-cacheStart the docker container
HTTP_PORT=8000 \
HTTPS_PORT=4443 \
HTTP3_PORT=4443 \
docker compose up --pull always -d --waitTest database
docker compose exec php bin/console dbal:run-sql -q "SELECT 1" && echo "OK" || echo "Connection is not working"Debug container
docker ps
docker exec -ti `container-id` /bin/bash # Enter the container
docker logs --tail 500 --follow --timestamps `container-id` # Display container logsDebug php container
docker compose exec php php --version
docker compose exec -ti php /bin/bashRecreate database
docker compose exec php bin/console doctrine:database:drop --force --if-exists
docker compose exec php bin/console doctrine:database:create --if-not-exists
docker compose exec php bin/console doctrine:schema:update --force --complete
docker compose exec php bin/console doctrine:schema:validate
docker compose exec php bin/console doctrine:fixtures:load -nTest app
docker compose exec php composer testTo add a package available for the version of php configured for the docker container (and not your host)
docker compose exec php composer require `package-name`Browse https//localhost:4443
Stop the docker container
docker compose down --remove-orphans
sudo rm -rf ./docker # To remove application database