Files
WooNooW/admin-spa/vite.config.ts
dwindown 232059e928 feat: Complete Dashboard API Integration with Analytics Controller
 Features:
- Implemented API integration for all 7 dashboard pages
- Added Analytics REST API controller with 7 endpoints
- Full loading and error states with retry functionality
- Seamless dummy data toggle for development

📊 Dashboard Pages:
- Customers Analytics (complete)
- Revenue Analytics (complete)
- Orders Analytics (complete)
- Products Analytics (complete)
- Coupons Analytics (complete)
- Taxes Analytics (complete)
- Dashboard Overview (complete)

🔌 Backend:
- Created AnalyticsController.php with REST endpoints
- All endpoints return 501 (Not Implemented) for now
- Ready for HPOS-based implementation
- Proper permission checks

🎨 Frontend:
- useAnalytics hook for data fetching
- React Query caching
- ErrorCard with retry functionality
- TypeScript type safety
- Zero build errors

📝 Documentation:
- DASHBOARD_API_IMPLEMENTATION.md guide
- Backend implementation roadmap
- Testing strategy

🔧 Build:
- All pages compile successfully
- Production-ready with dummy data fallback
- Zero TypeScript errors
2025-11-04 11:19:00 +07:00

29 lines
854 B
TypeScript

import react from '@vitejs/plugin-react';
import { defineConfig } from 'vite';
import fs from 'node:fs';
import path from 'node:path';
const key = fs.readFileSync(path.resolve(__dirname, '.cert/woonoow.local-key.pem'));
const cert = fs.readFileSync(path.resolve(__dirname, '.cert/woonoow.local-cert.pem'));
export default defineConfig({
plugins: [react()],
resolve: { alias: { '@': path.resolve(__dirname, './src') } },
server: {
host: 'woonoow.local',
port: 5173,
strictPort: true,
https: { key, cert },
cors: true,
origin: 'https://woonoow.local:5173',
hmr: { protocol: 'wss', host: 'woonoow.local', port: 5173 }
},
build: {
outDir: 'dist',
emptyOutDir: true,
rollupOptions: {
input: { app: 'src/main.tsx' },
output: { entryFileNames: 'app.js', assetFileNames: 'app.[ext]' }
}
}
});