Skip to content

Max0709202/e-commerce_conversational_AI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

26 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Intelligent Voice Commerce Platform

Status License Tech Stack

🎯 Project Overview

Intelligent Voice Commerce Platform is an enterprise-grade, AI-powered e-commerce solution that revolutionizes online shopping through natural language voice interactions. As a senior AI engineer, I've architected and developed this full-stack application that seamlessly integrates conversational AI with traditional e-commerce workflows, enabling users to complete entire shopping journeys through voice commands.

This platform demonstrates advanced expertise in:

  • Conversational AI Integration: Seamless voice-to-action mapping using Alan AI SDK
  • Full-Stack Architecture: Scalable React frontend with Node.js/Express RESTful API backend
  • Database Design: MongoDB schema optimization for high-performance order management
  • State Management: Context API implementation for real-time cart synchronization
  • Authentication & Security: JWT-based authentication with bcrypt password hashing
  • Modern UI/UX: Material-UI components with responsive design patterns

πŸ—οΈ Technical Architecture

System Architecture Overview

The platform follows a microservices-oriented architecture with clear separation of concerns:

Frontend Layer (React 17)

  • Component-based architecture with reusable UI components
  • Context API for global state management (CartContext)
  • Custom React hooks for AI integration (useAlan.js)
  • React Router for client-side navigation
  • Axios for HTTP client communication
  • Material-UI for consistent design system

Backend Layer (Node.js/Express)

  • RESTful API design with Express.js
  • MongoDB with Mongoose ODM for data persistence
  • JWT authentication middleware
  • Bcrypt for secure password hashing
  • CORS configuration for cross-origin requests
  • Morgan for HTTP request logging

AI Integration Layer

  • Alan AI SDK for voice command processing
  • Custom event-driven architecture for command handling
  • Natural language understanding for shopping intents
  • Real-time voice feedback system

Data Flow Architecture

The following diagram illustrates the Level 1 Data Flow Diagram (DFD) of the system architecture, showing how data flows between the user interface, AI voice assistant, application logic, and database layers:

Level 1 DFD Diagram - System Architecture

Diagram Explanation: This DFD demonstrates the sophisticated data flow architecture I've designed. The diagram shows:

  • External Entities: Users interact through both the web interface and voice commands
  • Processes: The system handles authentication, order processing, cart management, and AI command interpretation
  • Data Stores: User credentials, product catalog, and order history are managed in MongoDB
  • Data Flows: Arrows indicate bidirectional data exchange between components, ensuring real-time synchronization between voice commands and UI updates

The architecture ensures that voice commands are processed asynchronously and trigger the same backend operations as traditional UI interactions, maintaining data consistency across all interaction channels.


πŸŽ₯ Live Application Demonstration

The following video demonstrates the complete user experience, showcasing the seamless integration of voice commands with the e-commerce interface:

screen-1.webm

Video Walkthrough Explanation: This demonstration highlights several key technical achievements:

  1. Voice Command Recognition: The AI assistant accurately interprets natural language commands such as "add item to cart" and "proceed to checkout"
  2. Real-Time UI Updates: Voice actions instantly reflect in the React UI, demonstrating the event-driven architecture I've implemented
  3. Cart Management: Users can add, remove, and modify items entirely through voice, with immediate visual feedback
  4. Checkout Flow: The complete purchase flow from cart to order confirmation is accessible via voice commands
  5. Error Handling: The system gracefully handles invalid commands and provides helpful voice feedback

The implementation showcases my expertise in building conversational interfaces that feel natural and intuitive while maintaining the reliability of traditional web applications.


πŸš€ Key Technical Features

1. Intelligent Voice Assistant Integration

  • Custom React hook (useAlan.js) for managing Alan AI lifecycle
  • Event-driven command system using CustomEvent API
  • Natural language processing for shopping intents
  • Real-time voice feedback with contextual responses
  • Error handling for invalid voice commands

2. Advanced State Management

  • Context API implementation for global cart state
  • Local storage persistence for cart data
  • Optimistic UI updates for better user experience
  • State synchronization between voice and UI interactions

3. Secure Authentication System

  • JWT-based authentication with token expiration
  • Bcrypt password hashing (10 rounds)
  • Protected routes with middleware validation
  • Secure session management

4. RESTful API Design

  • RESTful endpoints for orders and authentication
  • Request validation and error handling
  • MongoDB aggregation for order queries
  • CORS configuration for secure cross-origin requests

5. Modern Frontend Architecture

  • Component reusability and separation of concerns
  • React Router for client-side routing
  • Material-UI for consistent design system
  • Responsive design patterns
  • Modal components for enhanced UX

6. Database Schema Design

  • Optimized MongoDB schemas for Users and Orders
  • Indexed fields for query performance
  • Embedded documents for order items
  • Timestamp tracking for audit trails

πŸ› οΈ Technology Stack

Frontend

  • React 17.0.1 - UI framework
  • React Router DOM 5.2.1 - Client-side routing
  • Material-UI 4.12.3 - Component library
  • Alan AI SDK 1.8.28 - Voice assistant integration
  • Axios 0.27.2 - HTTP client
  • React Particles.js - Visual effects

Backend

  • Node.js - Runtime environment
  • Express.js 4.17.1 - Web framework
  • MongoDB 6.0.7 - Database (via Mongoose)
  • JWT 8.5.1 - Authentication tokens
  • Bcrypt 5.0.1 - Password hashing
  • Nodemailer 6.6.5 - Email functionality

Development Tools

  • Nodemon - Development server auto-reload
  • Jest - Testing framework
  • React Testing Library - Component testing

πŸ“¦ Installation & Setup

Prerequisites

  • Node.js (v14 or higher)
  • MongoDB (local or cloud instance)
  • Alan AI API key

Frontend Setup

cd client
npm install
npm start

The React application will start on http://localhost:3000

Configuration Required:

  • Set REACT_APP_ALAN_KEY in .env file with your Alan AI API key
  • Configure baseURL in client/src/utils/axios.js to point to your backend server

Backend Setup

cd server
npm install
npm start

The Express server will start on http://localhost:5000 (or configured port)

Configuration Required:

  • Update MongoDB connection string in server/config/default.json
  • Configure JWT secret key in environment variables
  • Set up email service credentials for Nodemailer (if using email features)

🎨 Application Features

User Features

  • Voice-Controlled Shopping: Complete shopping experience through natural language
  • Product Browsing: Browse catalog with visual product cards
  • Cart Management: Add, remove, and modify items via voice or UI
  • User Authentication: Secure registration and login system
  • Order Management: View order history and order details
  • Checkout Process: Streamlined checkout with order confirmation

Voice Commands Supported

  • "Open cart" / "Show my cart"
  • "Close cart"
  • "Add [item name] to cart"
  • "Remove [item name] from cart"
  • "Checkout" / "Proceed to checkout"
  • "Purchase items"

πŸ† Engineering Excellence

This project demonstrates senior-level software engineering practices:

Code Quality

  • Modular component architecture
  • Reusable custom hooks
  • Separation of concerns (UI, business logic, data access)
  • Error boundary implementation
  • Input validation and sanitization

Performance Optimization

  • Efficient state management to minimize re-renders
  • Optimized database queries with proper indexing
  • Lazy loading for components
  • Code splitting capabilities

Security Best Practices

  • Password hashing with bcrypt
  • JWT token-based authentication
  • CORS configuration
  • Input validation on both client and server
  • Secure environment variable management

Scalability Considerations

  • RESTful API design for horizontal scaling
  • Database schema optimized for growth
  • Stateless authentication
  • Microservices-ready architecture

πŸ“ Development Notes

Project Structure

β”œβ”€β”€ client/                 # React frontend application
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/    # Reusable UI components
β”‚   β”‚   β”œβ”€β”€ context/       # React Context providers
β”‚   β”‚   β”œβ”€β”€ hooks/         # Custom React hooks
β”‚   β”‚   └── util/          # Utility functions
β”‚   └── public/            # Static assets
β”‚
└── server/                 # Node.js backend application
    β”œβ”€β”€ controllers/       # Business logic handlers
    β”œβ”€β”€ models/            # MongoDB schemas
    β”œβ”€β”€ routes/            # API route definitions
    └── config/            # Configuration files

Key Implementation Highlights

Voice Integration Architecture: The voice assistant integration uses a custom event-driven pattern where Alan AI commands dispatch CustomEvents that are handled by React event listeners. This decouples the AI layer from the React components, making the system more maintainable and testable.

State Management Pattern: Cart state is managed through React Context API, providing a centralized state that can be accessed by any component. The state is persisted to localStorage, ensuring cart data survives page refreshes.

API Design: The backend follows RESTful principles with clear separation between authentication routes (/auth) and order management routes (/orders). Each controller handles specific business logic, making the codebase modular and easy to extend.


πŸ”’ Security Considerations

  • All passwords are hashed using bcrypt before storage
  • JWT tokens include expiration for enhanced security
  • API endpoints are protected with authentication middleware
  • CORS is configured to allow only trusted origins
  • Input validation prevents injection attacks
  • Environment variables are used for sensitive configuration

πŸ“„ License

This project is licensed under the MIT License.


πŸ™ Acknowledgments

This project showcases advanced full-stack development skills with a focus on AI integration, modern web technologies, and enterprise-grade architecture patterns. The implementation demonstrates expertise in building scalable, maintainable, and user-friendly applications that leverage cutting-edge conversational AI technology.

About

This project is an AI-powered full-stack e-commerce platform that lets users shop using natural voice commands through Alan AI, with a React frontend, Node/Express backend, and MongoDB.

Topics

Resources

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors