localheinz / gacela

Gacela helps you separate your project into modules, focusing on the application/infrastructure layer, totally decoupled from your domain.

Home Page:http://gacela-project.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Gacela logo

GitHub Build Status Scrutinizer Code Quality Scrutinizer Code Coverage Psalm Type-coverage Status MIT Software License

Gacela helps you build modular applications

VISION: Simplify the communication of your different modules in your web application.

MISSION: Normalize the entry point of a module, without interfering with your domain-business logic.

Splitting your project into different modules help in terms of maintainability and scalability. It encourages your modules to interact with each other in a unified way by following these rules:

  • The Facade is the entry point of your module, and has direct access to the Factory.
  • The Factory resolves the intra-dependencies of your module's classes, and has access to the Config.
  • The Config has access to the key-values from your config files.
  • The DependencyProvider resolves the extra-dependencies of your module.

Installation

composer require gacela-project/gacela

Module structure

You can prefix gacela classes with the module name to improve readability. See more about gacela.

An example of an application structure using gacela modules:

application-name
├── gacela.php                     # You can customize some behaviours of gacela.
│
├── config
│   ├── default.php
│   └── local.php
│
├── public
│   └── index.php                  # An example of your application entry point.
│
├── src
│   ├── ExampleModuleWithoutPrefix
│   │   ├── Domain                 # The directory structure/naming here is up to you.
│   │   │   └── YourLogicClass.php
│   │   ├── Facade.php             # These are the 4 "gacela classes":
│   │   └── Factory.php            # - You can prefix them with its module name.
│   │   ├── Config.php             # - Autowiring customizable in `gacela.php`.
│   │   └── DependencyProvider.php # - Suffix naming customizable in `gacela.php`.
│   │
│   └── ExampleModuleWithPrefix
│       ├── Domain
│       │   └── YourLogicClass.php
│       ├── ExampleModuleWithPrefixFacade.php
│       └── ExampleModuleWithPrefixFactory.php
│       ├── ExampleModuleWithPrefixConfig.php
│       └── ExampleModuleWithPrefixDependencyProvider.php
│
├── tests
│   └── ...
└── vendor
    └── ...

Documentation

You can check the full documentation in the official website.

Examples

You can see examples using gacela in this repository.

Contribute

You are more than welcome to contribute reporting issues, sharing ideas, or contributing with your Pull Requests.


Inspired by Spryker Framework: https://github.com/spryker

About

Gacela helps you separate your project into modules, focusing on the application/infrastructure layer, totally decoupled from your domain.

http://gacela-project.com/

License:Other


Languages

Language:PHP 99.9%Language:Shell 0.1%