|
1 | 1 | ---
|
2 | 2 | sidebar_position: 1
|
3 |
| -title: Porto |
4 |
| -tags: |
5 |
| - - architecture |
6 |
| - - porto |
| 3 | +title: Porto SAP |
7 | 4 | ---
|
8 | 5 |
|
9 |
| -[Porto SAP](https://mahmoudz.github.io/Porto/) is a modern software architectural pattern |
10 |
| -that offers developers a comprehensive set of guidelines, |
11 |
| -principles, and patterns to organize their code in a highly maintainable and reusable way. |
12 |
| -The primary goal of Porto is to help developers create software that is scalable, |
13 |
| -flexible, and easy to maintain over time. [Read more](https://mahmoudz.github.io/Porto/docs/Intro). |
| 6 | +Apiato is built on the [**Porto SAP**](https://mahmoudz.github.io/Porto/) architectural pattern, a design specifically crafted to enhance scalability, maintainability, and reusability. By adopting Porto, Apiato provides a structured, modular way to organize code, which helps developers scale from a simple monolithic setup to complex microservices as the application grows. |
14 | 7 |
|
15 |
| -## Layers |
| 8 | +### What is Porto SAP? |
16 | 9 |
|
17 |
| -Porto's architecture is based on two layers: Containers and Ship. |
| 10 | +Porto SAP (Service Architecture Pattern) is a software architecture designed to bring clarity and structure to large applications. It introduces a well-defined organization for code, divided into two primary layers: |
18 | 11 |
|
19 |
| -### Containers |
20 |
| -The Containers layer encompasses all the application's business logic code and consists of two primary concepts: |
21 |
| -- Section |
22 |
| -- Container |
| 12 | +- **Containers Layer**: Houses the core business logic and functionality, with components grouped into modular, independent sections. |
| 13 | +- **Ship Layer**: Acts as the foundation, holding shared infrastructure, utilities, and configuration files accessible across Containers. |
23 | 14 |
|
24 |
| -#### Section |
25 |
| -A Section refers to a collection of related Containers. |
26 |
| -These Containers can represent various entities such as services |
27 |
| -(either micro or larger in scale) or subsystems within the main system. |
| 15 | +Porto emphasizes modularity and clean separation of concerns, ensuring each part of the application remains maintainable and reusable. |
28 | 16 |
|
29 |
| -:::note |
30 |
| -A Section is not allowed to directly communicate with another Section, except via Events or Commands. |
31 |
| -::: |
| 17 | +### Understanding the Full Porto Architecture |
32 | 18 |
|
33 |
| -#### Container |
34 |
| -A Container represents a cohesive set of related functionalities. |
35 |
| -It can be a specific feature or a wrapper around a RESTful API resource. |
| 19 | +For a thorough understanding of Porto's structure and benefits, it’s recommended to explore the [Porto Documentation](https://mahmoudz.github.io/Porto/docs/Intro/). The documentation covers essential concepts like: |
| 20 | +- **Layers and Components**: A deep dive into the Containers and Ship layers, as well as core components (Routes, Actions, Models, Tasks, and more). |
| 21 | +- **Architectural Principles**: Learn about the foundational principles Porto follows, such as SOLID, Domain-Driven Design (DDD), and MVC, that enhance Apiato's architecture. |
| 22 | +- **Scalability and Maintainability**: Insights into how Porto’s modular approach helps you build applications that can grow and adapt to changing requirements. |
36 | 23 |
|
37 |
| -:::note |
38 |
| -A Container is allowed to depend on other Containers in the same Section. |
39 |
| -::: |
| 24 | +Understanding the Porto architecture is highly recommended for anyone developing with Apiato, as it offers a clear blueprint for creating scalable, manageable applications. |
40 | 25 |
|
41 |
| -### Ship |
42 |
| -The Ship layer contains the infrastructure code, which consists of shared code utilized by all Containers. |
| 26 | +### Layers Diagram |
43 | 27 |
|
44 |
| -## Typical Project Structure |
45 |
| -```markdown |
46 |
| -app |
47 |
| -├── Containers |
48 |
| -│ ├── Section |
49 |
| -│ │ └── Container |
50 |
| -│ │ ├── Actions |
51 |
| -│ │ ├── Configs |
52 |
| -│ │ ├── Data |
53 |
| -│ │ │ ├── Factories |
54 |
| -│ │ │ ├── Migrations |
55 |
| -│ │ │ ├── Repositories |
56 |
| -│ │ │ └── Seeders |
57 |
| -│ │ ├── Mails |
58 |
| -│ │ │ └── Templates |
59 |
| -│ │ ├── Middlewares |
60 |
| -│ │ ├── Models |
61 |
| -│ │ ├── Notifications |
62 |
| -│ │ ├── Providers |
63 |
| -│ │ ├── Tasks |
64 |
| -│ │ ├── Tests |
65 |
| -│ │ ├── Traits |
66 |
| -│ │ └── UI |
67 |
| -│ │ ├── API |
68 |
| -│ │ │ ├── Controllers |
69 |
| -│ │ │ ├── Requests |
70 |
| -│ │ │ ├── Routes |
71 |
| -│ │ │ └── Transformers |
72 |
| -│ │ ├── WEB |
73 |
| -│ │ │ ├── Controllers |
74 |
| -│ │ │ ├── Requests |
75 |
| -│ │ │ ├── Routes |
76 |
| -│ │ │ └── Views |
77 |
| -│ │ └── CLI |
78 |
| -│ │ └── Commands |
79 |
| -│ └── Vendor `// All installed and reusable Containers` |
80 |
| -│ ├── ContainerA |
81 |
| -│ └── ContainerB |
82 |
| -└── Ship `// All shared code between all Containers` |
83 |
| - ├── Broadcasts |
84 |
| - ├── Commands |
85 |
| - ├── Configs |
86 |
| - ├── Contracts |
87 |
| - ├── Criterias |
88 |
| - ├── Events |
89 |
| - ├── Exceptions |
90 |
| - ├── Generators |
91 |
| - ├── Helpers |
92 |
| - ├── Kernels |
93 |
| - ├── Listeners |
94 |
| - ├── Mails |
95 |
| - ├── Middlewares |
96 |
| - ├── Migrations |
97 |
| - ├── Notifications |
98 |
| - ├── Parents |
99 |
| - ├── Providers |
100 |
| - ├── Seeders |
101 |
| - └── Tests |
102 |
| -``` |
103 |
| -## Default Sections |
104 |
| -Apiato ships with two default Sections: |
105 |
| -- **AppSection**: contains all the default Containers. |
106 |
| -- **Vendor**: contains all the installed and reusable Containers. |
| 28 | + <img src="https://raw.githubusercontent.com/Mahmoudz/Porto/refs/heads/master/docs/static/img/diagrams/porto_layers.svg" width="100%" alt="Laradock: Full PHP development environment on Docker." /> |
107 | 29 |
|
108 |
| -:::tip |
109 |
| -The **Vendor** section is a special Section within the Containers layer that holds installed and reusable Containers. |
110 |
| -It serves a similar purpose as the vendor folder located at the root. |
111 |
| -Any Section is permitted to depend on the Vendor Section, allowing for the utilization of its Containers. |
112 | 30 |
|
113 |
| -Read more about the [Container Installer](../pacakges/readme.md) to learn how to install Vendor Containers. |
114 |
| -::: |
| 31 | + |
| 32 | +### Components Diagram |
| 33 | + |
| 34 | + <img src="https://raw.githubusercontent.com/Mahmoudz/Porto/refs/heads/master/docs/static/img/diagrams/porto_container_interactions.svg" width="100%" alt="Laradock: Full PHP development environment on Docker." /> |
0 commit comments