How dev-adeshina/fiel works
Purpose and Entry Points
A Laravel restaurant operations backend: public/customer APIs cover authentication, menus, carts, checkout, payments, and reservations; staff operate a Filament admin panel for menus, kitchen orders, inventory, tables, reporting, and analytics. HTTP enters through public/index.php, API route aggregates in routes/api.php and routes/api/v1/*.php, and CLI work through artisan.
Application Shape and Boundaries
Business logic is organized as bounded domains under app/Domains, rather than controller-centric code. Controllers validate request data, invoke domain Actions, and return API Resources. Actions coordinate Services, Repositories, Eloquent Models, and DTOs; this establishes the primary HTTP-to-domain-to-persistence boundary. Examples: app/Http/Controllers/Order/CheckoutController.php, app/Domains/Order/Actions/CheckoutAction.php, app/Domains/Order/Repositories/OrderRepository.php.
Identity and Authorization
The Auth domain owns user lifecycle: registration, login/logout, password recovery/change, email verification, account deletion, and related events/notifications. Sanctum configuration indicates token-based API authentication; permissions/roles are persisted and enforced by policies. Key paths: app/Domains/Auth/Services/AuthService.php, app/Domains/Auth/Models/User.php, config/sanctum.php.
Catalog, Cart, and Checkout
Menu management models menus, categories, items, variants, modifiers, and time/availability records. Customers add configured items to persistent carts; cart calculation precedes checkout. Checkout produces orders and order items, with status/payment-status state models and a separate inventory integration boundary. Key paths: app/Domains/Menu/Services/MenuItemService.php, app/Domains/Cart/Services/CartCalculationService.php, app/Domains/Order/Services/OrderInventoryService.php.
Payments and External Provider Boundary
Payments are provider-agnostic behind PaymentGatewayInterface and selected by PaymentGatewayManager. Supported gateway implementations include Stripe (card, Apple Pay, Google Pay), Paystack, PayPal, and Flutterwave. Initialization, verification, cancellation, refund, and provider callbacks are modeled separately; inbound webhooks are a critical trust boundary. Key paths: app/Domains/Payment/GatewayInterfaces/PaymentGatewayInterface.php, app/Domains/Payment/Manages/PaymentGatewayManager.php, app/Domains/Payment/Webhooks/StripeWebhookHandler.php.
Restaurant Operations
Inventory records items and movements, with explicit stock-adjustment actions and analytics. Reservations allocate restaurant tables, detect conflicts, and transition statuses; scheduled expiry processing runs from a console command. Kitchen-facing order endpoints/pages support operational status flow. Key paths: app/Domains/Inventory/Actions/AdjustInventoryStockAction.php, app/Domains/Reservation/Services/TableAssignmentService.php, app/Console/Commands/ProcessReservationExpiry.php.
Administration, Data, and Runtime
Filament is the staff UI and directly exposes domain-backed resources plus dashboards for kitchen, sales, inventory, and reservation analytics. Relational persistence is managed through Laravel migrations for users, catalog, carts, orders, payments, inventory, and reservations. Runtime infrastructure is Laravel/PHP with database, cache, queue, mail, filesystem, and payment/service settings configurable under config/; Vite supplies frontend assets. Key paths: app/Providers/Filament/AdminPanelProvider.php, app/Filament/Pages/KitchenDashboard.php, database/migrations/2026_05_14_233653_create_orders_table.php.
Main entry points: CheckoutAction.php Checkout action · AdminPanelProvider.php Filament admin panel · OrderRepository.php Order repository · PaymentGatewayManager.php Payment gateway manager
Components 20
Entry & Interfaces
- Laravel HTTP entry
public/index.php - Customer API routes
routes/api.php - Versioned API routes
- Checkout controller · Validates checkout requests and returns API resources.
app/Http/Controllers/Order/CheckoutController.php
Domain Layer
Actions and services coordinate restaurant workflows.
- Auth domain · Owns account lifecycle and token-authenticated access.
app/Domains/Auth/Services/AuthService.php - Menu domain · Manages menus, items, variants, modifiers, and availability.
app/Domains/Menu/Services/MenuItemService.php - Cart calculation · Calculates persistent configured carts before checkout.
app/Domains/Cart/Services/CartCalculationService.php - Checkout action · Coordinates order creation, payment, and stock integration.
app/Domains/Order/Actions/CheckoutAction.php - Order repository
app/Domains/Order/Repositories/OrderRepository.php - Order inventory service
app/Domains/Order/Services/OrderInventoryService.php
Payments
Provider-agnostic payment boundary.
- Payment gateway manager · Selects a provider implementation through a common contract.
app/Domains/Payment/Manages/PaymentGatewayManager.php - Payment gateway contract · Defines initialization, verification, cancellation, and refund operations.
app/Domains/Payment/GatewayInterfaces/PaymentGatewayInterface.php - Stripe webhook handler · Trust boundary for provider callbacks.
app/Domains/Payment/Webhooks/StripeWebhookHandler.php
Staff Operations
- Filament admin panel · Exposes domain-backed management resources and dashboards.
app/Providers/Filament/AdminPanelProvider.php - Kitchen dashboard · Supports kitchen order operations.
app/Filament/Pages/KitchenDashboard.php - Inventory adjustment · Records stock adjustments and movements.
app/Domains/Inventory/Actions/AdjustInventoryStockAction.php - Table assignment · Allocates tables and detects reservation conflicts.
app/Domains/Reservation/Services/TableAssignmentService.php - Reservation expiry command
app/Console/Commands/ProcessReservationExpiry.php
Persistence & Runtime
- Relational database · Stores users, catalog, carts, orders, payments, inventory, and reservations.
database/migrations/2026_05_14_233653_create_orders_table.php - Sanctum tokens
config/sanctum.php
Connections 22
- Laravel HTTP entry → Customer API routes: dispatches
- Customer API routes → Versioned API routes: aggregates
- Versioned API routes → Checkout controller: routes checkout
- Checkout controller → Checkout action: invokes
- Auth domain → Sanctum tokens: uses
- Menu domain → Cart calculation: configured items
- Cart calculation → Checkout action: priced cart
- Checkout action → Order repository: creates order
- Checkout action → Payment gateway manager: initiates payment
- Checkout action → Order inventory service: updates stock
- Payment gateway manager → Payment gateway contract: implements contract
- Stripe webhook handler → Payment gateway manager: verifies callback
- Order repository → Relational database: persists
- Order inventory service → Inventory adjustment: adjusts stock
- Inventory adjustment → Relational database: records movements
- Table assignment → Relational database: reads tables and reservations
- Reservation expiry command → Table assignment: expires reservations
- Filament admin panel → Kitchen dashboard: hosts
- Filament admin panel → Menu domain: manages catalog
- Filament admin panel → Inventory adjustment: manages inventory
- Filament admin panel → Table assignment: manages reservations
- Kitchen dashboard → Order repository: operates order status