A modern, full-stack e-commerce application built with React, Node.js, Express, and SQLite. Features user authentication, product management, shopping cart, wishlist, AI chatbot, email notifications, and comprehensive admin panel.
https://drive.google.com/file/d/1jR6Xc1nId8gCgbNZbhDixFzuBEsPPvvW/view?usp=sharing
- π User Authentication - JWT-based auth with Google OAuth and profile management
- π§ Email Notifications - Automated email system for orders, confirmations, and marketing
- π Shopping Cart - Persistent cart with real-time updates and guest checkout
- β€οΈ Wishlist - Save and manage favorite products with instant sync across devices
- π¦ Order Management - Complete order placement, tracking, and history
- π³ Payment Integration - 4 complete payment methods: Credit Card (Stripe), ShopEase (PayPal), Apple Pay, and Google Pay
- π― AI-Powered Chatbot - Trained AI assistant for customer support and product recommendations
- π Advanced Analytics - Sales tracking, user behavior analytics, and reporting
- π¨ Dynamic UI - Responsive design with animations and modern UX patterns
- π Smart Search - Product search with filtering, sorting, and recommendations
- π Admin Panel - Full admin dashboard at
/adminfor complete store management - π¦ Product Management - Add, edit, delete products with inventory tracking
- π₯ User Management - Customer data, order history, and support management
- π Sales Dashboard - Revenue tracking, popular products, and business insights
- π Home Page - Hero section, featured products, categories, testimonials
- ποΈ Products Page - Advanced filtering, search, sorting, and product grid
- πΈ Sale Page - Dedicated sales section with promotional banners
- π New Arrivals - Latest products with special highlighting
- β€οΈ Wishlist Page - Dedicated page for managing saved items
- π Cart & Checkout - Complete checkout flow with guest and user options
- π€ Profile Management - User profiles, order history, and settings
- π Contact - Contact forms and information
- π Terms of Service - Legal terms and conditions
- π Privacy Policy - Data protection and privacy information
- βΏ Accessibility - Accessibility compliance and features
- πΌ Careers - Job opportunities and company culture
- π° Press - Media kit and press releases
- π Blog - Company blog and articles
- π€ Affiliate Program - Partnership and affiliate opportunities
- πͺ Wholesale - B2B wholesale information
- π¦ Shipping Info - Shipping rates and policies
- β©οΈ Returns & Exchanges - Return policies and procedures
- π Size Guide - Product sizing information
- π Track Order - Order tracking functionality
- π Gift Cards - Digital gift card system
- Node.js (v16+)
- npm
-
Clone & install:
git clone <your-repo-url> cd e-commerce-store npm install cd backend && npm install && cd ..
-
Configure environment:
cd backend cp .env.example .env # Edit .env with your settings (database, email, JWT secrets, etc.)
-
Start servers:
# Terminal 1 - Backend cd backend && npm run dev # Terminal 2 - Frontend npm run dev
-
Open browser:
- App: http://localhost:5173
- Admin: http://localhost:5173/admin
- API: http://localhost:3000
- Node.js (v16+), npm
- Gmail account (for email) or SendGrid/Mailgun
- Google Cloud Console account (for OAuth)
- Stripe account (for payments)
- Clone and install dependencies
- Copy environment template:
cp .env.example backend/.env - Get API keys from services below
- Update
backend/.envwith your real credentials - Start servers:
npm run dev(frontend) +cd backend && npm run dev(backend)
Option 1: Gmail SMTP
- Enable 2-factor authentication on your Gmail account
- Generate app password: https://myaccount.google.com/apppasswords
- Use your Gmail address and the generated app password
Option 2: SendGrid
- Create account: https://sendgrid.com
- Get API key: https://app.sendgrid.com/settings/api_keys
- Verify your domain for custom email addresses
Option 3: Mailgun
- Create account: https://mailgun.com
- Get API key: https://app.mailgun.com/app/domains
- Add your domain for custom email addresses
- Go to Google Cloud Console
- Create new project or select existing one
- Enable Google+ API
- Create OAuth 2.0 credentials (Client ID)
- Add redirect URI:
http://localhost:3000/api/auth/google/callback - Copy Client ID and Client Secret
- Create Stripe account: https://stripe.com
- Go to Stripe Dashboard
- Copy Test Secret Key (starts with
sk_test_) - Copy Test Publishable Key (starts with
pk_test_)
Update backend/.env with your real values:
# Email (choose one method)
[email protected]
SMTP_PASS=your-gmail-app-password
# OR SendGrid
SENDGRID_API_KEY=SG.your_sendgrid_api_key
# Google OAuth
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret
# Stripe
STRIPE_SECRET_KEY=sk_test_your_stripe_secret_key# Terminal 1 - Backend API Server
cd backend && npm run dev
# Terminal 2 - Frontend Development Server
npm run devURLs:
- App: http://localhost:5173
- Admin: http://localhost:5173/admin
- API: http://localhost:3000
Common Issues:
- Email not sending? Check SMTP credentials and app passwords
- OAuth not working? Verify redirect URI matches exactly
- Stripe errors? Ensure you're using test keys, not live keys
- Database errors? Make sure SQLite database file exists
Getting Help:
- Check browser console for frontend errors
- Check terminal for backend errors
- All API endpoints documented in sections below
e-commerce-store/
βββ src/ # React frontend
β βββ components/ # Reusable UI components
β βββ Pages/ # All page components
β βββ context/ # React context providers
β βββ utils/ # Helper functions
βββ backend/ # Node.js/Express backend
β βββ controllers/ # API route handlers
β βββ models/ # Database models
β βββ routes/ # API routes
β βββ middleware/ # Custom middleware
β βββ services/ # Business logic services
βββ scripts/ # Utility scripts (demo admin setup, etc.)
βββ database.sqlite # SQLite database
βββ package.json # Dependencies
POST /api/auth/signup- Start customer signup (email verification)POST /api/auth/signup/verify- Verify email for customer signupPOST /api/auth/signup/complete- Complete signup by setting passwordPOST /api/auth/login- User login with email verification checkPOST /api/auth/google- Google OAuth loginGET /api/auth/profile- Get user profilePUT /api/auth/profile- Update user profile
GET /api/products- Get all productsGET /api/products/:id- Get single productPOST /api/products- Create product (admin)PUT /api/products/:id- Update product (admin)DELETE /api/products/:id- Delete product (admin)
GET /api/cart-items- Get user's cartPOST /api/cart-items- Add item to cartPUT /api/cart-items/:id- Update cart itemDELETE /api/cart-items/:id- Remove from cart
GET /api/wishlist- Get user's wishlistPOST /api/wishlist- Add item to wishlistDELETE /api/wishlist/:id- Remove from wishlist
POST /api/orders- Create new orderGET /api/orders- Get user's ordersGET /api/orders/:id- Get order detailsPUT /api/orders/:id/status- Update order status (admin)
The application now supports 4 complete payment methods with real API integrations:
- Secure card processing with Stripe Elements
- 3D Secure support for enhanced security
- Real-time validation and error handling
- PCI compliant - no card data touches your servers
- PayPal integration with redirect flow
- Secure payment processing through PayPal's API
- Order tracking and confirmation emails
- Guest checkout support for PayPal users
- Native Apple Pay integration using Payment Request API
- Touch ID/Face ID authentication for secure payments
- Token-based processing for maximum security
- Automatic device detection - only shows on supported devices
- Google Pay API integration using Payment Request API
- One-tap checkout with saved payment methods
- Multi-card support (Visa, MasterCard, Amex, Discover)
- Cross-platform compatibility - works on Android and desktop
For testing the Stripe payment integration, use these test cards:
| Card Type | Card Number | Expiry | CVC | Expected Result |
|---|---|---|---|---|
| β Successful | 4242 4242 4242 4242 |
Any future date (e.g., 12/25) | Any 3 digits (e.g., 123) | Payment succeeds |
| β Declined | 4000 0000 0000 0002 |
Any future date | Any 3 digits | Payment declined |
4000 0000 0000 9995 |
Any future date | Any 3 digits | Insufficient funds |
- Safari on iOS/macOS - Apple Pay will appear as an option
- Test on real devices - Requires Touch ID/Face ID setup
- Sandbox environment - Use Apple Pay sandbox for testing
- Chrome/Edge browsers - Google Pay will appear as an option
- Android devices - Native Google Pay integration
- Desktop testing - Works with Google accounts that have payment methods
- Redirects to PayPal - Test the full PayPal payment flow
- Sandbox accounts - Use PayPal developer sandbox for testing
- Guest checkout - Test without requiring user accounts
- Create Stripe account: https://stripe.com
- Get test keys from Stripe Dashboard
- Add to
backend/.env:STRIPE_SECRET_KEY=sk_test_your_stripe_secret_key STRIPE_PUBLISHABLE_KEY=pk_test_your_stripe_publishable_key
- Create PayPal developer account
- Get API credentials from PayPal dashboard
- Configure PayPal endpoints in backend
- Domain Registration - Register your domain with Apple Pay
- Merchant Certificate - Obtain Apple Pay merchant certificate
- Backend Validation - Implement merchant validation endpoint
- Google Pay Console - Register as Google Pay merchant
- Payment Processor - Set up Stripe or other supported processor
- Merchant Configuration - Configure merchant ID and gateway
- Navigate to checkout page in your browser
- Add items to cart and proceed to checkout
- Select different payment methods to test each one:
- Credit Card - Enter test card details
- Apple Pay - Use Touch ID/Face ID (iOS/macOS Safari)
- Google Pay - Use saved payment methods (Chrome/Android)
- PayPal - Complete redirect flow
- Complete the order - should process successfully
- Check backend logs for payment processing confirmation
- Verify order creation in admin panel or user profile
- Go to Stripe Dashboard
- View test payments to confirm transactions
- Check payment status and details
- Apple Pay Dashboard - Monitor transactions and setup
- Domain Verification - Ensure domain is properly registered
- Google Pay Business Console - Monitor transactions
- Integration Status - Verify setup completion
β οΈ Important: Test cards only work in test mode and won't charge real money. For production, use live API keys and real payment methods.
POST /api/subscribe- Newsletter subscriptionPOST /api/contact- Contact form submissions- Email notifications for orders, confirmations, and marketing
GET /api/admin/users- Get all users (admin)GET /api/admin/orders- Get all orders (admin)GET /api/admin/analytics- Sales analytics (admin)GET /api/admin/admins- Get all admin users (admin only)POST /api/admin/admins- Create new admin user (admin only)PUT /api/admin/admins/:id- Update admin user (admin only)DELETE /api/admin/admins/:id- Delete admin user (admin only)
Admin panel available at /admin for complete store management:
- Email:
[email protected] - Password:
Admin123! - Access: Full admin privileges for testing all admin features
Note: For security, change these credentials in production and disable demo accounts.
- User management and support
- Product inventory and categories
- Order processing and tracking
- Sales analytics and reporting
- Email campaign management
- Admin account management (create, edit, delete admins)
- JWT Tokens - Secure, stateless authentication with configurable expiration
- Password Hashing - bcrypt with salt rounds for maximum security
- Role-Based Access Control (RBAC) - Admin vs User permissions
- Google OAuth Integration - Social login with account linking
- Input Validation - Comprehensive validation using Sequelize validators
- SQL Injection Protection - Parameterized queries and ORM usage
- CORS Protection - Configurable cross-origin resource sharing
- Rate Limiting - API endpoint protection (configurable)
- Request Logging - Detailed logging for security monitoring
- Password Requirements - Strong password policies enforced
- Email Verification - Required email confirmation for new accounts
- Session Management - Secure token handling and automatic expiration
- Data Encryption - Sensitive data protection at rest and in transit
- Admin Account Creation - Secure admin account management
- Permission Validation - Role-based route protection
- Audit Logging - Admin action tracking for compliance
- Secure Admin Routes - JWT authentication required for all admin endpoints
- Environment Variables - Sensitive configuration in environment files
- Error Handling - Secure error messages (no sensitive data exposure)
- HTTPS Ready - SSL/TLS configuration ready for production
- Security Headers - Helmet.js integration for additional protection
- Input Sanitization - All user inputs validated and sanitized
- Session Security - Secure token handling with proper expiration
- Password Policies - Strong password requirements enforced
- Audit Logging - Admin actions tracked for compliance monitoring
For testing purposes, you can create a demo admin account:
# Using the admin panel UI (recommended)
1. Start the application
2. Navigate to http://localhost:5173/admin/login
3. Click "Create Admin Account"
4. Enter: [email protected] / Admin123!
# Or using API (if you have admin access)
curl -X POST http://localhost:3000/api/admin/admins \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_ADMIN_TOKEN" \
-d '{
"email": "[email protected]",
"password": "Admin123!",
"firstName": "Demo",
"lastName": "Admin"
}'- Change demo credentials before production deployment
- Demo accounts should be disabled in production environments
- Use strong, unique passwords for production admin accounts
- Enable email verification for production admin accounts
Integrated AI-powered chatbot trained on product catalog and customer service data:
- Product Recommendations - Suggests items based on user preferences
- Customer Support - Answers questions about orders, shipping, returns
- Sales Assistance - Helps users find products and complete purchases
- 24/7 Availability - Always online for instant support
Comprehensive email notification system:
- Order Confirmations - Automatic emails when orders are placed
- Shipping Notifications - Updates when orders ship
- Marketing Emails - Newsletter and promotional campaigns
- Password Reset - Secure password recovery emails
- Contact Forms - Notifications for customer inquiries
- React - Modern React with hooks and context
- JavaScript - ES6+ with modern features
- Tailwind CSS - Utility-first CSS framework
- React Router - Client-side routing
- Axios - HTTP client for API calls
- Node.js - JavaScript runtime
- Express.js - Web application framework
- SQLite - Lightweight database with Sequelize ORM
- JWT - JSON Web Tokens for authentication
- bcrypt - Password hashing
- Nodemailer - Email sending capabilities
- Vite - Fast build tool and dev server
- ESLint - Code linting and formatting
- Prettier - Code formatting
# Build frontend
npm run build
# Backend is ready for deployment as-is
# Deploy to your preferred hosting service- User Authentication - JWT-based with Google OAuth
- Product Management - CRUD operations with admin panel
- Shopping Cart - Persistent with guest checkout
- Wishlist - Save/unsave products with instant sync
- Order System - Complete order lifecycle
- Email Notifications - Automated email system
- AI Chatbot - Trained assistant for customer support
- Admin Dashboard - Complete store management
- Admin Account Management - Create, edit, delete admin users
- Enhanced Security - RBAC, audit logging, secure admin routes
- Responsive Design - Mobile-first approach
- All Footer Pages - Complete site navigation
- Search & Filtering - Advanced product discovery
- Payment Integration - 4 complete payment methods with real API integrations
- Analytics Dashboard - Sales and user metrics
- Password Hashing - bcrypt for secure password storage
- JWT Authentication - Secure token-based authentication
- Role-Based Access Control - Admin vs User permissions with route protection
- Input Validation - Comprehensive validation on all inputs
- CORS Protection - Cross-origin resource sharing configured
- Rate Limiting - API rate limiting to prevent abuse
- SQL Injection Protection - Parameterized queries
- Admin Account Security - Secure admin creation and management
- Audit Logging - Admin action tracking for compliance
- Session Management - Secure token handling and expiration
MIT License - see LICENSE file for details.
- Complete Admin CRUD Operations - Create, read, update, delete admin accounts
- Smart Account Promotion - Automatically promotes regular users to admin when creating admin accounts
- Advanced Error Handling - Clear, actionable error messages for different scenarios
- Audit Logging - Admin actions tracked for compliance and security monitoring
- Role-Based Access Control - Enhanced permissions system with admin-only routes
- Demo Admin Setup Script - Automated creation of demo admin accounts
- Comprehensive API Documentation - Updated with all admin management endpoints
- Enhanced Security Documentation - Detailed security features and best practices
- Production-Ready Security - RBAC, input validation, and secure error handling
- Email Verification Flow - Complete signup process with email verification
- Google OAuth Integration - Seamless social login for customers
- Enhanced Login Security - Email verification required for password-based accounts
- Password Setup Flow - Secure account completion after email verification
- Account Recovery - Email verification for existing accounts
- Admin Account Management - Full CRUD operations for admin users
- User Search & Filtering - Advanced search across admin accounts
- Email Verification Management - Toggle email verification status
- Profile Management - Update admin names, phone numbers, and details
- Secure Authentication - JWT-based admin authentication with role validation
π Demo Admin Access: [email protected] / Admin123!
π Admin Panel: http://localhost:5173/admin
π Documentation: Comprehensive security and API documentation included
Built with β€οΈ using modern web technologies