Understand the Prabogo Hexagonal Architecture
masterPrabogo uses a hexagonal architecture (ports and adapters) to ensure a strict separation between core business logic and external infrastructure.
Core Components
- Domain Logic (
internal/domain/): Contains the core business rules. It is technology-agnostic and only interacts with the outside world through Ports. - Ports (
internal/port/): Interfaces that define contracts for communication.- Inbound Ports: How the world talks to your app (e.g., HTTP, CLI, RabbitMQ consumers).
- Outbound Ports: How your app talks to the world (e.g., Databases, HTTP clients, Redis).
- Adapters (
internal/adapter/): Concrete implementations of ports.- Inbound Adapters: Handle incoming requests (e.g., Fiber for HTTP, Temporal for workflows).
- Outbound Adapters: Handle outgoing requests (e.g., Postgres for DB, Redis for cache).
- Models (
internal/model/): Shared data structures and entities used across the application.
Dependency Flow
To maintain decoupling, dependencies must always point inward:
- Domain logic depends on ports (interfaces).
- Adapters implement those ports.
- The application wires the specific adapters to the ports at startup.