An open API service indexing awesome lists of open source software.

https://github.com/johnyse99/nexus-logistics-core-api

Nexus Logistics Core is a robust, modular API for managing industrial logistics, built with **Symfony 6.4**, **PHP 8.3**, and strictly following **Hexagonal Architecture (Ports & Adapters)** and **CQRS** (Command Query Responsibility Segregation) principles.
https://github.com/johnyse99/nexus-logistics-core-api

api-rest backend cqrs ddd docker doctrine-orm hexagonal-architecture logistics php postgresql redis symfony

Last synced: about 3 hours ago
JSON representation

Nexus Logistics Core is a robust, modular API for managing industrial logistics, built with **Symfony 6.4**, **PHP 8.3**, and strictly following **Hexagonal Architecture (Ports & Adapters)** and **CQRS** (Command Query Responsibility Segregation) principles.

Awesome Lists containing this project

README

          

# Nexus Logistics Core API

## Overview

Nexus Logistics Core is a robust, modular API for managing industrial logistics, built with **Symfony 6.4**, **PHP 8.3**, and strictly following **Hexagonal Architecture (Ports & Adapters)** and **CQRS** (Command Query Responsibility Segregation) principles.

preview

## Features

- **Strict Hexagonal Architecture**: Separation of Domain, Application, and Infrastructure layers.
- **CQRS Pattern**: Distinct Command, Query, and Event buses using Symfony Messenger.
- **Rich Domain Model**: Use of Value Objects (`ShippingId`, `Weight`) and Domain Events.
- **Asynchronous Processing**: Ready for async event handling (e.g., Audit Logging).
- **OpenAPI / Swagger UI**: Fully documented API endpoints.

## Tech Stack

- **Framework**: Symfony 6.4
- **Language**: PHP 8.3
- **Database**: PostgreSQL 16
- **Queue/Cache**: Redis
- **ORM**: Doctrine (with custom Types)
- **Containerization**: Docker & Docker Compose

## Project Structure

```
src/
├── Shipping/
│ ├── Application/ # Use Cases (Commands, Queries, Handlers)
│ ├── Domain/ # Entities, Value Objects, Repository Interfaces
│ └── Infrastructure/ # Controllers, Persistence (Doctrine)
├── shared/ # Shared Kernel (Bus Interfaces, Base Classes)
└── Audit/ # Audit Subdomain (Event Listeners)
```

## Getting Started

### Prerequisites

- Docker & Docker Compose

### Installation

1. **Clone the repository**
2. **Start the containers**:
```bash
docker-compose up -d --build
```
3. **Run Migrations**:
```bash
docker-compose exec app php bin/console doctrine:migrations:migrate
```

### API Documentation

Access the Swagger UI at:
**http://localhost:8000/api/doc**

### Available Endpoints

- `POST /api/v1/shipping/orders`: Create a new shipping order.
- `GET /api/v1/shipping/orders/{id}`: Retrieve order details.
- `POST /api/v1/shipping/orders/{id}/assign`: Assign a carrier to an order.
- `POST /api/v1/shipping/orders/{id}/cancel`: Cancel an order.

## Architecture Highlights

- **Command Bus**: handles state changes (Create, Assign, Cancel).
- **Query Bus**: handles reads (Get Order), returning clean DTOs.
- **Event Bus**: decouples side effects (e.g., Audit Logging listens to `ShippingOrderCreatedEvent` and `ShippingOrderCancelledEvent`).
- **Value Objects**: Validations (e.g., Weight limits, UUID formats) are encapsulated in the domain.

---

📄 **License**
This project is distributed under the MIT license. Its purpose is strictly educational and research-based, developed as an modular API for managing logistics solution.

**Note for recruiters:**
This project demonstrates my ability to design and implement complex systems using professional standards. It highlights my mastery of transactional integrity, clean architecture, and the development of resilient software capable of handling real-world failure scenarios.

**Author:** JUAN S.
**Contact:** https://github.com/johnyse99