Giter Site home page Giter Site logo

scafati98 / modular-monolith-laravel Goto Github PK

View Code? Open in Web Editor NEW

This project forked from avosalmon/modular-monolith-laravel

0.0 0.0 0.0 615 KB

Sample application for Laracon Online 2022.

Home Page: https://youtu.be/0Rq-yHAwYjQ?t=4070

Shell 0.87% PHP 97.15% Dockerfile 1.98%

modular-monolith-laravel's Introduction

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"

modular-monolith-laravel's People

Contributors

avosalmon avatar dependabot[bot] avatar

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.