{"id":15026367,"url":"https://github.com/alejandrososa/firestorm","last_synced_at":"2026-03-15T09:11:48.444Z","repository":{"id":96577156,"uuid":"210278784","full_name":"alejandrososa/firestorm","owner":"alejandrososa","description":"Star Wars: Operación Firestorm","archived":false,"fork":false,"pushed_at":"2020-02-12T19:32:43.000Z","size":229,"stargazers_count":0,"open_issues_count":4,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-19T19:52:03.018Z","etag":null,"topics":["ddd-cqrs","ddd-events","docker","microservices","php73","phpunit","symfony4"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alejandrososa.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-09-23T06:19:23.000Z","updated_at":"2019-09-27T11:44:18.000Z","dependencies_parsed_at":"2023-03-13T16:29:49.693Z","dependency_job_id":null,"html_url":"https://github.com/alejandrososa/firestorm","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alejandrososa%2Ffirestorm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alejandrososa%2Ffirestorm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alejandrososa%2Ffirestorm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alejandrososa%2Ffirestorm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alejandrososa","download_url":"https://codeload.github.com/alejandrososa/firestorm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243327018,"owners_count":20273592,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ddd-cqrs","ddd-events","docker","microservices","php73","phpunit","symfony4"],"created_at":"2024-09-24T20:04:22.053Z","updated_at":"2025-12-25T09:49:04.228Z","avatar_url":"https://github.com/alejandrososa.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Docker + Symfony: Firestorm App with CQRS and Event Sourcing\n\nDocker symfony gives you everything you need for developing Symfony application. This complete stack run with docker and [docker-compose](https://docs.docker.com/compose/).\n\n## Installation step by step\n\n1. Install [docker](https://docs.docker.com/compose/install/) and [docker-compose](https://docs.docker.com/compose/install/#install-compose)\n\n2. Build/run containers with (with and without detached mode)\n\n    ```bash\n    $ docker-compose build\n    $ docker-compose up -d\n    ```\n\n3. Update your system host file (add firestorm.local)\n\n    ```bash\n    # UNIX only: get containers IP address and update host (replace IP according to your configuration) (on Windows, edit C:\\Windows\\System32\\drivers\\etc\\hosts)\n    $ sudo echo \"127.0.0.1 firestorm.local\" \u003e\u003e /etc/hosts\n    ```\n\n    **Note:** For **OS X**, please take a look [here](https://docs.docker.com/docker-for-mac/networking/) and for **Windows** read [this](https://docs.docker.com/docker-for-windows/#/step-4-explore-the-application-and-run-examples) (4th step).\n\n4. Prepare Backend app\n\n    1. Go to root directory\n    2. Composer install\n\n        ```bash\n        $ docker-compose exec php composer install\n        ```\n\n5. Enjoy :-)\n\n* Visit [firestorm.local:8081](http://firestorm.local:8081)  \n\n\n## Usage\n\nJust run `docker-compose up -d`, then:\n\n* App: visit [firestorm.local:8081](http://firestorm.local:8081)  \n\n**cURL**\n\n```bash\n$ curl -X POST http://firestorm.local:8081/api/v1/missile/calculate-area \\\n    -F uuid=e856c897-bd9e-4c2d-815a-220bd56605fa -F precision=100\n  \nResult:                                                                 \n    Success\n\n-----\n\n$ curl -X GET http://firestorm.local:8081/api/v1/missile/calculate-area/e856c897-bd9e-4c2d-815a-220bd56605fa\n   \nResult:                                                                \n    {\n        \"response\": {\n            \"area\": 0.006666666666666667,\n            \"weather\": {\n                \"wind\": \"broken clouds, 2.10 m/s Barcelona ( 160.00 )\",\n                \"humidity\": \"78%\"\n            }\n        }\n    }\n```\n\n**Bash**\n\n```bash\n$ docker-compose exec php php bin/console firestorm:calculate-area 1cd56a54-e119-11e9-81b4-2a2ae2dbcce4 12000\n  \nResult:                                                                \n    Calculate Area\n    ============\n    Uuid: 1cd56a54-e119-11e9-81b4-2a2ae2dbcce4\n    precision: 12000\n                                                                        \n    [OK] Success!   \n\n\n$ docker-compose exec php php bin/console firestorm:get-area-by-id 1cd56a54-e119-11e9-81b4-2a2ae2dbcce4\n   \nResult:                                                                \n    Get Area by Id\n    ============\n    Uuid: 1cd56a54-e119-11e9-81b4-2a2ae2dbcce4\n    \n     {\n        \"response\": {\n            \"area\": 0.11273333333333334,\n            \"weather\": {\n                \"wind\": \"broken clouds, 2.10 m\\/s Barcelona ( 160.00 )\",\n                \"humidity\": \"78%\"\n            }\n        }\n    }\n```\n\n**Testing**\n\n```bash\n$ docker-compose exec php cp phpunit.xml.dist phpunit.xml \n$ docker-compose exec php ./vendor/bin/phpunit\n\nPHPUnit 7.5.16 by Sebastian Bergmann and contributors.\n\n...................................                               35 / 35 (100%)\n\nTime: 865 ms, Memory: 28.00 MB\n\nOK (35 tests, 65 assertions)\n\n-------\n\n$ docker-compose exec php ./vendor/bin/phpunit --coverage-text \n\nPHPUnit 7.5.16 by Sebastian Bergmann and contributors.\n\n...................................                               35 / 35 (100%)\n\nTime: 1.41 seconds, Memory: 18.00 MB\n\nOK (35 tests, 65 assertions)\n\n\nCode Coverage Report:      \n  2019-09-27 11:42:14      \n                           \n Summary:                  \n  Classes: 62.50% (15/24)  \n  Methods: 79.22% (61/77)  \n  Lines:   79.62% (211/265)\n\n\\Firestorm::Firestorm\\Kernel\n  Methods:  50.00% ( 2/ 4)   Lines:  31.58% (  6/ 19)\n\\Firestorm\\MonCalamari\\Application\\Command::Firestorm\\MonCalamari\\Application\\Command\\CalculateArea\n  Methods: 100.00% ( 3/ 3)   Lines: 100.00% (  5/  5)\n\\Firestorm\\MonCalamari\\Application\\Command::Firestorm\\MonCalamari\\Application\\Command\\CalculateAreaHandler\n  Methods: 100.00% ( 3/ 3)   Lines: 100.00% ( 18/ 18)\n\\Firestorm\\MonCalamari\\Application\\Event::Firestorm\\MonCalamari\\Application\\Event\\AttachWeatherToMissile\n  Methods: 100.00% ( 2/ 2)   Lines: 100.00% (  3/  3)\n\\Firestorm\\MonCalamari\\Application\\Event::Firestorm\\MonCalamari\\Application\\Event\\AttachWeatherToMissileHandler\n  Methods:  75.00% ( 3/ 4)   Lines:  89.29% ( 25/ 28)\n\\Firestorm\\MonCalamari\\Application\\Exception::Firestorm\\MonCalamari\\Application\\Exception\\AreaNotFound\n  Methods: 100.00% ( 1/ 1)   Lines: 100.00% (  1/  1)\n\\Firestorm\\MonCalamari\\Application\\Exception::Firestorm\\MonCalamari\\Application\\Exception\\CalculatedAreaAlreadyExists\n  Methods: 100.00% ( 1/ 1)   Lines: 100.00% (  1/  1)\n\\Firestorm\\MonCalamari\\Application\\Query::Firestorm\\MonCalamari\\Application\\Query\\GetAreaById\n  Methods: 100.00% ( 2/ 2)   Lines: 100.00% (  3/  3)\n\\Firestorm\\MonCalamari\\Application\\Query::Firestorm\\MonCalamari\\Application\\Query\\GetAreaByIdHandler\n  Methods: 100.00% ( 3/ 3)   Lines: 100.00% (  9/  9)\n\\Firestorm\\MonCalamari\\Application\\Transformer::Firestorm\\MonCalamari\\Application\\Transformer\\MissileArrayTransformer\n  Methods: 100.00% ( 2/ 2)   Lines: 100.00% (  6/  6)\n\\Firestorm\\MonCalamari\\Domain\\Events::Firestorm\\MonCalamari\\Domain\\Events\\MissileWasConfiguredWithAttackArea\n  Methods:  33.33% ( 1/ 3)   Lines:  81.82% (  9/ 11)\n\\Firestorm\\MonCalamari\\Domain\\Events::Firestorm\\MonCalamari\\Domain\\Events\\MissileWasUpdatedWithWeather\n  Methods:  33.33% ( 1/ 3)   Lines:  69.23% (  9/ 13)\n\\Firestorm\\MonCalamari\\Domain\\Model::Firestorm\\MonCalamari\\Domain\\Model\\AggregateRoot\n  Methods:  50.00% ( 1/ 2)   Lines:  66.67% (  6/  9)\n\\Firestorm\\MonCalamari\\Domain\\Model\\Missile::Firestorm\\MonCalamari\\Domain\\Model\\Missile\\MissileArea\n  Methods: 100.00% ( 7/ 7)   Lines: 100.00% ( 16/ 16)\n\\Firestorm\\MonCalamari\\Domain\\Model\\Missile::Firestorm\\MonCalamari\\Domain\\Model\\Missile\\MissileId\n  Methods: 100.00% ( 5/ 5)   Lines: 100.00% (  7/  7)\n\\Firestorm\\MonCalamari\\Domain\\Model\\Missile::Firestorm\\MonCalamari\\Domain\\Model\\Missile\\MissileSensor\n  Methods: 100.00% ( 6/ 6)   Lines: 100.00% ( 10/ 10)\n\\Firestorm\\MonCalamari\\Domain\\Model\\Missile::Firestorm\\MonCalamari\\Domain\\Model\\Missile\\ProtonTorpedoMissile\n  Methods:  88.89% ( 8/ 9)   Lines:  94.74% ( 18/ 19)\n\\Firestorm\\MonCalamari\\Infrastructure\\Persistence::Firestorm\\MonCalamari\\Infrastructure\\Persistence\\RedisSensorRepository\n  Methods:  33.33% ( 1/ 3)   Lines:  45.45% (  5/ 11)\n\\Firestorm\\MonCalamari\\Ui\\Api\\Controller::Firestorm\\MonCalamari\\Ui\\Api\\Controller\\CalculateAreaController\n  Methods: 100.00% ( 1/ 1)   Lines: 100.00% (  7/  7)\n\\Firestorm\\MonCalamari\\Ui\\Api\\Controller::Firestorm\\MonCalamari\\Ui\\Api\\Controller\\GetAreaByIdController\n  Methods: 100.00% ( 1/ 1)   Lines: 100.00% (  5/  5)\n\\Firestorm\\MonCalamari\\Ui\\Console\\Command::Firestorm\\MonCalamari\\Ui\\Console\\Command\\CalculateAreaCommand\n  Methods: 100.00% ( 3/ 3)   Lines: 100.00% ( 21/ 21)\n\\Firestorm\\MonCalamari\\Ui\\Console\\Command::Firestorm\\MonCalamari\\Ui\\Console\\Command\\GetAreaByIdCommand\n  Methods: 100.00% ( 4/ 4)   Lines: 100.00% ( 21/ 21)\n\n\n```\n\n## How it works?\n\nHave a look at the `docker-compose.yml` file, here are the `docker-compose` built images:\n\n* `nginx`: This is the server container\n* `redis`: This is the cache system container\n* `php`: This is the PHP-FPM and Apache2 container in which the application volume is mounted\n\nThis results in the following running containers:\n\n```bash\n$ docker-compose ps \n\n      Name                     Command               State                Ports              \n---------------------------------------------------------------------------------------------\nfirestorm_nginx_1   nginx                            Up      443/tcp, 0.0.0.0:8081-\u003e80/tcp   \nfirestorm_php_1     docker-php-entrypoint php- ...   Up      9000/tcp, 0.0.0.0:9001-\u003e9001/tcp\nfirestorm_redis_1   docker-entrypoint.sh redis ...   Up      0.0.0.0:6379-\u003e6379/tcp  \n\n```\n\n## Useful commands\n\n```bash\n# bash commands access to container php\n$ docker-compose exec php sh\n\n# Composer (e.g. composer install or composer update)\n$ docker-compose exec php composer install\n$ docker-compose exec php composer update\n\n# Symfony commands\n$ docker-compose exec php php bin/console                                   #list of commands available\n$ docker-compose exec php php bin/console cache:clear                       #clear cache\n$ docker-compose exec php php bin/console cache:pool:clear cache.app        #clear cache redis\n$ docker-compose exec php php bin/console firestorm:calculate-area -h       #show help to calculate area\n$ docker-compose exec php php bin/console firestorm:calculate-area uuid precision      \n$ docker-compose exec php php bin/console firestorm:get-area-by-id -h       #show help to get calculated area\n$ docker-compose exec php php bin/console firestorm:get-area-by-id uuid       \n\n# Retrieve an IP Address (here for the nginx container)\n$ docker inspect $(docker ps -f name=nginx -q) | grep IPAddress\n\n# F***ing cache/logs folder\n$ sudo chmod -R 777 var/cache var/log var/sessions \n\n# Check CPU consumption\n$ docker stats $(docker inspect -f \"{{ .Name }}\" $(docker ps -q))\n\n# Stop all containers\n$ docker container stop $(docker container ls -aq)\n\n# Delete all containers\n$ docker rm $(docker ps -aq)\n$ docker container rm $(docker container ls -aq)\n\n# Delete all images\n$ docker rmi $(docker images -q)\n```\n\n\n\n## FAQ\n\n* Got this error: `ERROR: Couldn't connect to Docker daemon at http+docker://localunixsocket - is it running?\nIf it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.` ?  \nRun `docker-compose up -d` instead.\n\n* Permission problem? See [this doc (Setting up Permission)](http://symfony.com/doc/current/book/installation.html#checking-symfony-application-configuration-and-setup)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falejandrososa%2Ffirestorm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falejandrososa%2Ffirestorm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falejandrososa%2Ffirestorm/lists"}