Coder Social home page Coder Social logo

rumadra / sample-ddd-laravel Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dddendow/sample-ddd-laravel

0.0 0.0 0.0 718 KB

PHP8.1/Laravel8.7でのDDDとモノリポの実験用リポジトリ

License: MIT License

Shell 3.11% PHP 87.47% Blade 8.71% Dockerfile 0.71%

sample-ddd-laravel's Introduction

sample-ddd-laravel

  • PHP/LaravelでのDDDとモノリポの実験用リポジトリ
    • PHP: 8.1
    • Laravel: 8.7

目次

ディレクトリ構成

sample-ddd-laravel
├ delivery-api (Laravel Project) // ControllerやUseCase、その他Laravelの基本的な機能管理用
├ delivery-app (Package)         // ユースケース層(UseCases, QuerySrevice Interface)
├ delivery-docker                // docker関連の設定用
├ delivery-domain (Package)      // ドメイン層(Domain Entity, Repository Interface)
├ delivery-infra (Package)       // インフラ層(RepositoryImpl, QueryServiceImpl, Model, Migration, Seeder)
└ delivery-tools                 // 開発用ツール置き場
  • ECサイトと管理画面のようにAPI自体を分けたい場合はdelivery-ec-api, delivery-cms-apiのようにプロジェクトを増やし、ユースケース層やドメイン層、インフラ層は使い回す。
  • DBに関するものは全てdelivery-infraで完結させている。
    • 特にEloquentはapiやdomainには絶対に漏らさないようにし、Domain Entityのみでやりとりを行っている。

サンプルプロジェクト内容

IPAの情報処理技術者試験のひとつであるデータベーススペシャリストの過去問のうち、2020年の午後Ⅰ 問1を参考にした。
https://www.jitec.ipa.go.jp/1_04hanni_sukiru/mondai_kaitou_2020r02.html

商品を発注してから納品されるまでの一通りの流れを管理する商品配送管理システムとなる。
ただしあくまで今回のスコープは商品に関するドメインなので、ユーザー周りなど一部仕様を簡略化し省いている。

drowioで見たい場合はこちら

システム関連図

システム関連図

ドメインモデル図

ドメインモデル図

ER図

ER図

環境構築

Docker立ち上げ

sh ./delivery-tools/docker-up.sh

DBリセット

sh ./delivery-tools/reset-data.sh

エンドポイント

http://localhost:15280

テスト

sh ./delivery-tools/delivery-api-test.sh
sh ./delivery-tools/delivery-domain-test.sh
sh ./delivery-tools/delivery-infra-test.sh

sample-ddd-laravel's People

Contributors

dddendow 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.