GithubHelp home page GithubHelp logo

hminhit / ddd-playground Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jorge07/ddd-playground

0.0 1.0 0.0 590 KB

Domain-Driven Design in a PHP project using Symfony

Home Page: https://jorgearco.com/ddd-with-symfony

ApacheConf 1.43% PHP 94.14% HTML 1.96% Gherkin 2.47%

ddd-playground's Introduction

DDD Playground

Wallet API in Symfony following DDD (Domain Driver Design). Still a wip.

Examples in the repo

  • User authentication based in JWT
  • UUID as binary to improve the performance and create a nightmare for the dba.
  • Automated tasks with ant.
  • Dev and CI environments in Docker. Boosting build speed with docker cache layers in pipeline. Orchestrating with Docker Compose.
  • An example of table inheritance and discriminator strategy
  • How to deal with EAV (Entity-Attribute-Value) with Json data type.
  • Code structured in layers as appears in DDD in php book.
  • Test for api in behat accessing via web server (Acceptance tests).
  • Integration test with Lakion api test case and Alice for fixtures and how to integrate it with behat.
  • Command Bus implementation
  • DomainEvents

Tools

This repo its a RESTful API built following more or less DDD and using few useful packages like:

  • ramsey/uuid
  • snc/redis-bundle
  • nelmio/api-doc-bundle
  • friendsofsymfony/rest-bundle
  • white-october/pagerfanta-bundle
  • willdurand/hateoas-bundle
  • jms/serializer-bundle
  • league/tactician-bundle

And for testing proposal:

  • lakion/api-test-case
  • behat/symfony2-extension
  • behat/behat
  • guzzlehttp/guzzle

The folder structure

src
  \
   |\ Application     `Contains the Use Cases of the domain system and the Data Transfer Objects`
   |
   |\ Domain          `The system business logic layer`
   |
   |\ Infrastructure  `Its the implementation of the system outside the model. I.E: Persistence, serialization, etc`
   |
    \ UI              `User Interface. This use to be inside the Infrastructure layer, but I don't like it.`

The tests

The tests follow the same structure and the phpunit tests are tagged with group tags: unit or functional.

The aceptation tests are inside the test UI layer and attack the application from outside using Guzzle.

The Environment

The environment is in PHP7.1 and the development containers are on etc/infrastructure/dev/docker-compose.yml

Run the environment with: docker-compose -f etc/infrastructure/dev/docker-compose.yml up -d

CI/CD

Follow the Jenkinsfile or the gitlab-ci.yml file, it's clear enough and contains a simply workflow to:

  • build the isolated environment
  • docker-compose -p to avoid parallel jobs conflicts
  • provision the environment
  • run the test
  • extract reports
  • Build and store the artifacts (Docker images)
  • Clean the environment

ddd-playground's People

Contributors

1ma avatar jorge07 avatar mablae avatar

Watchers

 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.