How aandrei1/orderprocess works
orderProcess is a Symfony order-processing backend with a small React UI. The main workflow accepts an order request, reserves product stock, creates and pays the order, persists changes and outbox events atomically, then returns a read-model representation. Listing/detail orders and product catalog reads are separate CQRS-style branches. The README documents outbox messaging, optimistic locking and correlated structured logging; their runtime wiring is not fully sampled, so those connections are shown as unverified where necessary.
Main entry points: PlaceOrderHandler.php Place order · api.ts API client · App.tsx Web app · OrderController.php Order API
Components 29
User interfaces
- Web app
frontend/src/App.tsx - Order form
frontend/src/NewOrder.tsx - Order list UI
frontend/src/OrderList.tsx - API client
frontend/src/api.ts - Order API
src/Orders/UI/Controller/OrderController.php - Product API
src/Orders/UI/Controller/ProductController.php
Application workflows
- Place order
src/Orders/Application/Command/PlaceOrderHandler.php - Order queries
src/Orders/Application/Query - Product query
src/Orders/Application/Query/ListProductsHandler.php - Transaction port
src/Orders/Application/Port/TransactionManager.php - Event dispatch port
src/Orders/Application/Port/DomainEventDispatcher.php - Order read port
src/Orders/Application/Port/OrderReadModel.php - Product read port
src/Orders/Application/Port/ProductReadModel.php
Orders domain
- Order aggregate
src/Orders/Domain/Model/Order.php - Stock product
src/Orders/Domain/Model/Product.php - Order repository port
src/Orders/Domain/Port/OrderRepository.php - Product repository port
src/Orders/Domain/Port/ProductRepository.php - Payment port
src/Orders/Domain/Port/PaymentGateway.php
Infrastructure adapters
- Order persistence
src/Orders/Infrastructure/Persistence/DoctrineOrderRepository.php - Product persistence
src/Orders/Infrastructure/Persistence/DoctrineProductRepository.php - SQL read models
src/Orders/Infrastructure/Persistence/DoctrineOrderReadModel.php - Doctrine transaction
src/Orders/Infrastructure/Persistence/DoctrineTransactionManager.php - Transactional outbox
src/Orders/Infrastructure/Messaging/OutboxDomainEventDispatcher.php - Mock payment
src/Orders/Infrastructure/Messaging/MockPaymentGateway.php - Correlated logging
src/Orders/Infrastructure/Logging
Other components
- Customer
- PostgreSQL
- RabbitMQ
- Log analytics
Connections 35
- Customer → Web app: uses
frontend/src/App.tsx - Web app → Order form: routes to
frontend/src/App.tsx - Web app → Order list UI: routes to
frontend/src/App.tsx - Order form → API client: submits via
frontend/src/NewOrder.tsx - Order list UI → API client: fetches via
frontend/src/OrderList.tsx - API client → Order API: HTTP requests
- API client → Product API: HTTP requests
- Order API → Place order: invokes
src/Orders/UI/Controller/OrderController.php - Order API → Order queries: dispatches queries
src/Orders/UI/Controller/OrderController.php - Product API → Product query: dispatches query
src/Orders/UI/Controller/ProductController.php - Place order → Transaction port: runs transaction
src/Orders/Application/Command/PlaceOrderHandler.php - Place order → Product repository port: loads and saves
src/Orders/Application/Command/PlaceOrderHandler.php - Place order → Stock product: decrements stock
src/Orders/Application/Command/PlaceOrderHandler.php - Place order → Order aggregate: creates and pays
src/Orders/Application/Command/PlaceOrderHandler.php - Place order → Payment port: charges
src/Orders/Application/Command/PlaceOrderHandler.php - Place order → Order repository port: saves order
src/Orders/Application/Command/PlaceOrderHandler.php - Place order → Event dispatch port: dispatches events
src/Orders/Application/Command/PlaceOrderHandler.php - Place order → Correlated logging: logs outcome
src/Orders/Application/Command/PlaceOrderHandler.php - Order aggregate → Order read port: read model adapter
- Order queries → Order read port: queries
src/Orders/Application/Query/ListOrdersHandler.php - Product query → Product read port: queries
src/Orders/Application/Query/ListProductsHandler.php - Order read port → SQL read models: implemented by
src/Orders/Application/Port/OrderReadModel.php - Product read port → SQL read models: implemented by
- Order repository port → Order persistence: implemented by
src/Orders/Infrastructure/Persistence/DoctrineOrderRepository.php - Product repository port → Product persistence: implemented by
src/Orders/Infrastructure/Persistence/DoctrineProductRepository.php - Transaction port → Doctrine transaction: implemented by
src/Orders/Infrastructure/Persistence/DoctrineTransactionManager.php - Event dispatch port → Transactional outbox: implemented by
- Payment port → Mock payment: implemented by
- Order persistence → PostgreSQL: reads and writes
- Product persistence → PostgreSQL: reads and writes
- SQL read models → PostgreSQL: queries
- Doctrine transaction → PostgreSQL: controls transaction
- Transactional outbox → PostgreSQL: writes event rows
- Transactional outbox → RabbitMQ: publishes events
- Correlated logging → Log analytics: ships logs