How mavs07082022/ecommerce-core works
This repository is a PHP e-commerce application with customer shopping, ordering and delivery, staff operations, and AI-assisted product discovery. The primary customer flow is browsing products, managing a cart, checking out and paying, then tracking delivery and optionally reviewing or returning an order. Staff manage catalog, orders, riders, returns, chat and reporting; customers also register and verify accounts. The map includes documented subsystems from the tree, but only sampled source establishes the specific checkout, AI, and reporting links shown; other unsampled wiring is omitted.
Main entry points: db.php Application database · register.php Register & OTP · ai_query.php Recommendations · ai_semantic_search.php Semantic search
Components 29
Identity
- Register & OTP
auth/register.php - Verify OTP
auth/verify_otp.php - Staff login
admin/login.php - Session & roles
includes/auth.php
Shopping & Orders
- Shop & products
modules/shop.php - Product details
modules/product_detail.php - Cart endpoints
api/cart_add.php - Checkout
api/checkout.php - Payment verification
api/verify_payment.php - Order history
modules/my_orders.php - Order reviews
modules/order_review.php
Fulfillment & Support
- Order tracking
modules/track_order.php - Delivery operations
modules/deliveries.php - Rider delivery
rider_delivery.php - Customer chat
modules/chat.php - Chat endpoints
api/chat_send.php - Returns
modules/returns.php
Staff Operations
- Catalog & orders
modules/products.php - Reports
modules/reports.php - Report data
api/reports_data.php
AI Discovery
- Recommendations
api/ai_query.php - Semantic search
api/ai_semantic_search.php - AI service
ai/cohere_service.php
Other components
- Customer
- Admin / staff
- Rider
- Application database
config/db.php - Cohere API
- Mail provider
config/mailer.php
Connections 40
- Customer → Register & OTP: registers
- Register & OTP → Application database: stores account / OTP
- Customer → Verify OTP: submits code
- Verify OTP → Application database: checks OTP
- Register & OTP → Mail provider: sends verification
- Admin / staff → Staff login: signs in
- Staff login → Session & roles: checks role
- Customer → Shop & products: browses
- Shop & products → Application database: reads catalog
- Customer → Product details: opens product
- Customer → Cart endpoints: updates cart
- Cart endpoints → Application database: updates cart state
- Customer → Checkout: places order
- Checkout → Application database: creates order
- Customer → Payment verification: confirms payment
- Payment verification → Application database: updates payment
- Customer → Order history: views orders
- Order history → Application database: reads orders
- Customer → Order tracking: tracks shipment
- Order tracking → Application database: reads status
- Admin / staff → Catalog & orders: manages catalog / orders
- Catalog & orders → Application database: updates records
- Admin / staff → Delivery operations: manages deliveries
- Delivery operations → Application database: updates delivery
- Rider → Rider delivery: updates delivery
- Rider delivery → Application database: stores progress
- Customer → Customer chat: requests support
- Customer chat → Chat endpoints: sends messages
- Chat endpoints → Application database: stores messages
- Customer → Returns: requests return
- Admin / staff → Returns: handles return
- Admin / staff → Reports: views analytics
- Reports → Report data: fetches metrics
- Report data → Application database: queries data
- Customer → Recommendations: asks for recommendations
- Recommendations → Application database: loads products
- Recommendations → AI service: requests chat
- Customer → Semantic search: searches by meaning
- Semantic search → AI service: requests ranking
- Semantic search → Application database: searches products