Skip to content

Commit b73346b

Browse files
committed
update porto related content
1 parent 8880245 commit b73346b

File tree

4 files changed

+21
-207
lines changed

4 files changed

+21
-207
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Website
22

3-
This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator.
3+
This website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator.
44

55
### Installation
66

Original file line numberDiff line numberDiff line change
@@ -1,114 +1,34 @@
11
---
22
sidebar_position: 1
3-
title: Porto
4-
tags:
5-
- architecture
6-
- porto
3+
title: Porto SAP
74
---
85

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

15-
## Layers
8+
### What is Porto SAP?
169

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:
1811

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

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

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
3218

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

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

41-
### Ship
42-
The Ship layer contains the infrastructure code, which consists of shared code utilized by all Containers.
26+
### Layers Diagram
4327

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." />
10729

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

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." />

versioned_docs/version-12.x/architecture-concepts/request-lifecycle.md

-106
Original file line numberDiff line numberDiff line change
@@ -28,109 +28,3 @@ while the `Action` executes the business logic.
2828
The `Tasks` can be used to execute reusable subsets of the business logic,
2929
with each `Task` responsible for a single portion of the main `Action`.
3030
The `View` or `Transformer` is used to build the response that is sent back to the User.
31-
32-
## Request Lifecycle Diagram
33-
34-
[//]: # "TODO: Update the diagram to reflect the new architecture, specially after adding DTOs. API, Web and CLI can use the same Actions and DTOs, but the Controllers and Requests are different."
35-
36-
#### Legend:
37-
38-
- Solid Line: Mandatory dependency (always used)
39-
- Doted Line: Optional dependency (not always used)
40-
- Red Solid Border: Response generation
41-
- Green Dashed Border: Optional component (not always used)
42-
43-
```mermaid
44-
graph TD
45-
classDef dashedBorder stroke:#0f0,stroke-dasharray: 5 5;
46-
classDef response stroke:red,stroke-width:2px;
47-
subgraph Container
48-
WebRoute[Web Route]
49-
WebMiddleware[Middleware]
50-
WebRequest[\Request/]
51-
WebController{Controller}
52-
WebAction[Action]
53-
54-
CLI[CLI]
55-
Command
56-
CLIAction[Action]
57-
58-
SubAction[SubAction]
59-
60-
APIRoute[API Route]
61-
APIMiddleware[Middleware]
62-
APIRequest[\Request/]
63-
APIController{Controller}
64-
APIAction[Action]
65-
66-
TaskA[Task]
67-
TaskB[Task]
68-
TaskC[Task]
69-
TaskD[Task]
70-
TaskE[Task]
71-
72-
Job[Job]
73-
74-
View[\View\]:::response
75-
Transformer[/Transformer/]:::response
76-
77-
RepositoryA[Repository]
78-
RepositoryB[Repository]
79-
80-
ModelA[Model]
81-
ModelB[Model]
82-
83-
ValueObject[Value Object]
84-
85-
Event[Event]
86-
ListenerA[Listener]
87-
ListenerB[Listener]
88-
end
89-
90-
WebRoute[Web Route]-->WebMiddleware
91-
WebMiddleware-->WebRequest
92-
WebRequest-->WebController
93-
WebController-->View
94-
WebController<-->WebAction
95-
WebAction<-..->TaskA{{Task}}
96-
WebAction<-.->SubAction
97-
98-
APIRoute[API Route]-->APIMiddleware
99-
APIMiddleware-->APIRequest
100-
APIRequest-->APIController
101-
APIController<-->APIAction
102-
APIController-->Transformer
103-
APIAction<-..->TaskD{{Task}}
104-
APIAction<-..->TaskE{{Task}}
105-
APIAction-.->Job:::dashedBorder
106-
107-
CLI[CLI]---->Command[[Command]]
108-
Command-->CLIAction
109-
CLIAction<-.->SubAction:::dashedBorder
110-
CLIAction<-..->TaskD{{Task}}
111-
112-
SubAction<-.->TaskB{{Task}}
113-
SubAction<-.->TaskC{{Task}}
114-
115-
TaskA-.-RepositoryA[(Repository)]:::dashedBorder
116-
TaskB-.-RepositoryA[(Repository)]:::dashedBorder
117-
TaskC-.-RepositoryB[(Repository)]:::dashedBorder
118-
TaskD-.-RepositoryB[(Repository)]:::dashedBorder
119-
120-
RepositoryA-.-ModelA
121-
RepositoryB-.-ModelB
122-
123-
ModelA(((Model)))-.-ValueObject[/ValueObject\]:::dashedBorder
124-
ModelB(((Model)))-.-ValueObject[/ValueObject\]:::dashedBorder
125-
126-
TaskE-.->Event:::dashedBorder
127-
Event-.-ListenerA([Listener]):::dashedBorder
128-
Event-.-ListenerB([Listener]):::dashedBorder
129-
130-
Web--request-->Framework
131-
Mobile--request-->Framework
132-
etc[etc...]--request-->Framework
133-
Framework-->WebRoute((Web Route))
134-
Framework-->CLI((CLI))
135-
Framework-->APIRoute((API Route))
136-
```

versioned_docs/version-12.x/consulting.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
sidebar_position: 9
2+
sidebar_position: 200
33
title: Consulting
44
---
55

0 commit comments

Comments
 (0)