Skip to content

Commit 3ae8ca2

Browse files
authored
Merge pull request #409 from wayofdev/docs/updates
2 parents 8780531 + 8698ed7 commit 3ae8ca2

File tree

9 files changed

+132
-44
lines changed

9 files changed

+132
-44
lines changed

.github/CONTRIBUTING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
To be added...

.github/assets/deployments.png

577 KB
Loading

.github/labeler.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
"type: documentation":
1313
- changed-files:
14-
- any-glob-to-any-file: ['assets/**/*', '.github/*', './*.md']
14+
- any-glob-to-any-file: ['.github/*', './*.md']
1515

1616
"type: maintenance":
1717
- changed-files:

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ lint-deptrac-ci: ## Runs deptrac – static analysis tool with github output (CI
282282
.PHONY: lint-deptrac-ci
283283

284284
lint-deptrac-gv: ## Runs deptrac – static analysis tool and generates graphviz image
285-
$(APP_RUNNER) .phive/deptrac analyse --config-file=deptrac.yaml -v --cache-file=.build/.deptrac.cache --formatter graphviz-image --output ../assets/deptrac.svg
285+
$(APP_RUNNER) .phive/deptrac analyse --config-file=deptrac.yaml -v --cache-file=.build/.deptrac.cache --formatter graphviz-image --output ../.github/assets/deptrac.svg
286286
.PHONY: lint-deptrac-gv
287287

288288
lint-composer: ## Normalize composer.json and composer.lock files

README.md

Lines changed: 115 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -54,31 +54,67 @@ This repository provides a modified file structure for Laravel that follows DDD
5454

5555
This starter template includes several added, changed, and removed features:
5656

57+
### → Framework Modifications
58+
5759
* **Added:**
5860
* Strict types declaration in all PHP files
61+
* Application dockerization using docker-compose and Makefile — use `make help` to view available commands
62+
* [spatie/laravel-route-attributes](https://github.com/spatie/laravel-route-attributes) package for route definition using PHP8 style attributes
63+
64+
* **Changed:**
65+
* Marked default Laravel classes as `final`
66+
* Modified file structure to meet DDD principles (as close as possible)
67+
* Changed config folder files to use default PHP multi-line comment style
68+
69+
* **Removed:**
70+
* Dependencies like Laravel Sanctum, Laravel Pint, and Laravel Sail
71+
* Broadcasting service provider and its routes. It can be added back if required for the project
72+
* Console routes in favor of Command classes
73+
* Sanctum migration files
74+
75+
### → Development Tools
76+
77+
* **Added:**
5978
* Style checker package for custom rule-sets to php-cs-fixer — [wayofdev/php-cs-fixer-config](https://github.com/wayofdev/php-cs-fixer-config)
79+
* [Phive](https://github.com/phar-io/phive) support for managing PHP tools
80+
* [ergebnis/composer-normalize](https://github.com/ergebnis/composer-normalize) composer plugin for normalizing composer.json file
81+
* [maglnet/ComposerRequireChecker](https://github.com/maglnet/ComposerRequireChecker) to check whether a specific composer package uses imported symbols that aren't part of its direct composer dependencies
82+
* Application dockerization using docker-compose and Makefile — use `make help` to view available commands
83+
* [docker-php-dev](https://github.com/wayofdev/docker-php-dev) as PHP development environment with XDebug support out of the box
84+
85+
### → Testing
86+
87+
* **Added:**
88+
* Configured [PHPUnit](https://phpunit.de/index.html) for unit testing.
89+
* Integrated [Pest PHP](https://pestphp.com) for elegant console support and architecture testing.
90+
* [Infection](https://github.com/infection/infection) for mutation testing to ensure quality.
91+
* Mutation test reports are uploaded [Stryker Mutator Dashboard](https://dashboard.stryker-mutator.io).
92+
93+
### → Static Analysis
94+
95+
* **Added:**
6096
* Static analysis tool — [PHPStan](https://phpstan.org) and it's extensions:
6197
* [phpstan/extension-installer](https://github.com/phpstan/extension-installer) — automatic installation of PHPStan extensions
6298
* [phpstan/phpstan-deprecation-rules](https://github.com/phpstan/phpstan-deprecation-rules) — rules for detecting usage of deprecated classes, methods, properties, constants and traits.
63-
* [nunomaduro/larastan](https://github.com/nunomaduro/larastan) — PHPStan integration with Laravel
64-
* [Pest](https://pestphp.com) testing framework
65-
* Github action workflows for:
99+
* [larastan/larastan](https://github.com/larastan/larastan) for Laravel-specific static analysis.
100+
* [Psalm](https://github.com/vimeo/psalm) static analysis tool and it's extensions:
101+
* [psalm/plugin-laravel](https://github.com/psalm/psalm-plugin-laravel) — Psalm plugin for Laravel
102+
* [psalm/plugin-phpunit](https://github.com/psalm/psalm-plugin-phpunit) — Psalm plugin for PHPUnit
103+
* [PHP Rector](https://github.com/rectorphp/rector) for automated code upgrades and refactoring, maintaining modern code standards.
104+
105+
### → Continuous Integration
106+
107+
* **Added:**
108+
* GitHub action workflows for:
66109
* Continuous integration which includes coding standards checks, unit testing and static analysis
67110
* Automatic pull-request labeling
68-
* [Deployer](https://deployer.org) for automatic deployments to staging and production servers with support of [Github Environments](https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment)
69-
* [ergebnis/composer-normalize](https://github.com/ergebnis/composer-normalize) composer plugin for normalizing composer.json file
70-
* [roave/securityadvisories](https://github.com/Roave/SecurityAdvisories) package to ensure that application doesn't have installed dependencies with known security vulnerabilities.
71-
* Application dockerization using docker-compose and Makefile — use `make help` to view available commands
72111
* Git pre-commit hooks using [pre-commit](https://pre-commit.com) package
73-
* **Changed:**
74-
* Marked default Laravel classes as `final`
75-
* Modified file structure to meet DDD principles
76-
* Changed config folder files to use default PHP multi-line comment style
77-
* **Removed:**
78-
* Dependencies like Laravel Sanctum, Laravel Pint, and Laravel Sail.
79-
* Broadcasting service provider and it's routes. It can be added back, if it will be required for project
80-
* Console routes in favor of Command classes.
81-
* Sanctum migration files
112+
113+
### → Deployments
114+
115+
* **Added:**
116+
* [Deployer](https://deployer.org) for automatic deployments to staging and production servers with support of [GitHub Environments](https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment)
117+
* For more information see [Deployments](#-deployment-to-staging-and-production) section
82118

83119
<br>
84120

@@ -89,14 +125,14 @@ To use this repository, you need to meet the following requirements:
89125
* **macOS** Monterey+ or **Linux**
90126
* Docker 20.10 or newer
91127
* [How To Install and Use Docker on Ubuntu 22.04](https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-22-04)
92-
* Installed **dnsmasq** service, running in the system. You can use [ansible-role-dnsmasq](https://github.com/wayofdev/ansible-role-dnsmasq) to install and configure this service.
93128
* **Cloned, configured and running** [docker-shared-services](https://github.com/wayofdev/docker-shared-services) to support system-wide DNS, routing, and TLS support via Traefik.
94129

95130
<br>
96131

97132
## 💿 Installation
98133

99-
> Warning: You should configure, set up, and run the [docker-shared-services](https://github.com/wayofdev/docker-shared-services) repository to ensure system-wide TLS and DNS support.
134+
> [!Note]
135+
> You should configure, set up, and run the [docker-shared-services](https://github.com/wayofdev/docker-shared-services) repository to ensure system-wide TLS and DNS support.
100136
101137
1. **Clone** repository:
102138

@@ -144,9 +180,35 @@ To use this repository, you need to meet the following requirements:
144180

145181
<br>
146182

147-
## 🤝 License
183+
## 🤖 Deployment to Staging and Production
184+
185+
This repository utilizes GitHub Actions for continuous deployment to both staging and production servers. Below is a description.
186+
187+
### → Deployment Flow
188+
189+
#### Deployment to Staging
190+
191+
1. **Push to `develop` branch**: Initiates the deployment process to the staging server. Merge PR against `develop` branch, to trigger `deploy-staging.yml`
192+
2. **GitHub Actions**: Executes the `deploy-staging.yml` workflow.
193+
3. **Staging Server**: Receives deployment instructions and acknowledges the deployment.
148194

149-
[![Licence](https://img.shields.io/github/license/wayofdev/laravel-starter-tpl?style=for-the-badge&color=blue)](./LICENSE)
195+
#### Deployment to Production
196+
197+
1. **Merge of `develop` branch into `master`**: Triggers the deployment process to the production server on push event.
198+
2. **GitHub Actions**: Runs the `create-release.yml` workflow.
199+
3. **Release Event**: `deploy-release.yml` waits for the event `release: released`.
200+
4. **GitHub Actions**: Initiates the `deploy-release.yml` workflow.
201+
5. **Production Server**: Receives deployment instructions and acknowledges the deployment.
202+
203+
#### Conditional Deployment Status
204+
205+
* **Deployment Successful**: Both staging and production servers send a success message back to GitHub Actions. Additionally, a success message is sent to the Slack server.
206+
207+
* **Deployment Failed**: If an error occurs, a failure message is sent back to GitHub Actions. Additionally, a failure message is sent to the Slack server.
208+
209+
#### Diagram
210+
211+
![deployments](.github/assets/deployments.png)
150212

151213
<br>
152214

@@ -155,24 +217,49 @@ To use this repository, you need to meet the following requirements:
155217
Useful resources about Laravel and DDD approach:
156218

157219
* [Laravel Beyond CRUD](https://spatie.be/products/laravel-beyond-crud)
158-
* [Laravel Skeleton](https://romanzipp.github.io/Laravel-Skeleton/) by [romanzipp](https://github.com/romanzipp)
159220

160221
<br>
161222

162-
## 🙆🏼‍♂️ Author Information
223+
## 🔒 Security Policy
163224

164-
This repository was created in **2022** by [lotyp / wayofdev](https://github.com/wayofdev).
225+
This project has a [security policy](.github/SECURITY.md).
165226

166227
<br>
167228

168229
## 🙌 Want to Contribute?
169230

170-
Thank you for considering contributing to the wayofdev community!
171-
We are open to all kinds of contributions. If you want to:
231+
Thank you for considering contributing to the wayofdev community! We are open to all kinds of contributions. If you want to:
172232

173-
* 🤔 Suggest a feature
174-
* 🐛 Report an issue
175-
* 📖 Improve documentation
233+
* 🤔 [Suggest a feature](https://github.com/wayofdev/laravel-starter-tpl/issues/new?assignees=&labels=type%3A+enhancement&projects=&template=2-feature-request.yml&title=%5BFeature%5D%3A+)
234+
* 🐛 [Report an issue](https://github.com/wayofdev/laravel-starter-tpl/issues/new?assignees=&labels=type%3A+documentation%2Ctype%3A+maintenance&projects=&template=1-bug-report.yml&title=%5BBug%5D%3A+)
235+
* 📖 [Improve documentation](https://github.com/wayofdev/laravel-starter-tpl/issues/new?assignees=&labels=type%3A+documentation%2Ctype%3A+maintenance&projects=&template=4-docs-bug-report.yml&title=%5BDocs%5D%3A+)
176236
* 👨‍💻 Contribute to the code
177237

238+
You are more than welcome. Before contributing, kindly check our [contribution guidelines](.github/CONTRIBUTING.md).
239+
240+
[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg?style=for-the-badge)](https://conventionalcommits.org)
241+
242+
<br>
243+
244+
## 🫡 Contributors
245+
246+
<p align="left">
247+
<a href="https://github.com/wayofdev/laravel-starter-tpl/graphs/contributors">
248+
<img align="left" src="https://img.shields.io/github/contributors-anon/wayofdev/laravel-starter-tpl?style=for-the-badge" alt="Contributors Badge"/>
249+
</a>
250+
<br>
251+
<br>
252+
</p>
253+
254+
## 🌐 Social Links
255+
256+
* **Twitter:** Follow our organization [@wayofdev](https://twitter.com/intent/follow?screen_name=wayofdev) and the author [@wlotyp](https://twitter.com/intent/follow?screen_name=wlotyp).
257+
* **Discord:** Join our community on [Discord](https://discord.gg/CE3TcCC5vr).
258+
259+
<br>
260+
261+
## ⚖️ License
262+
263+
[![Licence](https://img.shields.io/github/license/wayofdev/laravel-starter-tpl?style=for-the-badge&color=blue)](./LICENSE.md)
264+
178265
<br>

app/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@
127127
"cs:fix": "php-cs-fixer fix -v",
128128
"deptrac": "deptrac analyse --config-file=deptrac.yaml -v --cache-file=.build/.deptrac.cache",
129129
"deptrac:ci": "deptrac analyse --config-file=deptrac.yaml -v --cache-file=.build/.deptrac.cache --formatter github-actions",
130-
"deptrac:gv": "deptrac analyse --config-file=deptrac.yaml -v --cache-file=.build/.deptrac.cache --formatter graphviz-image --output ../assets/deptrac.svg",
130+
"deptrac:gv": "deptrac analyse --config-file=deptrac.yaml -v --cache-file=.build/.deptrac.cache --formatter graphviz-image --output ../.github/assets/deptrac.svg",
131131
"infect": [
132132
"Composer\\Config::disableProcessTimeout",
133133
"@putenv XDEBUG_MODE=coverage",

app/composer.lock

Lines changed: 13 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/logo.gh-dark-mode-only.png

-9.98 KB
Binary file not shown.

assets/logo.gh-light-mode-only.png

-12.4 KB
Binary file not shown.

0 commit comments

Comments
 (0)