Architecture for a Domain Driven Design oriented application
Create a local environment file if needed: cp ./app/.env ./app/.env.local
No strict need to do this manually, if you run make start
it will be automatically prepared for you.
Please note: Make targets will run cp -n ./app/.env.dist ./app/.env
, so if a .env
file is already present, it won't be overwritten
To start the platform running make start
should be enough.
It will start the containerized platform:
$ docker-compose ps
Name Command State
---------------------------------------------------------------------------------
Name Command State Ports
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
demo-platform_adminer_1 entrypoint.sh docker-php-e ... Up 0.0.0.0:5555->8080/tcp
demo-platform_app_1 docker-entrypoint php-fpm Up (healthy) 9000/tcp
demo-platform_db_1 docker-entrypoint.sh --def ... Up 0.0.0.0:3306->3306/tcp, 33060/tcp
demo-platform_gateway_1 docker-entrypoint Up 0.0.0.0:8080->80/tcp
demo-platform_rabbitmq_1 docker-entrypoint.sh rabbi ... Up 15671/tcp, 0.0.0.0:8083->15672/tcp, 25672/tcp, 4369/tcp, 5671/tcp, 0.0.0.0:5672->5672/tcp
Take a look at Makefile to see what's going on
$ make
Usage:
make [target]
Available targets:
help Help
start starts platform
stop stops running platform `docker-compose stop`
build starts platform `docker-compose up -d --build`
destroy destroys platform `docker-compose down --remove-orphans`
show-routes Show routes exposed by the platform
code-static-analysis Run PHPStan to find errors in code.
checkout-tests Run Checkout tests
...
make checkout-tests
will run Checkout BC test suite- More to come...
This project's and this Architecture's goal is to provide a solid foundation for Acmes's evolution.
- focus on business needs
- provide valuable solutions to the business
- improve DX
- level up platform quality
- improve development velocity
- be ready to scale, scale, scale
WIP, in the process of defining boundaries and BCs
It is meant to be the piece of intelligence that handles Checkout Business process.
Disclaimer: no implementation so far, just a blueprint
The platform follows the Hexagonal Architecture and is structured using modules
.
.
├── app <-- the platform runtime, where the framework of choice lives
├── etc <-- mostly low level platform config
│ └── infrastructure <-- Infra configs for platform components
│ ├── mysql
│ ├── nginx
│ ├── php
│ ├── rabbitmq
│ └── traefik
├── src
│ ├── Common <-- Set of Common tools available for usage in other BC
│ │ ├── composer.json
│ │ ├── composer.lock
│ │ ├── docs
│ │ ├── src
│ │ └── tests
│ ├── Finance <-- Domain - Finance
│ │ └── Invoicing <-- A Bounded Context, a module in this architecture
│ │ ├── composer.json
│ │ ├── docs
│ │ ├── src
│ │ └── tests
│ └── Marketplace <-- Domain - Marketplace
│ └── Checkout <-- Another Bounded Context, another module in this architecture
│ ├── composer.json
│ ├── docs
│ ├── features
| | └── proposal_submission.feature
│ ├── src
│ │ ├── Application
│ │ ├── Domain
│ │ ├── Infrastructure
│ │ └── UI
│ └── tests
├── docker-compose.override.yml
├── docker-compose.override.yml.dist
├── docker-compose.yml
├── Dockerfile
├── Makefile
├── README.md
PHP Dockerfile comes with a build stage for debugging purposes.
To activate execute:
cp docker-compose.yml.dist docker-compose.yml
make start
- Configure your IDE
- DEBUG!