Skip to content

xshopai/admin-ui

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

114 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ› οΈ Admin UI

React + TypeScript admin dashboard for managing the xshopai e-commerce platform

React TypeScript TailwindCSS License

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


🎯 Overview

The Admin UI is the back-office dashboard for the xshopai platform, giving administrators full control over users, products, inventory, orders, and reviews. Built with React, TypeScript, and TailwindCSS, it features data-rich tables (TanStack Table), charts (Recharts), and role-based access control. All API calls are routed through the Web BFF.


✨ Key Features

πŸ“Š Dashboard & Analytics

  • Real-time summary stats and KPIs
  • Revenue and order trend charts (Recharts)
  • Growth indicators with color-coded trends
  • Recent activity feed and quick actions

πŸ‘₯ User & Product Management

  • Full CRUD for customer and admin accounts
  • Product catalog creation and editing
  • Inventory stock level tracking
  • Order processing and fulfillment

⭐ Review Moderation

  • Approve, reject, or flag customer reviews
  • Bulk moderation actions
  • Review analytics and sentiment
  • Content policy enforcement

🎨 Modern UI/UX

  • TailwindCSS responsive design
  • Dark mode with system preference detection
  • Accessible HeadlessUI components
  • Mobile-friendly collapsible sidebar

πŸš€ 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/admin-ui.git
cd admin-ui

# Build and run
docker build -t admin-ui .
docker run -p 3001:80 admin-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 run dev

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

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

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

# Serve with nginx (Docker)
docker build -t admin-ui .
docker run -p 3001:80 admin-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

πŸ§ͺ Testing

# Run unit tests
npm test

# Lint code
npm run lint

# Auto-fix lint issues
npm run lint:fix

# Format code
npm run format

Test Coverage

Metric Status
Unit Tests βœ… React Testing Library
Linting βœ… ESLint
Formatting βœ… Prettier

πŸ—οΈ Project Structure

admin-ui/
β”œβ”€β”€ πŸ“ src/                       # Application source code
β”‚   β”œβ”€β”€ πŸ“ components/            # Reusable UI components
β”‚   β”œβ”€β”€ πŸ“ contexts/              # React context providers
β”‚   β”œβ”€β”€ πŸ“ pages/                 # Page-level components (routes)
β”‚   β”œβ”€β”€ πŸ“ services/              # API client layer
β”‚   β”œβ”€β”€ πŸ“ store/                 # Redux Toolkit + Zustand stores
β”‚   β”œβ”€β”€ πŸ“ telemetry/             # Azure Application Insights
β”‚   β”œβ”€β”€ πŸ“ types/                 # TypeScript type definitions
β”‚   └── πŸ“ utils/                 # Helper functions
β”œβ”€β”€ πŸ“ public/                    # Static assets
β”œβ”€β”€ πŸ“ tests/                     # Test suite
β”œβ”€β”€ πŸ“ scripts/                   # Build and utility scripts
β”œβ”€β”€ πŸ“ docs/                      # Documentation
β”œβ”€β”€ πŸ“„ Dockerfile                 # Multi-stage build (nginx)
β”œβ”€β”€ πŸ“„ nginx.conf                 # Production nginx configuration
β”œβ”€β”€ πŸ“„ config-overrides.js        # CRA config overrides
└── πŸ“„ package.json               # Dependencies and scripts

πŸ”§ Technology Stack

Category Technology
βš›οΈ Framework React 18.2 + TypeScript
🎨 Styling TailwindCSS + HeadlessUI components
πŸ“¦ State Redux Toolkit + Zustand + TanStack React Query
πŸ“Š Charts Recharts for analytics dashboards
πŸ“‹ Tables TanStack Table for data-rich management views
🌐 HTTP Client Axios (all requests via Web BFF)
πŸ“Š Observability Azure Application Insights
🐳 Deployment Docker multi-stage build with nginx

⚑ Quick Reference

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

# πŸ§ͺ Testing
npm test                          # Unit tests

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

# 🐳 Docker
docker build -t admin-ui .
docker run -p 3001:80 admin-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

Web UI for admin users

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors