Giter VIP home page Giter VIP logo

laravel-starter-tpl's Introduction





Laravel Starter Template

This is an opinionated modified version of the Laravel framework which aims at providing a Domain-Driven Design (DDD) structure.

๐Ÿ“„ About

Laravel is a popular PHP web framework that provides an easy and efficient way to build web applications. However, the default structure of Laravel, coupled with Eloquent's active record pattern, may not always fit the needs of a project that requires a Domain-Driven Design (DDD) architecture. Eloquent's active record pattern breaks DDD principles and make it difficult to separate your business logic from your infrastructure code.

This repository provides a modified file structure for Laravel that follows DDD principles and tries to adhere to best practices, such as those outlined in Spatie's Laravel Beyond CRUD. The goal is to provide a starting point for building Laravel applications using a DDD approach, while still leveraging the power and convenience of the Laravel framework.


๐Ÿ™ If you find this repository useful, consider giving it a โญ๏ธ. Thank you!


๐Ÿš€ Features

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

  • Added:
    • Strict types declaration in all PHP files
    • Style checker package for custom rule-sets to php-cs-fixer โ€” wayofdev/php-cs-fixer-config
    • Static analysis tool โ€” PHPStan and it's extensions:
    • Pest testing framework
    • Github action workflows for:
      • Continuous integration which includes coding standards checks, unit testing and static analysis
      • Automatic pull-request labeling
      • Deployer for automatic deployments to staging and production servers with support of Github Environments
    • ergebnis/composer-normalize composer plugin for normalizing composer.json file
    • roave/securityadvisories package to ensure that application doesn't have installed dependencies with known security vulnerabilities.
    • Application dockerization using docker-compose and Makefile โ€” use make help to view available commands
    • Git pre-commit hooks using pre-commit package
  • Changed:
    • Marked default Laravel classes as final
    • Modified file structure to meet DDD principles
    • Changed config folder files to use default PHP multi-line comment style
  • Removed:
    • Dependencies like Laravel Sanctum, Laravel Pint, and Laravel Sail.
    • Broadcasting service provider and it's routes. It can be added back, if it will be required for project
    • Console routes in favor of Command classes.
    • Sanctum migration files

๐Ÿšฉ Requirements

To use this repository, you need to meet the following requirements:


๐Ÿ’ฟ Installation

Warning: You should configure, set up, and run the docker-shared-services repository to ensure system-wide TLS and DNS support.

  1. Clone repository:

    After forking or creating generating repository from template, you can clone it to your local machine. In this example we will use laravel-starter-tpl repository as starting point.

    $ git clone [email protected]:wayofdev/laravel-starter-tpl.git
  2. Generate .env file

    Generate .env file from .env.example file using Makefile command:

    $ make env \
        APP_NAME=laravel \
        SHARED_SERVICES_NAMESPACE=ss \
        PROJECT_SERVICES_NAMESPACE=wod \
        COMPOSE_PROJECT_NAME=laravel-starter-tpl

    Change generated .env file to match your needs, if needed.

    (Optional): to re-generate .env file, add FORCE=true to the end of command:

    $ make env \
        APP_NAME=laravel \
        SHARED_SERVICES_NAMESPACE=ss \
        PROJECT_SERVICES_NAMESPACE=wod \
        COMPOSE_PROJECT_NAME=laravel-starter-tpl \
        FORCE=true
  3. Build, install and run. This will also generate Laravel app key:

    $ make
    
    # or run commands separately
    $ make hooks
    $ make install
    $ make key
    $ make prepare
    $ make up

๐Ÿค License

Licence


๐Ÿงฑ Credits and Useful Resources

Useful resources about Laravel and DDD approach:


๐Ÿ™†๐Ÿผโ€โ™‚๏ธ Author Information

This repository was created in 2022 by lotyp / wayofdev.


๐Ÿ™Œ Want to Contribute?

Thank you for considering contributing to the wayofdev community! We are open to all kinds of contributions. If you want to:

  • ๐Ÿค” Suggest a feature
  • ๐Ÿ› Report an issue
  • ๐Ÿ“– Improve documentation
  • ๐Ÿ‘จโ€๐Ÿ’ป Contribute to the code

laravel-starter-tpl's People

Contributors

lotyp avatar renovate[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

doytech

laravel-starter-tpl's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Repository problems

These problems occurred while renovating this repository. View logs.

  • WARN: Detected empty commit - aborting git push

Other Branches

These updates are pending. To force PRs open, click the checkbox below.

  • chore(deps): update dependency pestphp/pest-plugin-laravel to v2.3.0
  • chore(deps): update dependency phpunit/phpunit to v10.5.19

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

composer
app/composer.json
  • php ^8.2
  • deployer/deployer ^7.3
  • guzzlehttp/guzzle ^7.7
  • laravel/framework ^10.13
  • laravel/tinker ^2.8
  • sentry/sentry-laravel ^4.0
  • spatie/laravel-fractal ^6.0
  • spatie/laravel-query-builder ^5.2
  • spatie/laravel-route-attributes ^1.18
  • wayofdev/laravel-open-docs ^2.0
  • ergebnis/composer-normalize ^2.31
  • fakerphp/faker ^1.23
  • mockery/mockery ^1.6
  • nunomaduro/collision ^7.5
  • nunomaduro/larastan ^2.6
  • pestphp/pest-plugin-laravel ^2.0
  • phpstan/extension-installer ^1.3
  • phpstan/phpstan-deprecation-rules ^1.1
  • phpunit/phpunit ^10.2
  • spatie/laravel-ignition ^2.1
  • wayofdev/cs-fixer-config ^1.2
docker-compose
docker-compose.yaml
  • wayofdev/php-dev 8.3-fpm-alpine-latest
  • wayofdev/postgres 15-alpine-latest
github-actions
.github/workflows/apply-labels.yml
.github/workflows/auto-merge-release.yaml
.github/workflows/ci.yml
  • actions/checkout v4
  • shivammathur/setup-php v2
  • actions/cache v4
  • actions/cache v4
  • codecov/codecov-action v4
.github/workflows/create-arch-diagram.yml
.github/workflows/create-release.yml
.github/workflows/deploy-release.yml
  • actions/checkout v4
  • shivammathur/setup-php v2
  • actions/cache v4
  • deployphp/action v1
  • getsentry/action-release v1
  • ubuntu 22.04
.github/workflows/deploy-staging.yml
  • actions/checkout v4
  • shivammathur/setup-php v2
  • actions/cache v4
  • deployphp/action v1
.github/workflows/shellcheck.yml
.github/workflows/sync-from-tpl.yml
  • actions/checkout v4
  • AndreasAugustin/actions-template-sync v2.0.2
npm
app/package.json
  • axios ^1.1.2
  • laravel-vite-plugin ^1.0.0
  • vite ^5.0.0
package.json

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.