How danielfv0510/laravel-microservice-products works
Project type and purpose
• This is a microservices-based system composed of three independent services—Products (Laravel/PHP), Orders (Node.js/Express), and Inventory (Node.js/Kafka)—all containerized via Docker Compose.
• Purpose:
• Products service exposes a REST API backed by a MySQL database for CRUD on products.
• Orders service exposes a REST API for order management and publishes order events to Kafka.
• Inventory service consumes order events from Kafka to adjust stock levels and can emit further events.
• Ancillary infrastructure: Nginx reverse-proxy, MySQL, and Apache Kafka broker, all defined in top-level docker and docker-compose.yml.
File structure
• Top-level:
• .github/workflows: CI pipelines for Node.js and PHP.
• docker-compose.yml + docker/: service definitions (MySQL, Nginx, PHP-FPM).
• inventory/, orders/, products/: each subfolder is its own microservice, complete with Dockerfiles, source, configs, tests, and package manifests.
• Pattern:
• Each service follows a clear separation: HTTP entrypoints (controllers/routes) → core/business logic → data layer (DB or event broker) → event routers/dispatchers (Kafka).
• Shared event-driven communication between Orders and Inventory via Kafka topics.
• Products service uses a monolithic MVC pattern (Laravel) with REST endpoints on top of MySQL.
Key insights from README
• Products microservice: Laravel 12, PHP-FPM, MySQL, Nginx reverse proxy, Docker Compose, GitHub Actions CI.
• Orders service: Node.js + Express, in-memory store (planned for MySQL), Kafka producer/consumer, Docker Compose, CI to come.
• Kafka topic “orders” carries events that Inventory consumes.