How banana1638/coffee-plus works
Coffee Plus is a Laravel coffee-shop ordering system with customer-facing web/API flows and an admin panel. Customers browse products, customize a persistent cart, apply coupons or OZ rewards, choose pickup, and pay by wallet or Stripe; Stripe completion is webhook-driven. The map also preserves wallet/refill, recipes, reviews, referrals, and admin operations documented in the README. Sampled source confirms checkout orchestration and some model relationships; other subsystem links rely on README statements, so unsampled implementation details are not inferred.
Main entry points: Models Commerce records · CheckoutService.php Checkout orchestration · PaymentHandlerFactory.php Payment handlers · Admin Admin operations
Components 22
Customer experience
- Authentication
app/Http/Controllers/API/Auth - Product catalog
app/Http/Controllers/API/ProductController.php - Persistent cart
app/Services/CartService.php - Product reviews
app/Http/Controllers/API/ProductReviewController.php - Shared recipes
app/Http/Controllers/API/SharedRecipeController.php
Ordering and payments
- Checkout orchestration
app/Services/CheckoutService.php - Pricing and rewards
app/Services/PricingService.php - Cart price snapshot
app/Services/CartSnapshotService.php - Payment initiation
app/Http/Controllers/PaymentController.php - Payment handlers
app/Services/Payment/PaymentHandlerFactory.php - Stripe gateway
app/Services/Payment/Gateways/StripeGateway.php - Stripe webhook
app/Http/Controllers/API/StripeWebhookController.php - Tangki wallet
app/Services/TangkiService.php - Wallet ledger
app/Services/LedgerService.php
Domain and engagement
- Order lifecycle
app/Services/OrderStateMachine.php - Commerce records
app/Models - Money representation
app/Support/Money.php - Realtime notifications
app/Services/RealtimeNotificationService.php
Administration
- Admin operations
app/Http/Controllers/Admin - Admin permissions
app/Http/Middleware/AdminPermission.php - Audit logging
app/Services/AuditLogService.php
Other components
- Customer
Connections 27
- Customer → Authentication: registers or logs in
README.md - Customer → Product catalog: browses products
README.md - Customer → Persistent cart: customizes cart
README.md - Persistent cart → Commerce records: persists items
README.md - Customer → Checkout orchestration: places order
README.md - Checkout orchestration → Pricing and rewards: calculates discounts
README.md - Checkout orchestration → Commerce records: creates order and items
app/Services/CheckoutService.php - Checkout orchestration → Order lifecycle: emits order event
app/Services/CheckoutService.php - Customer → Payment initiation: starts checkout payment
README.md - Payment initiation → Cart price snapshot: locks cart prices
app/Http/Controllers/PaymentController.php - Payment initiation → Payment handlers: selects completion handler
app/Http/Controllers/PaymentController.php - Payment handlers → Stripe gateway: initiates Stripe payment
README.md - Stripe gateway → Customer: redirects to checkout
README.md - Stripe gateway → Stripe webhook: sends signed event
README.md - Stripe webhook → Payment handlers: dispatches completion
app/Http/Controllers/API/StripeWebhookController.php - Payment handlers → Checkout orchestration: processes snapshot
- Customer → Tangki wallet: views balance or refills
README.md - Tangki wallet → Wallet ledger: records balance changes
README.md - Customer → Product reviews: submits review
README.md - Product reviews → Commerce records: stores review
app/Http/Controllers/API/ProductReviewController.php - Customer → Shared recipes: shares or imports recipe
README.md - Order lifecycle → Commerce records: tracks order state
README.md - Commerce records → Money representation: converts monetary values
app/Models/Order.php - Stripe webhook → Realtime notifications: notifies payment events
app/Http/Controllers/API/StripeWebhookController.php - Admin operations → Commerce records: manages products and orders
README.md - Admin operations → Admin permissions: checks permissions
README.md - Admin operations → Audit logging: records admin actions
README.md