
Overview
Full-stack e-commerce application equipped with an integrated Gemini AI shopping assistant for real-time product queries. Features catalog filtering, Zustand state management, VNPAY sandbox payment gateway, loyalty rewards program, automated email notifications (Nodemailer/MailHog), and Recharts business analytics.
System Architecture
Modular RESTful backend on Node.js/Express. Dual-token JWT authentication (15m access, 7d refresh) paired with Google OAuth. Socket.IO for real-time order updates, strict payload validation using Zod schemas, and Nginx reverse proxy.
Data & Database
MongoDB document store with Mongoose ODM. Features compound indexing on category/pricing fields and embedded sub-documents for tamper-proof order snapshots and loyalty points transactions.
Key Challenges & Technical Solutions
- 01
1. Real-Time Gemini AI Chatbot Integration & Key Protection:
Built an interactive client-side shopping widget communicating through a secure backend proxy, safeguarding Gemini API credentials while streaming real-time product answers.
- 02
2. VNPAY Payment Gateway & Atomic Stock Integrity:
Integrated VNPAY sandbox with HMAC-SHA512 checksum validation; used atomic MongoDB conditional updates ($inc with quantity checks) to prevent race conditions during peak flash sales.
- 03
3. Multi-Container Orchestration & Automated CI/CD:
Containerized frontend, backend, Nginx, MongoDB, and MailHog via Docker Compose; configured GitHub Actions workflow to automatically test, build, and publish Docker images to Docker Hub.