How cybermaitre/market-square works
This is a Laravel multi-vendor marketplace API. Buyers register, browse public stores and products, manage a cart, and check out into orders; vendors manage a store and products, fulfil vendor orders, and view earnings. The map separates API routing, marketplace operations, and persisted domain state. Source excerpts substantiate checkout, cart, authentication, store management, and vendor-order behavior; other documented or indexed capabilities are included, but their internal steps are not inferred where source detail is unavailable.
Main entry points: api.php API routes · CheckoutService.php Order checkout · User.php Users · Store.php Stores
Components 26
API and access
- API routes
routes/api.php - Authentication
app/Http/Controllers/Api/AuthController.php - Role middleware
app/Http/Middleware/EnsureUserHasRole.php
Stores and catalog
- Public stores
app/Http/Controllers/Api/PublicStoreController.php - Product browsing
app/Http/Controllers/Api/PublicProductController.php - Store management
app/Http/Controllers/Api/StoreController.php - Product management
app/Http/Controllers/Api/ProductController.php
Buyer commerce
- Cart API
app/Http/Controllers/Api/CartController.php - Cart operations
app/Services/CartService.php - Checkout API
app/Http/Controllers/Api/OrderController.php - Order checkout
app/Services/CheckoutService.php - Buyer orders
app/Models/Order.php
Vendor operations
- Vendor order API
app/Http/Controllers/Api/VendorOrderController.php - Order fulfilment
app/Services/VendorOrderService.php - Earnings API
app/Http/Controllers/Api/EarningsController.php - Earnings calculations
app/Services/EarningsService.php
Marketplace state
- Users
app/Models/User.php - Stores
app/Models/Store.php - Products
app/Models/Product.php - Carts and items
app/Models/Cart.php - Order items
app/Models/OrderItem.php - Vendor order state
app/Models/VendorOrder.php - Vendor earnings
app/Models/Earnings.php - Order statuses
app/Enums/OrderStatus.php
Other components
- Buyer
- Vendor
Connections 37
- Buyer → API routes: sends requests
README.md - Vendor → API routes: sends requests
README.md - API routes → Authentication: routes auth
routes/api.php - API routes → Public stores: routes public stores
routes/api.php - API routes → Product browsing: routes product browsing
routes/api.php - API routes → Store management: routes vendor stores
routes/api.php - API routes → Product management: routes vendor products
routes/api.php - API routes → Cart API: routes cart
routes/api.php - API routes → Checkout API: routes orders
routes/api.php - API routes → Vendor order API: routes fulfilment
routes/api.php - API routes → Earnings API: routes earnings
routes/api.php - Authentication → Users: creates and checks
- Authentication → Carts and items: creates buyer cart
- API routes → Role middleware: applies role checks
- Public stores → Stores: reads
app/Http/Controllers/Api/PublicStoreController.php - Product browsing → Products: reads
app/Http/Controllers/Api/PublicProductController.php - Store management → Stores: creates and updates
app/Http/Controllers/Api/StoreController.php - Product management → Products: manages
app/Http/Controllers/Api/ProductController.php - Cart API → Cart operations: calls
app/Http/Controllers/Api/CartController.php - Cart operations → Carts and items: reads and writes
app/Services/CartService.php - Checkout API → Order checkout: calls
app/Http/Controllers/Api/OrderController.php - Order checkout → Carts and items: reads and clears
app/Services/CheckoutService.php - Order checkout → Products: checks stock and decrements
app/Services/CheckoutService.php - Order checkout → Buyer orders: creates order
app/Services/CheckoutService.php - Order checkout → Order items: creates items
app/Services/CheckoutService.php - Order checkout → Vendor order state: creates fulfilment records
app/Services/CheckoutService.php - Vendor order API → Order fulfilment: updates status through
app/Http/Controllers/Api/VendorOrderController.php - Order fulfilment → Vendor order state: updates
app/Services/VendorOrderService.php - Vendor order API → Order statuses: parses status
app/Http/Controllers/Api/VendorOrderController.php - Order fulfilment → Vendor earnings: updates earnings
app/Services/VendorOrderService.php - Earnings API → Earnings calculations: calls
app/Http/Controllers/Api/EarningsController.php - Earnings calculations → Vendor earnings: reads
app/Services/EarningsService.php - Users → Stores: owns
app/Models/User.php - Users → Carts and items: owns
app/Models/User.php - Stores → Products: has products
app/Models/Store.php - Order items → Vendor order state: has fulfilment record
app/Models/VendorOrder.php - Users → Vendor earnings: has earnings
app/Models/User.php