Technology stack
The admin application uses a modern React stack optimized for performance:- React 19 with React Compiler enabled
- Vite 7 for fast development and optimized builds
- React Router v7 for client-side routing
- TypeScript for type safety
- Tailwind CSS v4 for styling
- TanStack Query for server state management
- React Hook Form with Zod validation
- Zustand for client state management
- Recharts for data visualization
- Framer Motion for animations
- Radix UI for accessible components
Key features
Dashboard and analytics
Comprehensive business intelligence:- Real-time sales and revenue metrics
- Product performance analytics
- Customer behavior insights
- Order tracking and fulfillment status
- Custom date range filtering
Inventory management
Complete product and stock control:- Product catalog management
- Stock level monitoring
- Low-stock alerts
- Bulk product operations
- Category and attribute management
Order management
Streamlined order processing:- Order list with advanced filtering
- Order detail views
- Status updates and tracking
- Customer information
- Payment and shipping details
User administration
Comprehensive user management:- Customer account management
- Admin user management
- Role-based access control
- Permission management
Advanced features
- Notification center for important events
- Settings and configuration management
- Insights and recommendations
- Feedback and customer reviews
Project structure
The application follows a feature-based architecture:Getting started
Available scripts
Access control
Only accounts with the
ADMIN or SUPER_ADMIN role can access this application. Regular customer accounts will be denied access.Build optimization
The Vite configuration includes advanced code splitting:- vendor-react: React core libraries
- vendor-query: Data fetching (TanStack Query, Zustand)
- vendor-forms: Form handling (React Hook Form, Zod)
- vendor-ui: UI components (Radix UI, Lucide icons)
- vendor-motion: Animations (Framer Motion)
- vendor-charts: Data visualization (Recharts)
Bundle size monitoring
The admin app includes bundle regression checking:- Analyze current bundle:
pnpm --filter admin build:analyze - Check against baseline:
pnpm --filter admin bundle:check - Update baseline:
pnpm --filter admin bundle:baseline
bundle-regression-baseline.json.
Configuration
Vite configuration
The application is configured invite.config.ts:
- React Compiler plugin for automatic optimization
- Tailwind CSS integration
- Path aliases (
@/→./src/) - Manual chunk splitting for optimal loading
- Bundle size warnings at 650 KB
- Optional bundle analyzer with visualizations
Environment variables
VITE_AUTH_API_BASE_URL: Authentication API endpointBUNDLE_ANALYZE: Enable bundle analysis (true/false)
Development notes
- The API Gateway runs on port 4000
- Auth service runs on port 4001
- Gateway forwards
/api/v1/auth/*to auth service/auth/* - Admin authentication tokens are stored in localStorage