GithubHelp home page GithubHelp logo

ddd's Introduction

Domain Driven Design [ DDD ]

DDD is a package to support a DDD laravel application with custom artisan commands to generate different Domain Components, such as : Entity, Controller, Request, API Resource, CRUD, etc.

Installation

1- navigate to your project:

cd ./your-project

2- Update your composer.json :

"repositories": [
        ...
        { 
            "name": "mohamedreda/ddd",
            "type": "vcs",
            "url" : "https://github.com/M07amedReda/ddd.git"
        }
],

3- run composer command

$ composer require mohamedreda/ddd

4- Run the following command

$ php artisan ddd:directory

5- Update your .env file and run the following commands

$ php artisan migrate:fresh --seed
$ php artisan passport:install

5- Add the following key/values inside .env file [ Password Grant Type ]

PASSPORT_CLIENT_ID=
PASSPORT_CLIENT_SECRET=

6- Update your database/seeds/DatabaseSeeder.php and user

    $this->call(\App\Domain\User\Database\Seeds\UserTableSeeder::class);

Usage

The package provide 2 commands:

php artisan ddd:directory
npm run watch

This command is used to change the current file-system to suit the DDD principle by create 4 directories inside the App file

  1. Common:
  • Commands
  • Components
  • Exceptions
  • Helpers
  • Http
    • Middelware
    • Kernel.php
    • Livewire
  • Console
    • kernel.php
  • Providers
  • Resources
  • Routes
  • Traits
  1. Domain : Holds the future-domains of the app
  2. Infrastructure:
  • AbstractsProviders
  • AbstractRepositories
  • Commands
  • Contracts
  • Http
    • AbstractControllers
    • AbstractFactories
    • AbstractRequests
    • AbstractResources
  • Scoping
  • Traits

Moreover the command will modify the Kenel namespace in the boostrap/app.php + overwrite the service-providers' namespaces in config/app.php

**The command will also create a backup of the current project file-sytem

php artisan ddd:make {type}

{type} can be :

  • Domain [ file system + serviceProviders ]
  • Component [ blade for laravel 7+ ]
  • Entity
  • Repo
  • Event
  • Listener
  • DatabaseView
  • Resource
  • Datatable
  • Request
  • Rule
  • Migration
  • Factory
  • Seeder
  • Graphql
  • Notification
  • Controller
  • Test
  • Crud [ creates : Entity + DatabaseView + Migration + Factory + Seeder + Views + Datatable + Request + Repo + Resource + Controllers ]
  • Backup
  • Magic [clear cache]

Please note that there are options that may be required in order to create any component and you will be asked throwghout the creation process. Therefore you can run the command above without specify any additional options.

ddd's People

Contributors

aabadawy avatar m07amedreda avatar eslam-adel-github avatar mostafahamedabdelmasoud avatar muhammedredaa avatar

Stargazers

 avatar

Watchers

 avatar  avatar

ddd's Issues

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.