How truong-hoang112/website works
AnhTraiStore is a Node.js/Express technology-commerce site with customer shopping, administration, realtime support, and an AI shopping assistant. The main customer journey runs from product discovery through cart and coupon handling to order placement and tracking; administrators manage the catalog and order lifecycle. The graph reflects the documented capabilities and sampled entry-point wiring. Individual route internals and some optional integration calls were not sampled, so uncertain links are omitted.
Main entry points: index.js Route registry · database.js MySQL store · app.js Store interface · admin.js Admin operations
Components 26
Web application
- HTTP server
server.js - Express app
src/app.js - Route registry
src/routes/index.js - Page routes
src/routes/pages.js - Store interface
public/js/app.js - Account and profile
src/routes/auth.js
Shopping and orders
- Product catalog
src/routes/products.js - Cart and wishlist
src/routes/cart.js - Wishlist
src/routes/wishlist.js - Coupons
src/routes/coupons.js - Orders and checkout
src/routes/orders.js
Store administration
- Admin operations
src/routes/admin.js - Admin screens
views/admin
Support and AI
- Support messages
src/routes/messages.js - Realtime chat
src/realtime/chat-socket.js - AI chat endpoint
src/routes/ai-chat.js - Store AI
src/services/store-ai.js
Data and integrations
- MySQL store
src/config/database.js - Store schema
database/anhtraistore.sql - Gemini API
- Cloudinary
- Image storage service
src/services/cloud-storage.js - SMTP mail
src/config/mail.js
Other components
- Customer
- Administrator
- Web browser
Connections 39
- Customer → Web browser: uses
- Administrator → Web browser: uses
- Web browser → Express app: HTTP requests
- HTTP server → Express app: creates
- Express app → Route registry: registers routes
- Express app → Page routes: mounts pages
- Route registry → Account and profile: dispatches
- Route registry → Product catalog: dispatches
- Route registry → Cart and wishlist: dispatches
- Route registry → Orders and checkout: dispatches
- Route registry → Wishlist: dispatches
- Route registry → Coupons: dispatches
- Route registry → Admin operations: dispatches
- Route registry → Support messages: dispatches
- Route registry → AI chat endpoint: dispatches
- Page routes → Web browser: serves pages
- Web browser → Store interface: runs
- Store interface → Product catalog: searches products
- Store interface → Cart and wishlist: updates cart
- Store interface → Wishlist: updates wishlist
- Account and profile → MySQL store: reads and writes
- Account and profile → SMTP mail: sends OTP
- Product catalog → MySQL store: reads catalog
- Cart and wishlist → MySQL store: reads and writes
- Wishlist → MySQL store: reads and writes
- Coupons → MySQL store: checks coupons
- Orders and checkout → MySQL store: creates and updates
- Admin operations → MySQL store: manages store data
- Admin operations → Image storage service: uploads images
- Admin operations → Admin screens: serves screens
- Image storage service → Cloudinary: uploads and deletes
- Support messages → MySQL store: stores conversations
- HTTP server → Realtime chat: configures chat
- Realtime chat → MySQL store: checks conversation access
- Realtime chat → Web browser: realtime events
- AI chat endpoint → Store AI: requests assistance
- Store AI → MySQL store: queries store data
- Store AI → Gemini API: calls model
- Store schema → MySQL store: defines schema