Skip to content

xshopai/customer-ui

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

230 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ›οΈ Customer UI

Modern React e-commerce storefront for the xshopai platform

React TailwindCSS Playwright License

Getting Started β€’ Documentation β€’ Testing β€’ Contributing


🎯 Overview

The Customer UI is the consumer-facing storefront for the xshopai e-commerce platform. Built with React and Tailwind CSS, it delivers a fast, responsive shopping experience including product browsing, cart management, checkout, order tracking, AI-powered chat support, and review submission. All API calls are routed through the Web BFF.


✨ Key Features

πŸ›’ Shopping Experience

  • Product catalog with search & filters
  • Category browsing & trending products
  • Shopping cart with quantity management
  • Complete checkout flow with order tracking

πŸ€– AI-Powered Chat

  • Natural language product search
  • Order inquiry & tracking via chat
  • Conversational shopping assistant
  • Powered by Azure OpenAI (GPT-4o)

πŸ” User Management

  • Registration with email verification
  • JWT-based authentication (cookie)
  • Profile management & address book
  • Order history & review submission

πŸ“± Modern Frontend

  • TailwindCSS responsive design
  • Dark mode support
  • Redux Toolkit + Zustand state
  • TanStack React Query data fetching

πŸš€ Getting Started

Prerequisites

  • Node.js 20+ (LTS)
  • npm 9+
  • Running backend services (Web BFF on port 8014)

Quick Start with Docker

# Clone the repository
git clone https://github.com/xshopai/customer-ui.git
cd customer-ui

# Build and run
docker build -t customer-ui .
docker run -p 3000:80 customer-ui

Local Development Setup

πŸ”§ Development Server
# Install dependencies
npm install

# Set up environment variables
cp .env.example .env
# Edit .env β€” ensure REACT_APP_BFF_URL=http://localhost:8014

# Start development server (hot reload)
npm start

The app will be available at http://localhost:3000.

πŸ“– See Local Development Guide for detailed instructions.

πŸ—οΈ Production Build
# Create optimized production build
npm run build

# Serve with nginx (Docker)
docker build -t customer-ui .
docker run -p 3000:80 customer-ui

The Dockerfile uses multi-stage builds with nginx for production serving.


πŸ“š Documentation

Document Description
πŸ“˜ Local Development Step-by-step local setup and development workflows
☁️ Azure Container Apps Deploy to Azure Container Apps
πŸ—οΈ Architecture Component structure, routing, and state management
πŸ“‹ Product Requirements Feature specifications and user stories
πŸ”§ Prerequisites Detailed prerequisite installation guide

πŸ§ͺ Testing

# Run unit tests
npm test

# Run Playwright E2E tests
npm run test:e2e

# Run E2E tests with UI mode
npm run test:e2e:ui

# Run E2E tests in headed browser
npm run test:e2e:headed

# Lint code
npm run lint

# Format code
npm run format

Test Coverage

Metric Status
Unit Tests βœ… React Testing Library
E2E Tests βœ… Playwright
Linting βœ… ESLint

πŸ—οΈ Project Structure

customer-ui/
β”œβ”€β”€ πŸ“ src/                       # Application source code
β”‚   β”œβ”€β”€ πŸ“ api/                   # API client (Axios β†’ Web BFF)
β”‚   β”œβ”€β”€ πŸ“ components/            # Reusable UI components
β”‚   β”œβ”€β”€ πŸ“ contexts/              # React context providers
β”‚   β”œβ”€β”€ πŸ“ data/                  # Static data and constants
β”‚   β”œβ”€β”€ πŸ“ hooks/                 # Custom React hooks
β”‚   β”œβ”€β”€ πŸ“ pages/                 # Page-level components (routes)
β”‚   β”œβ”€β”€ πŸ“ store/                 # Redux Toolkit + Zustand stores
β”‚   β”œβ”€β”€ πŸ“ telemetry/             # Azure Application Insights
β”‚   └── πŸ“ utils/                 # Helper functions
β”œβ”€β”€ πŸ“ public/                    # Static assets
β”œβ”€β”€ πŸ“ tests/                     # Playwright E2E tests
β”œβ”€β”€ πŸ“ scripts/                   # Build and utility scripts
β”œβ”€β”€ πŸ“ docs/                      # Documentation
β”œβ”€β”€ πŸ“„ Dockerfile                 # Multi-stage build (nginx)
β”œβ”€β”€ πŸ“„ nginx.conf                 # Production nginx configuration
└── πŸ“„ package.json               # Dependencies and scripts

πŸ”§ Technology Stack

Category Technology
βš›οΈ Framework React 18.2 with React Router v6
🎨 Styling TailwindCSS with responsive design & dark mode
πŸ“¦ State Redux Toolkit + Zustand + TanStack React Query
🌐 HTTP Client Axios (all requests via Web BFF)
πŸ§ͺ Testing React Testing Library + Playwright E2E
πŸ“Š Observability Azure Application Insights
🐳 Deployment Docker multi-stage build with nginx

⚑ Quick Reference

# πŸš€ Development
npm start                         # Start dev server (port 3000)
npm run build                     # Production build

# πŸ§ͺ Testing
npm test                          # Unit tests
npm run test:e2e                  # Playwright E2E tests
npm run test:e2e:ui               # E2E with Playwright UI

# πŸ” Code Quality
npm run lint                      # ESLint check
npm run lint:fix                  # Auto-fix lint issues
npm run format                    # Prettier format

# 🐳 Docker
docker build -t customer-ui .
docker run -p 3000:80 customer-ui

🀝 Contributing

We welcome contributions! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch
    git checkout -b feature/amazing-feature
  3. Write tests for your changes
  4. Run the test suite
    npm test && npm run lint
  5. Commit your changes
    git commit -m 'feat: add amazing feature'
  6. Push to your branch
    git push origin feature/amazing-feature
  7. Open a Pull Request

Please ensure your PR:

  • βœ… Passes all existing tests
  • βœ… Includes tests for new functionality
  • βœ… Follows the existing code style
  • βœ… Updates documentation as needed

πŸ†˜ Support

Resource Link
πŸ› Bug Reports GitHub Issues
πŸ“– Documentation docs/
πŸ’¬ Discussions GitHub Discussions

πŸ“„ License

This project is part of the xshopai e-commerce platform. Licensed under the MIT License - see LICENSE for details.


⬆ Back to Top

Made with ❀️ by the xshopai team

About

xshop.ai web application

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages