How sam-nisa/project-pp-year4 works
This is a digital-book marketplace with customer shopping, checkout and Bakong QR payment, plus author and admin operations for catalog, sales, balances and payouts. Customers browse and manage carts through the Next.js storefront; the backend API creates orders, coordinates payment, and tracks completed sales. Reviews, messaging, author applications, and administrative management are separate capabilities. The graph focuses on documented request paths and model/service responsibilities; unsampled routes and frontend pages are represented by their enclosing directories, and uncertain connections are omitted.
Main entry points: api.php API routing · OrderController.php Order orchestration · request.js API request client · Book.php Books and genres
Components 32
Customer storefront
- Storefront pages
frontend/app/(user) - Checkout flow
frontend/app/(user)/checkout/page.jsx - Review interface
frontend/app/component/ReviewsSection.jsx - QR payment UI
frontend/app/component/KHQRModal.jsx - Review state
frontend/app/store/useReviewStore.js
Commerce and payments
- Cart API
backend/app/Http/Controllers/CartController.php - Cart records
backend/app/Models/Cart.php - Order orchestration
backend/app/Http/Controllers/OrderController.php - Orders and items
backend/app/Models/Order.php - Discount codes
backend/app/Models/DiscountCode.php - Bakong payment API
backend/app/Http/Controllers/BakongPaymentController.php - Bakong integration
backend/app/Services/BakongPaymentService.php
Accounts and catalog
- Session state
frontend/app/store/authStore.js - Catalog API
backend/app/Http/Controllers/BookController.php - Books and genres
backend/app/Models/Book.php - Review API
backend/app/Http/Controllers/ReviewController.php - Review records
backend/app/Models/Review.php - User accounts
backend/app/Models/User.php
Author and admin operations
- Author workflows
backend/app/Http/Controllers/AuthorDashboardController.php - Author applications
backend/app/Http/Controllers/AuthorRequestController.php - Payout management
backend/app/Http/Controllers/AdminPayoutController.php - Payout processing
backend/app/Services/PayoutService.php - Balances and payouts
backend/app/Models/Payout.php - Messaging
backend/app/Http/Controllers/MessageController.php - Telegram notifications
backend/app/Services/TelegramService.php
Shared platform
- API request client
frontend/app/utils/request.js - API routing
backend/routes/api.php - Image storage
backend/app/Services/ImageKitService.php
Other components
- Customer
- Bakong service
- Telegram API
- ImageKit
Connections 39
- Customer → Storefront pages: browses
- Customer → Checkout flow: checks out
- Storefront pages → API request client: requests data
frontend/app/(user)/checkout/page.jsx - Checkout flow → API request client: submits checkout
frontend/app/(user)/checkout/page.jsx - Checkout flow → QR payment UI: opens QR
frontend/app/(user)/checkout/page.jsx - Session state → API request client: calls API
frontend/app/store/authStore.js - API request client → API routing: sends requests
frontend/app/utils/request.js - API routing → Catalog API: routes catalog
backend/routes/api.php - Catalog API → Books and genres: reads and writes
backend/app/Http/Controllers/BookController.php - API routing → Cart API: routes cart
backend/routes/api.php - Cart API → Cart records: reads and writes
backend/app/Http/Controllers/CartController.php - Cart API → Books and genres: checks books
backend/app/Http/Controllers/CartController.php - API routing → Order orchestration: routes orders
backend/routes/api.php - Order orchestration → Cart records: reads cart
backend/app/Http/Controllers/OrderController.php - Order orchestration → Books and genres: checks inventory
backend/app/Http/Controllers/OrderController.php - Order orchestration → Orders and items: creates orders
backend/app/Http/Controllers/OrderController.php - Order orchestration → Discount codes: records discounts
backend/app/Http/Controllers/OrderController.php - QR payment UI → API request client: checks payment
- API routing → Bakong payment API: routes payments
backend/routes/api.php - Bakong payment API → Bakong integration: generates QR
backend/app/Http/Controllers/BakongPaymentController.php - Bakong integration → Bakong service: requests payment
- Bakong payment API → Order orchestration: finalizes pending order
backend/app/Http/Controllers/BakongPaymentController.php - Review interface → Review state: uses review state
frontend/app/component/ReviewsSection.jsx - Review state → API request client: loads and submits
frontend/app/store/useReviewStore.js - API routing → Review API: routes reviews
backend/routes/api.php - Review API → Books and genres: loads book
backend/app/Http/Controllers/ReviewController.php - Review API → Review records: manages reviews
backend/app/Http/Controllers/ReviewController.php - API routing → Author workflows: routes author tools
backend/routes/api.php - Author workflows → User accounts: loads author data
backend/app/Http/Controllers/AuthorDashboardController.php - Author workflows → Books and genres: reads author books
backend/app/Http/Controllers/AuthorDashboardController.php - API routing → Author applications: routes applications
backend/routes/api.php - Author applications → Image storage: uploads documents
backend/app/Http/Controllers/AuthorRequestController.php - API routing → Payout management: routes payouts
backend/routes/api.php - Payout management → Payout processing: delegates payout
backend/app/Http/Controllers/AdminPayoutController.php - Payout management → Balances and payouts: manages balances
backend/app/Http/Controllers/AdminPayoutController.php - API routing → Messaging: routes messaging
backend/routes/api.php - Order orchestration → Telegram notifications: sends payment alerts
backend/app/Http/Controllers/OrderController.php - Telegram notifications → Telegram API: posts messages
backend/app/Services/TelegramService.php - Image storage → ImageKit: stores images