How zhihaogoh/book-havan-bookstore works
This repository pairs a React bookstore storefront with a Laravel REST API. Shoppers browse and search books, inspect details, and use account features, a cart, and a staged checkout; the backend exposes catalog, account, address, cart, wishlist, and order operations. The README describes checkout and account capabilities, while sampled backend code confirms catalog, cart, authentication, and order-item behavior. The frontend-to-API wiring and several unsampled stages are not verified, so those connections are omitted.
Main entry points: App.jsx Page Router · api.php API Routes · CartController.php Cart Operations · OrderItemController.php Order Items
Components 20
Storefront
- Page Router
Bookstore-Front-End/latest/src/App.jsx - Browse Books
Bookstore-Front-End/latest/src/pages/fliter_product/fliter_product.jsx - Book Details
Bookstore-Front-End/latest/src/pages/product_detail/product_detial.jsx
Identity and Profile
- Account Pages
Bookstore-Front-End/latest/src/pages/profile/edit_profile.jsx - Auth Context
Bookstore-Front-End/latest/src/context/AuthContext.jsx - Auth Client
Bookstore-Front-End/latest/src/auth/auth.jsx - User Operations
Bookstore-Back-End/app/Http/Controllers/userController.php - User Records
Bookstore-Back-End/app/Models/User.php
Cart and Orders
- Shopping Cart
Bookstore-Front-End/latest/src/pages/Cart/shopping_cart.jsx - Checkout Steps
Bookstore-Front-End/latest/src/pages/check_out/check_out.jsx - Cart Operations
Bookstore-Back-End/app/Http/Controllers/CartController.php - Order Items
Bookstore-Back-End/app/Http/Controllers/OrderItemController.php - Cart Records
Bookstore-Back-End/app/Models/Cart.php - Order Records
Bookstore-Back-End/app/Models/Orders.php - Order Item Records
Bookstore-Back-End/app/Models/OrderItem.php
REST API
- API Client
Bookstore-Front-End/latest/src/services/api.js - API Routes
Bookstore-Back-End/routes/api.php
Catalog and Records
- Book Operations
Bookstore-Back-End/app/Http/Controllers/BookController.php - Book Records
Bookstore-Back-End/app/Models/Books.php
Other components
- Shopper
Connections 19
- Shopper → Page Router: opens storefront
Bookstore-Front-End/latest/src/App.jsx - Page Router → Browse Books: routes to
Bookstore-Front-End/latest/src/App.jsx - Page Router → Book Details: routes to
Bookstore-Front-End/latest/src/App.jsx - Page Router → Shopping Cart: protects route
Bookstore-Front-End/latest/src/App.jsx - Page Router → Checkout Steps: protects route
Bookstore-Front-End/latest/src/App.jsx - Page Router → Account Pages: protects route
Bookstore-Front-End/latest/src/App.jsx - Page Router → Auth Context: provides auth
Bookstore-Front-End/latest/src/App.jsx - Auth Context → Auth Client: uses
Bookstore-Front-End/latest/src/context/AuthContext.jsx - Auth Client → API Client: calls
Bookstore-Front-End/latest/src/auth/auth.jsx - API Routes → Book Operations: routes requests
Bookstore-Back-End/routes/api.php - API Routes → Cart Operations: routes requests
Bookstore-Back-End/routes/api.php - API Routes → User Operations: routes requests
Bookstore-Back-End/routes/api.php - API Routes → Order Items: routes requests
Bookstore-Back-End/routes/api.php - Book Operations → Book Records: queries and updates
Bookstore-Back-End/app/Http/Controllers/BookController.php - Cart Operations → Cart Records: creates and queries
Bookstore-Back-End/app/Http/Controllers/CartController.php - Cart Operations → Book Records: checks stock
Bookstore-Back-End/app/Http/Controllers/CartController.php - User Operations → User Records: creates and updates
Bookstore-Back-End/app/Http/Controllers/userController.php - Order Items → Order Records: updates totals
Bookstore-Back-End/app/Http/Controllers/OrderItemController.php - Order Items → Order Item Records: creates and deletes
Bookstore-Back-End/app/Http/Controllers/OrderItemController.php