diff --git a/README.md b/README.md
index 8ae9d3a3..1fb62a70 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,9 @@
+
+
+
+
+
+
@@ -40,8 +46,9 @@ composer require gacela-project/gacela
- [Basic concepts](docs/001_basic_concepts.md): What are the characteristics of a module?
- [Facade](docs/002_facade.md): The entry point of your module
- [Factory](docs/003_factory.md): The place where you create your domain services and objects
-- [Config](docs/004_config.md): Reads the `config` key-values
+- [Config](docs/004_config.md): Reads the all the files under the `config` folder
- [DependencyProvider](docs/005_dependency_provider.md): It defines the dependencies between modules
+- [Code generator](docs/006_code_generator.md): Some commands out-of-the-box for generating code
### Examples
diff --git a/docs/001_basic_concepts.md b/docs/001_basic_concepts.md
index 3422b06e..8aa029e2 100644
--- a/docs/001_basic_concepts.md
+++ b/docs/001_basic_concepts.md
@@ -37,6 +37,7 @@ You should consider a module as an individual thing in order to decouple it from
charge of reading from the IO (Config) is the only class which is coupled somehow with the infrastructure, but the rest
should be decouple from the outside.
-All the responsibilities that a module handles should remain close and together. The domain of that module should guide its
-design.
+All the responsibilities that a module handles should remain close and together. The domain of that module should guide
+its design.
+[Facade >>](../docs/002_facade.md)
diff --git a/docs/002_facade.md b/docs/002_facade.md
index 76bb5669..30c22333 100644
--- a/docs/002_facade.md
+++ b/docs/002_facade.md
@@ -5,19 +5,19 @@
The Facade is the entry point of your module. See an example:
```php
-# src/Calculator/CalculatorFacadeInterface.php
-interface CalculatorFacadeInterface
+# src/Calculator/FacadeInterface.php
+interface FacadeInterface
{
public function sum(): void;
}
```
```php
-# src/Calculator/CalculatorFacade.php
+# src/Calculator/Facade.php
/**
- * @method CalculatorFactory getFactory()
+ * @method Factory getFactory()
*/
-final class CalculatorFacade extends AbstractFacade implements CalculatorFacadeInterface
+final class Facade extends AbstractFacade implements FacadeInterface
{
public function sum(int ...$numbers): int
{
@@ -31,9 +31,11 @@ final class CalculatorFacade extends AbstractFacade implements CalculatorFacadeI
A Facade is a "ready to use" thing:
```php
-$facade = new CalculatorFacade();
+$facade = new Facade();
$result = $facade->sum(2, 3);
```
-The Facade uses the Factory to create the module's domain instances and executes the desired behaviour from them.
+The Facade uses the Factory to create the module's domain instances and executes the desired behaviour from them.
Nothing less, nothing more.
+
+[<< Basic Concepts](../docs/001_basic_concepts.md) | [Factory >>](../docs/003_factory.md)
diff --git a/docs/003_factory.md b/docs/003_factory.md
index 2b8dd69d..6ef6a3ae 100644
--- a/docs/003_factory.md
+++ b/docs/003_factory.md
@@ -2,15 +2,15 @@
# Factory
-The Factory is the place where you create your domain services and objects.
+The Factory is the place where you create your domain services and objects.
The Facade is the class that can access the Factory.
```php
-# src/Calculator/CalculatorFactory.php
+# src/Calculator/Factory.php
/**
- * @method CalculatorConfig getConfig()
+ * @method Config getConfig()
*/
-final class CalculatorFactory extends AbstractFactory
+final class Factory extends AbstractFactory
{
public function createAdder(): AdderInterface
{
@@ -22,11 +22,11 @@ final class CalculatorFactory extends AbstractFactory
```
```php
-# src/Calculator/CalculatorFacade.php
+# src/Calculator/Facade.php
/**
- * @method CalculatorFactory getFactory()
+ * @method Factory getFactory()
*/
-final class CalculatorFacade extends AbstractFacade implements CalculatorFacadeInterface
+final class Facade extends AbstractFacade implements FacadeInterface
{
public function sum(int ...$numbers): int
{
@@ -36,3 +36,5 @@ final class CalculatorFacade extends AbstractFacade implements CalculatorFacadeI
}
}
```
+
+[<< Facade](../docs/002_facade.md) | [Config >>](../docs/004_config.md)
diff --git a/docs/004_config.md b/docs/004_config.md
index f0b08b55..e419c7e4 100644
--- a/docs/004_config.md
+++ b/docs/004_config.md
@@ -25,16 +25,16 @@ Extra:
```php
# config/default.php
-use src\Calculator\CalculatorConfig;
+use src\Calculator\Config;
return [
- CalculatorConfig::MAX_ADDITIONS => 20,
+ Config::MAX_ADDITIONS => 20,
];
```
```php
-# src/Calculator/CalculatorConfig.php
-final class CalculatorConfig extends AbstractConfig
+# src/Calculator/Config.php
+final class Config extends AbstractConfig
{
public const MAX_ADDITIONS = 'MAX_ADDITIONS';
@@ -46,11 +46,11 @@ final class CalculatorConfig extends AbstractConfig
```
```php
-# src/Calculator/CalculatorFactory.php
+# src/Calculator/Factory.php
/**
- * @method CalculatorConfig getConfig()
+ * @method Config getConfig()
*/
-final class CalculatorFactory extends AbstractFactory
+final class Factory extends AbstractFactory
{
public function createAdder(): AdderInterface
{
@@ -60,3 +60,11 @@ final class CalculatorFactory extends AbstractFactory
}
}
```
+
+Do not forget to define the `$applicationRootDir` in your bootstrap application file.
+
+```php
+\Gacela\Framework\Config::setApplicationRootDir(getcwd());
+```
+
+[<< Factory](../docs/003_factory.md) | [Dependency Provider >>](../docs/005_dependency_provider.md)
diff --git a/docs/005_dependency_provider.md b/docs/005_dependency_provider.md
index 66dae34e..608254aa 100644
--- a/docs/005_dependency_provider.md
+++ b/docs/005_dependency_provider.md
@@ -4,13 +4,12 @@
This is the place where you can define the dependencies that a particular module has with other modules.
-In this example you can see that in the `Calculator` we have a service (`Adder`) which needs the
-`AnotherModuleFacade` as a dependency. In this case, we can define the dependency inside the
-`CalculatorDependencyProvider`.
+In this example you can see that in the `Calculator` we have a service (`Adder`) which needs the `AnotherModuleFacade`
+as a dependency. In this case, we can define the dependency inside the `DependencyProvider`.
```php
-# src/Calculator/CalculatorFactory.php
-final class CalculatorFactory extends AbstractFactory
+# src/Calculator/Factory.php
+final class Factory extends AbstractFactory
{
public function createAdder(): AdderInterface
{
@@ -21,14 +20,14 @@ final class CalculatorFactory extends AbstractFactory
private function getAnotherModuleFacade(): AnotherModuleFacade
{
- return $this->getProvidedDependency(CalculatorDependencyProvider::FACADE_ANOTHER_MODULE);
+ return $this->getProvidedDependency(DependencyProvider::FACADE_ANOTHER_MODULE);
}
}
```
```php
-# src/Calculator/CalculatorDependencyProvider.php
-final class CalculatorDependencyProvider extends AbstractDependencyProvider
+# src/Calculator/DependencyProvider.php
+final class DependencyProvider extends AbstractDependencyProvider
{
public const FACADE_ANOTHER_MODULE = 'FACADE_ANOTHER_MODULE';
@@ -45,3 +44,5 @@ final class CalculatorDependencyProvider extends AbstractDependencyProvider
}
}
```
+
+[<< Config](../docs/004_config.md) | [Code Generator >>](../docs/006_code_generator.md)
diff --git a/docs/006_code_generator.md b/docs/006_code_generator.md
new file mode 100644
index 00000000..48f623ae
--- /dev/null
+++ b/docs/006_code_generator.md
@@ -0,0 +1,18 @@
+[Back to the index](../docs)
+
+# Code Generator
+
+Gacela Framework provides you some commands out-of-the-box to generate a `facade`, `factory`, `config`,
+`dependency provider` or a full `module` with a single command.
+
+- `make:module `: Create a new Facade, Factory, Config, and DependencyProvider
+- `make:facade `: Create a new Facade
+- `make:factory `: Create a new Factory
+- `make:config `: Create a new Config
+- `make:dependency-provider `: Create a new DependencyProvider
+
+
+Example:
+`./vendor/bin/gacela make:module App/TestModule`
+
+[<< Dependency Provider](../docs/005_dependency_provider.md)
diff --git a/docs/README.md b/docs/README.md
index 2fe73f32..4309a450 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -1,9 +1,14 @@
[Back to the homepage](../README.md)
+
+
+
+
## Documentation
- [How to start](001_basic_concepts.md)
- [Facade](002_facade.md): The entry point of your module
- [Factory](003_factory.md): The place where you create your domain services and objects
- - [Config](004_config.md): Reads the `config.php` key-values
+ - [Config](004_config.md): Reads the all the files under the `config` folder
- [DependencyProvider](005_dependency_provider.md): It defines the dependencies between modules
+ - [Code generator](006_code_generator.md): Some commands out-of-the-box for generating code
diff --git a/docs/imgs/gacela-logo.png b/docs/imgs/gacela-logo.png
new file mode 100644
index 00000000..9536bfe7
Binary files /dev/null and b/docs/imgs/gacela-logo.png differ