All Projects → samsonasik → ci4-album

samsonasik / ci4-album

Licence: MIT License
🔥 CodeIgniter 4 example Album module uses Domain Driven Design Architecture with Tactical Pattern

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to ci4-album

CodeIgniter4-Cart-Module
A basic port of the CodeIgniter 3 cart library for CodeIgniter 4.
Stars: ✭ 31 (-53.73%)
Mutual labels:  module, codeigniter, codeigniter4
repository
[PHP 7] Implementation and definition of a base Repository in Domain land.
Stars: ✭ 26 (-61.19%)
Mutual labels:  pagination, ddd, domain-driven-design
Plastic
This project provides encapsulation of things like Domain, Application Rules, Business Rules or Business Logic in Application.
Stars: ✭ 30 (-55.22%)
Mutual labels:  ddd, domain-driven-design
delta
DDD-centric event-sourcing library for the JVM
Stars: ✭ 15 (-77.61%)
Mutual labels:  ddd, domain-driven-design
go-hexagonal http api-course
Ejemplos del curso de API HTTP en Go aplicando Arquitectura Hexagonal
Stars: ✭ 78 (+16.42%)
Mutual labels:  ddd, domain-driven-design
DDD
Domain-Driven Design is a software development approach in which it utilizes concepts and good practices related to object-oriented programming.
Stars: ✭ 51 (-23.88%)
Mutual labels:  ddd, domain-driven-design
DDDToolbox
A set of Roslyn refactorings supporting DDD design
Stars: ✭ 31 (-53.73%)
Mutual labels:  ddd, domain-driven-design
maruko
maruko是一个基于dotnetcore的快速开发框架,他实现freesql,automap,模块化,DDD 设计思想等常用性功能.
Stars: ✭ 29 (-56.72%)
Mutual labels:  module, domain-driven-design
clean-ddd-php-poc-contacts
A simple contact manager API to demonstrate the concepts of Clean Architecture and DDD with PHP 7.4+.
Stars: ✭ 31 (-53.73%)
Mutual labels:  ddd, domain-driven-design
Git-API
Gets info from github and transfers into json styled data
Stars: ✭ 18 (-73.13%)
Mutual labels:  query, module
buchu
Use Cases - Uniform, auditable and secure use case library
Stars: ✭ 23 (-65.67%)
Mutual labels:  ddd, domain-driven-design
Clean-Architecture-Template
Configurable Clean Architecture template containing the DDD + CQRS approach for .NET Core applications.
Stars: ✭ 14 (-79.1%)
Mutual labels:  ddd, domain-driven-design
express-mquery
Expose mongoose query API through HTTP request.
Stars: ✭ 37 (-44.78%)
Mutual labels:  pagination, query
teamo-ddd-example
Implementing Domain Driven Design in PHP using Laravel
Stars: ✭ 46 (-31.34%)
Mutual labels:  ddd, domain-driven-design
typescript-ddd-example
🔷🎯 TypeScript DDD Example: Complete project applying Hexagonal Architecture and Domain-Driven Design patterns
Stars: ✭ 607 (+805.97%)
Mutual labels:  ddd, domain-driven-design
MonolithicArchitecture
This repository presents an approach on how to build an application using Monolithic architecture, ASP.NET Core, EntityFrameworkCore, Identity Server, CQRS, DDD
Stars: ✭ 18 (-73.13%)
Mutual labels:  ddd, domain-driven-design
attribute-events
🔥 Fire events on attribute changes of your Eloquent model
Stars: ✭ 198 (+195.52%)
Mutual labels:  ddd, domain-driven-design
educational-platform
Modular Monolith Java application with DDD
Stars: ✭ 124 (+85.07%)
Mutual labels:  ddd, domain-driven-design
eventuous
Minimalistic Event Sourcing library for .NET
Stars: ✭ 236 (+252.24%)
Mutual labels:  ddd, domain-driven-design
tradeio
A disciplined way to purely functional domain models in Scala
Stars: ✭ 19 (-71.64%)
Mutual labels:  ddd, domain-driven-design

Example of CodeIgniter 4 Module : Album Module

Latest Version ci build Mutation testing badge Code Coverage PHPStan Downloads

Feature

Installation

1. Get The Module

a. require via composer

composer require samsonasik/ci4-album

OR

b. manually, by go to app/ThirdParty directory in project root, and clone this repository to the app/ThirdParty directory:

cd app/ThirdParty
git clone [email protected]:samsonasik/ci4-album.git

see https://help.github.com/en/github/authenticating-to-github/error-permission-denied-publickey# for common clone issue troubleshooting.

then register "Album" to App/Config/Autoload.php's psr4 property:

		$psr4 = [
			'App'         => APPPATH,                // To ensure filters, etc still found,
			APP_NAMESPACE => APPPATH,                // For custom namespace
			'Config'      => APPPATH . 'Config',
			'Album'       => APPPATH . 'ThirdParty/ci4-album/src', // <-- add this line
		];

2. Set CI_ENVIRONMENT, base url, index page, and database config in your .env file based on your existing database (If you don't have a .env file, you can copy first from env file: cp env .env first). If the database not exists, create database first.

# .env file
CI_ENVIRONMENT = development

app.baseURL = 'http://localhost:8080'
app.indexPage = ''

database.default.hostname = localhost
database.default.database = ci4_crud
database.default.username = root
database.default.password =
database.default.DBDriver = MySQLi

3. Run db migration

php spark migrate -n Album

4. Run db seed (Optional)

php spark db:seed "Album\Database\Seeds\AlbumSeeder"
php spark db:seed "Album\Database\Seeds\TrackSeeder"

5. Run development server:

php spark serve

6. Open in browser http://localhost:8080/album

Settings

Configure pagination per-page, by copy src/Config/Album.php file into app/Config directory, and modify the namespace to Config:

<?php namespace Config;

use CodeIgniter\Config\BaseConfig;

class Album extends BaseConfig
{
    public $paginationPerPage = 10;
}
// app/Config/Album.php

In above class, the paginationPerPage property's value can be changed.

Testing

On very first run, you need to create database, and migration for testing purpose with set phpunit.xml file from phpunit.xml.dist:

cd /path/to/modules/ci4-album
cp phpunit.xml.dist phpunit.xml

and then configure the phpunit.xml to ensure it has a match db configuration with your local dev environment. If the database not exists, create database first.

	<php>
		<server name="app.baseURL" value="http://localhost:8080"/>
		<const name="HOMEPATH" value="./"/>
		<const name="CONFIGPATH" value="./vendor/codeigniter4/framework/app/Config/"/>
		<const name="PUBLICPATH" value="./vendor/codeigniter4/framework/public/"/>
		<env name="database.tests.hostname" value="localhost"/>
		<env name="database.tests.database" value="ci4_crud_test"/>
		<env name="database.tests.username" value="root"/>
		<env name="database.tests.password" value=""/>
		<env name="database.tests.DBDriver" value="MySQLi"/>
		<env name="database.tests.DBPrefix" value=""/>
	</php>

Ensure that you use different DB for testing.

After it, install the codeigniter and phpunit dependency:

cd /path/to/modules/ci4-album && composer install

Lastly, run the test:

vendor/bin/phpunit

Contributing

Contributions are very welcome. Please read CONTRIBUTING.md

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].