How datcc004/24ct2-cao_xuan_dat works
Motorbike Parts Shop is a customer-facing motorcycle-parts store with staff/admin management. Customers browse and search products, manage a cart, place and track orders, and can review eligible purchases; admins manage catalog, orders, users, settings, and storefront backgrounds. The Express server serves the browser UI and mounts separate API modules, which use a shared MySQL pool. The README documents these capabilities; the main workflow links are limited to relationships visible in the sampled server and route sources.
Main entry points: server.js Express Server · db.js MySQL Pool · ai.js AI Assistant · app.js Shop UI
Components 18
Storefront
- Shop UI
public/js/app.js - Admin UI
public/js/admin.js - AI Assistant
routes/ai.js
Shopping and Orders
- Product Catalog
routes/products.js - Categories
routes/categories.js - Shopping Cart
routes/cart.js - Orders and Payment
routes/orders.js - Coupons
routes/coupons.js - Product Reviews
routes/reviews.js
Store Management
- Admin Operations
routes/admin.js - Shop Settings
routes/settings.js - Background Images
routes/background.js
Platform Services
- Express Server
server.js - Accounts and Auth
routes/auth.js - MySQL Pool
config/db.js
Other components
- Customer
- Staff / Admin
- Gemini API
Connections 29
- Customer → Shop UI: shops through
README.md - Staff / Admin → Admin UI: manages through
README.md - Express Server → Shop UI: serves
server.js - Express Server → Admin UI: serves
server.js - Shop UI → Express Server: calls APIs
- Admin UI → Express Server: calls APIs
- Express Server → Accounts and Auth: mounts routes
server.js - Express Server → Product Catalog: mounts routes
server.js - Express Server → Categories: mounts routes
server.js - Express Server → Shopping Cart: mounts routes
server.js - Express Server → Orders and Payment: mounts routes
server.js - Express Server → Coupons: mounts routes
server.js - Express Server → Product Reviews: mounts routes
server.js - Express Server → AI Assistant: mounts routes
server.js - Express Server → Admin Operations: mounts routes
server.js - Express Server → Shop Settings: mounts routes
server.js - Express Server → Background Images: mounts routes
server.js - Accounts and Auth → MySQL Pool: queries
routes/auth.js - Product Catalog → MySQL Pool: queries
routes/products.js - Categories → MySQL Pool: queries
routes/categories.js - Shopping Cart → MySQL Pool: queries
routes/cart.js - Orders and Payment → MySQL Pool: queries
routes/orders.js - Coupons → MySQL Pool: queries
routes/coupons.js - Product Reviews → MySQL Pool: queries
routes/reviews.js - Admin Operations → MySQL Pool: queries
routes/admin.js - Shop Settings → MySQL Pool: queries
routes/settings.js - Background Images → MySQL Pool: queries
routes/background.js - AI Assistant → MySQL Pool: searches catalog
routes/ai.js - AI Assistant → Gemini API: generates response
routes/ai.js