React + TypeScript admin dashboard for managing the xshopai e-commerce platform
Getting Started β’ Documentation β’ Testing β’ Contributing
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.
|
|
|
|
- Node.js 20+ (LTS)
- npm 9+
- Running backend services (Web BFF on port 8014)
# 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π§ 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 devThe 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-uiThe Dockerfile uses multi-stage builds with nginx for production serving.
| Document | Description |
|---|---|
| π Local Development | Step-by-step local setup and development workflows |
| βοΈ Azure Container Apps | Deploy to Azure Container Apps |
# Run unit tests
npm test
# Lint code
npm run lint
# Auto-fix lint issues
npm run lint:fix
# Format code
npm run format| Metric | Status |
|---|---|
| Unit Tests | β React Testing Library |
| Linting | β ESLint |
| Formatting | β Prettier |
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
| 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 |
# π 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-uiWe welcome contributions! Please follow these steps:
- Fork the repository
- Create a feature branch
git checkout -b feature/amazing-feature
- Write tests for your changes
- Run the test suite
npm test && npm run lint
- Commit your changes
git commit -m 'feat: add amazing feature' - Push to your branch
git push origin feature/amazing-feature
- 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
| Resource | Link |
|---|---|
| π Bug Reports | GitHub Issues |
| π Documentation | docs/ |
| π¬ Discussions | GitHub Discussions |
This project is part of the xshopai e-commerce platform. Licensed under the MIT License - see LICENSE for details.
Made with β€οΈ by the xshopai team