avosalmon/modular-monolith-laravel
关于
Sample application for Laracon Online 2022.
网站与应用开发实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- 0
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文Modular Monolith Laravel
The sample e-commerce application for Laracon Online Winter 2022.
System requirements
Docker is installed on your machine.
Setup local environment
Copy example env file
cp .env.example .env
Start docker compose
docker compose up -d
Install composer dependencies
docker compose exec app composer install
Generate app key and places inside the .env file
docker compose exec app php artisan key:generate
Run DB migration
docker compose exec app php artisan migrate:fresh --seed
Now you can access the app via http://localhost.
To stop Docker containers
docker compose down
Laravel Sail command (optional)
This repository uses Laravel Sail for the local docker environment. You can use the sail command by configuring a bash alias below.
alias sail='[ -f sail ] && bash sail || bash vendor/bin/sail'
The sail command is an shortcut for docker compose exec app php which runs a given command within the docker container. The docker compose commands in the previous section can be shortened like this.
sail composer install
sail artisan key:generate
sail artisan migrate:fresh --seed
Testing
This repository uses Pest for writing tests. Pest is a testing framework with a simpler syntax like Jest and better reporting. Since it's powered by PHPUnit, it supports all the PHPUnit syntaxes as well.
Running tests
sail test
Filtering tests
sail test --filter OrderControllerTest
Display code coverage
sail test --coverage --min=80
Static code analysis to enforce domain boundaries
Deptrac is a static code analysis tool for PHP that helps you define architectual layers over classes and rules on which layer can access which layer.
You can run deptrac with the command below.
sail exec app ./vendor/bin/deptrac
You can also visualize the dependency graph by exporting the analysis result as an image.
sail exec app ./vendor/bin/deptrac --formatter=graphviz-image --output="./deptrac.png"
探索相关项目
加载中…