Giter Site home page Giter Site logo

domain-driven-laravel-base's Introduction

Domains drive laravel base

This project is built with Laravel and is used as a base for future projects. It is a simple project that has some simple changes to the default Laravel project.

Pre-requisites

  • Docker
  • Docker-compose

Installation

To make this process easier I recommend using the laravel sail alias. To do this you can add the following alias to your .bashrc or .zshrc file:

alias sail='sh $([ -f sail ] && echo sail || echo vendor/bin/sail)'

Steps to install the project

  1. Clone the repository
  2. Run composer install with this command:
docker run --rm \
   -u "$(id -u):$(id -g)" \
   -v "$(pwd):/var/www/html" \
   -w /var/www/html \
   laravelsail/php83-composer:latest \
   composer install --ignore-platform-reqs
  1. Copy the .env.example file to .env and fill in the necessary information
  2. Start laravel sail with the following command:
sail up -d

# or if you don't have the alias
./vendor/bin/sail up -d
  1. Generate the application key with the following command:
sail artisan key:generate

# or if you don't have the alias
./vendor/bin/sail artisan key:generate
  1. Run the migrations with the following command:
sail artisan migrate

# or if you don't have the alias
./vendor/bin/sail artisan migrate
  1. Run the seeders with the following command:
sail artisan db:seed

# or if you don't have the alias
./vendor/bin/sail artisan db:seed

Building the frontend

  1. Run npm install with the following command:
sail npm install

# or if you don't have the alias
./vendor/bin/sail npm install
  1. Run npm run dev with the following command:
sail npm run dev

# or if you don't have the alias
./vendor/bin/sail npm run dev

Testing

  1. Run the tests with the following command:
sail artisan test

# or if you don't have the alias
./vendor/bin/sail artisan test

Domain Structure

Domains
└── Product
    ├── Console
    │   └── Commands
    │       └── ProductSyncCommand.php
    ├── Events
    ├── Database
    │   ├── Factories
    │   ├── Migrations
    │   └── Seeders
    ├── Exceptions
    ├── Http
    │   ├── Controllers
    │   │   ├── ProductController.php
    │   │   └── ProductDetailController.php
    │   ├── Middleware
    │   └── Requests
    │       └── ProductRequest.php
    ├── Jobs
    │   └── ProductSync.php
    ├── Models
    │   └── Product.php
    ├── Providers
    ├── Repositories
    │   └── ProductRepository.php
    ├── Tests
    │   ├── Feature
    │   │   ├── ProductControllerTest.php
    │   │   └── ProductDetailControllerTest.php
    │   └── Unit
    │       └── ProductRepositoryTest.php
    │   └── Integration
    │       └── ProductSyncTest.php 
    ├── resources
    │   ├── css
    │   ├── js
    │   └── views
    │       └── product // This is the domain name and should be the same as the domain name
    │           └── home.blade.php
    ├── routes
    │   ├── web.php
    │   ├── api.php
    └── Services

domain-driven-laravel-base's People

Contributors

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