How liberusoftware/ecommerce-laravel works
Purpose and runtime
Liberu Ecommerce is a Laravel 13/PHP 8.5 commerce platform: server-rendered storefront, Livewire interactions, Filament operations panels, REST and GraphQL interfaces. It supports catalogues, carts, checkout, orders, inventory, payments, shipping, subscriptions, analytics, and merchant tenancy. Primary bootstrap/HTTP entry points are public/index.php, bootstrap/app.php, and artisan.
Request surfaces and access boundary
Web, API, console, broadcast, and social-auth routes are separated in routes/web.php, routes/api.php, routes/console.php, and routes/channels.php. Laravel middleware establishes request security and commerce context, notably channel resolution and team permissions in app/Http/Middleware/ResolveChannel.php and app/Http/Middleware/TeamsPermission.php. Fortify/Jetstream actions and providers implement authentication, profiles, teams, and API-token-related account behavior under app/Actions/Fortify/ and app/Providers/FortifyServiceProvider.php.
Tenant/store/channel model
The core isolation boundary is merchant team plus store/channel context. Persistent entities include app/Models/Team.php, app/Models/Store.php, app/Models/Channel.php, and app/Models/ChannelDomain.php; scoping behavior is centralized by app/Traits/IsStoreScoped.php and app/Traits/IsTenantModel.php. Incoming host/channel resolution selects the operating context before storefront and API work; policies and panel tenancy then constrain resource access.
Commerce transaction flow
Storefront controllers and Livewire components drive product discovery and cart interaction through app/Http/Controllers/Frontend/ProductController.php, app/Livewire/ShoppingCart.php, and app/Services/CartService.php. Checkout funnels through app/Http/Controllers/CheckoutController.php into app/Services/CheckoutService.php, persisting app/Models/Order.php and app/Models/OrderItem.php. This is the main consistency boundary: pricing/promotions, tax, stock, shipping, payment result, and order-state transitions must be evaluated under the resolved store/team context.
Payments, fulfillment, and external callbacks
Payment abstraction is defined by app/Interfaces/PaymentGatewayInterface.php and selected via app/Factories/PaymentGatewayFactory.php; concrete Stripe and PayPal implementations live in app/Services/PaymentGateways/StripeGateway.php and app/Services/PaymentGateways/PayPalGateway.php. Provider webhooks enter through app/Http/Controllers/StripeWebhookController.php and app/Http/Controllers/PaypalWebhookController.php. Shipping uses app/Services/ShippingService.php with carrier adapters such as app/Services/Shipping/EasyPostCarrier.php. Successful dropship orders are deferred to app/Jobs/DispatchDropshippingOrder.php, isolating supplier/DropXL calls from the checkout response.
Back-office, APIs, and asynchronous operations
Two Filament panels expose separate admin and merchant operational surfaces, configured by app/Providers/Filament/AdminPanelProvider.php and app/Providers/Filament/AppPanelProvider.php; resources operate over the same scoped models. REST controllers under app/Http/Controllers/Api/ provide headless management/store functions, while GraphQL is handled by app/Http/Controllers/GraphQLController.php and app/GraphQL/StorefrontSchema.php. Queue-backed outbound webhooks use app/Jobs/DispatchOutboundWebhook.php and app/Jobs/SendWebhookDelivery.php; scheduled maintenance, reporting, recommendation, inventory, and retry work is registered in app/Console/Kernel.php.
Infrastructure and deployment
The application targets MySQL/MariaDB/PostgreSQL with schema ownership in database/migrations/; Redis is provisioned for cache/queues in k8s/redis.yaml, with Horizon and Reverb configuration in config/horizon.php and config/reverb.php. Docker supports PHP-FPM/Nginx plus supervisor workers and scheduler configuration under .docker/; Octane variants support RoadRunner, Swoole, and FrankenPHP under .docker/octane/. Kubernetes deployment, ingress, autoscaling, network policy, and MySQL stateful infrastructure are defined under k8s/.
Components 21
Entry & access
- Laravel bootstrap · Starts HTTP and console application runtimes.
bootstrap/app.php - Route surfaces · Separates web, API, console, broadcast, and social-auth entry routes.
routes/web.php - Commerce access context · Resolves channel and enforces team permissions before commerce work.
app/Http/Middleware/ResolveChannel.php - Accounts & teams · Handles authentication, profiles, teams, and API tokens.
Commerce core
- Merchant store context · Team, store, channel, and domain isolation governs all scoped data.
app/Models/Team.php - Storefront & cart · Serves product discovery and interactive shopping carts.
app/Livewire/ShoppingCart.php - Cart service
app/Services/CartService.php - Checkout service · Coordinates pricing, tax, stock, shipping, payment, and order state.
app/Services/CheckoutService.php - Orders · Persists completed orders and line items.
app/Models/Order.php
Operations & integrations
- Payment gateway layer · Selects Stripe or PayPal behind a common payment interface.
app/Factories/PaymentGatewayFactory.php - Payment webhooks · Receives Stripe and PayPal provider callbacks.
app/Http/Controllers/StripeWebhookController.php - Shipping service · Uses carrier adapters for fulfillment shipping operations.
app/Services/ShippingService.php - Dropship dispatch · Defers supplier and DropXL submission after successful orders.
app/Jobs/DispatchDropshippingOrder.php - Admin & merchant panels · Separate operational surfaces over shared scoped resources.
app/Providers/Filament/AppPanelProvider.php - REST & GraphQL · Provides management, storefront, and GraphQL access.
app/Http/Controllers/GraphQLController.php - Outbound webhook delivery · Dispatches and delivers outbound event notifications.
app/Jobs/DispatchOutboundWebhook.php
Platform runtime
- Scheduled operations · Runs maintenance, reporting, recommendations, inventory, and retries.
app/Console/Kernel.php - Commerce database · Schema migrations own persistent application data.
- Redis queues & cache · Provides queue and cache backing for workers.
k8s/redis.yaml - Queue workers & realtime · Processes queued work and supports realtime broadcasting.
config/horizon.php - Container & Kubernetes deployment · Runs PHP-FPM/Nginx, workers, scheduler, and scalable cluster infrastructure.
Connections 24
- Laravel bootstrap → Route surfaces: loads
- Route surfaces → Commerce access context: web/API requests
- Commerce access context → Accounts & teams: authenticates
- Commerce access context → Merchant store context: resolves channel and team
- Merchant store context → Storefront & cart: scopes
- Storefront & cart → Cart service: cart actions
- Cart service → Checkout service: checkout cart
- Checkout service → Orders: persists
- Checkout service → Payment gateway layer: authorizes payment
- Checkout service → Shipping service: rates and fulfillment
- Payment gateway layer → Payment webhooks: provider callbacks
- Payment webhooks → Checkout service: updates payment state
- Orders → Dropship dispatch: successful dropship order
- Dropship dispatch → Redis queues & cache: queued in
- Admin & merchant panels → Merchant store context: enforces panel tenancy
- REST & GraphQL → Commerce access context: uses request context
- REST & GraphQL → Checkout service: commerce operations
- Outbound webhook delivery → Redis queues & cache: queues deliveries
- Scheduled operations → Redis queues & cache: schedules queued work
- Queue workers & realtime → Redis queues & cache: consumes queues
- Merchant store context → Commerce database: scoped persistence
- Orders → Commerce database: stores
- Container & Kubernetes deployment → Laravel bootstrap: hosts application
- Container & Kubernetes deployment → Queue workers & realtime: runs workers and realtime