A lightweight React-based admin dashboard for managing the ICC Rule Engine system. This internal tool provides comprehensive system administration capabilities including rule management, validation monitoring, and system configuration.
- Dashboard: System health monitoring, metrics, and recent activity
- Rules Management: CRUD operations with JSON editor and bulk upload
- Validation Logs: Search and view validation history (coming soon)
- Webhooks: Manage webhook endpoints and test deliveries (coming soon)
- API Keys: Create and manage API keys with role-based access (coming soon)
- Tenants: Multi-tenant organization management (coming soon)
- Versions: Ruleset version management and releases (coming soon)
- Settings: System configuration and feature flags (coming soon)
- Frontend: React 18 + TypeScript + Vite
- Styling: TailwindCSS + Custom component library
- State Management: TanStack Query (React Query)
- Routing: React Router v6
- Icons: Lucide React
- Development: Hot reload, TypeScript checking, ESLint
- Node.js 18+
- npm or yarn
- ICC Rule Engine backend running (default: http://localhost:8000)
- Admin API key for backend access
cd admin
npm installCreate a .env.local file (copy from .env.local.example):
cp .env.local.example .env.localConfigure the following variables:
# Backend API Configuration
VITE_API_BASE_URL=http://localhost:8000
VITE_DASHBOARD_TITLE=ICC Rule Engine Admin
VITE_ADMIN_API_KEY=your-admin-api-key-hereEnsure your backend is configured to allow admin dashboard access:
Environment Variables (in backend .env):
ADMIN_CORS_ORIGINS=http://localhost:3001,http://localhost:3000
MULTI_TENANT_ENABLED=false # or true for multi-tenant modeAdmin API Key: Create an admin-level API key in your backend system. The key should have admin role for full dashboard access.
npm run devThe dashboard will be available at http://localhost:3001
npm run dev- Start development server with hot reloadnpm run build- Build production bundlenpm run preview- Preview production build locallynpm run lint- Run ESLint for code quality
- Start Backend: Ensure ICC Rule Engine backend is running on port 8000
- Set API Key: Configure
VITE_ADMIN_API_KEYin.env.local - Start Frontend: Run
npm run devto start the admin dashboard - Access Dashboard: Navigate to http://localhost:3001
The admin dashboard uses API key-based authentication:
- Header:
X-API-Key: your-admin-key - Role: API key must have
adminrole for full access - Security: Keys are validated by the backend tenant middleware
- Must be registered in backend system
- Role:
admin(for full dashboard access) - Status:
activeand not expired - Associated with valid tenant (in multi-tenant mode)
The dashboard communicates with these backend endpoints:
GET /health- System health and version infoGET /rules- List all rulesPOST /rules- Create new rulePUT /rules/{id}- Update existing ruleDELETE /rules/{id}- Delete rule
GET /admin/settings- System settings and feature flagsGET /admin/me- Current user info and permissionsGET /admin/tenants- List tenants (admin only)GET /admin/api-keys- List API keys (admin only)GET /admin/validation-logs- List validation logs (admin only)
GET /metrics- Prometheus metricsGET /usage- Usage statistics
- System health status with real-time updates
- Key metrics: total rules, tenants, API keys, 24h validations
- Validation statistics: success rate, average score
- Recent validation activity list
- List View: Searchable table with filtering by source, severity
- Create/Edit: Form with validation for all rule fields
- JSON Editor: Direct JSON editing with validation
- Bulk Upload: Upload JSON files (single rule or array)
- Export: Download filtered rules as JSON
- Toggle Status: Activate/deactivate rules
The remaining pages (Validation Logs, Webhooks, API Keys, Tenants, Versions, Settings) are implemented as placeholder components and will be fully developed in subsequent phases.
npm run buildThis creates a dist/ folder with optimized static files.
Deploy the dist/ folder to any static hosting service:
- Render Static Sites: Connect GitHub repo, set build command to
npm run build - Vercel: Simple deployment with GitHub integration
- Netlify: Drag and drop
dist/folder or connect repository - AWS S3 + CloudFront: Upload to S3 bucket with CloudFront distribution
Serve static files from your existing backend server or reverse proxy.
Set these environment variables in your deployment:
VITE_API_BASE_URL=https://your-backend-domain.com
VITE_DASHBOARD_TITLE=ICC Rule Engine Admin
VITE_ADMIN_API_KEY=prod-admin-key-hereSecurity Note: In production, consider loading the API key from a secure environment variable at build time or implementing server-side injection.
- Development: Store in
.env.local(git-ignored) - Production: Use secure environment variable injection
- Never: Commit API keys to version control
- Configure
ADMIN_CORS_ORIGINSin backend to allow only your admin domain - Use HTTPS in production
- Consider IP whitelisting for admin access
- Admin dashboard is for internal use only
- All API calls require admin-level API key
- Backend validates permissions on every request
-
CORS Errors
- Ensure
ADMIN_CORS_ORIGINSincludes your frontend URL - Check backend CORS middleware configuration
- Ensure
-
Authentication Failed
- Verify
VITE_ADMIN_API_KEYis set correctly - Ensure API key has
adminrole in backend - Check that API key is active and not expired
- Verify
-
Connection Refused
- Verify backend is running on correct port
- Check
VITE_API_BASE_URLmatches backend URL - Ensure no firewall blocking requests
-
Build Errors
- Run
npm cito clean install dependencies - Check Node.js version (requires 18+)
- Clear npm cache if needed:
npm cache clean --force
- Run
Enable debug logging by setting:
VITE_DEBUG=trueThis will show API request/response details in browser console.
src/
├── components/
│ ├── ui/ # Reusable UI components
│ └── layout/ # Layout components (Sidebar, TopBar)
├── pages/ # Page components
├── lib/
│ ├── api.ts # API client with auth wrapper
│ ├── types.ts # TypeScript type definitions
│ ├── query.ts # React Query configuration
│ └── utils.ts # Utility functions
├── routing.tsx # React Router setup
├── App.tsx # Main app component
└── main.tsx # Entry point
- Server State: Managed by TanStack Query with caching
- Component State: React hooks for local UI state
- Global State: React Context for toast notifications
All API calls go through a central client (lib/api.ts) that:
- Adds authentication headers automatically
- Handles base URL configuration
- Provides typed request/response interfaces
- Includes error handling and retry logic
- Use TypeScript for all new code
- Follow existing component patterns
- Use Tailwind classes for styling
- Add proper error handling and loading states
- Define types in
lib/types.ts - Add API calls to
lib/api.ts - Create page components in
pages/ - Add routes to
routing.tsx - Update navigation in
components/layout/Sidebar.tsx
While not implemented in this MVP, consider adding:
- Unit tests with Vitest
- Integration tests with Testing Library
- E2E tests with Playwright
- Project setup and core infrastructure
- Dashboard with system metrics
- Rules management with CRUD operations
- Basic authentication and CORS setup
- Validation Logs with search and filtering
- Webhooks management with test functionality
- API Keys CRUD with role management
- Enhanced error handling and user feedback
- Tenants management for multi-tenant setups
- Versions management for ruleset releases
- Settings page with feature flag controls
- Advanced monitoring and analytics
- User management and authentication
- Audit logging and compliance features
- Advanced reporting and data export
- System backup and restore capabilities
For issues and questions:
- Development Issues: Check troubleshooting section above
- Feature Requests: Create GitHub issue with detailed requirements
- Bug Reports: Include reproduction steps and environment details
- Security Issues: Report privately to the development team
Note: This admin dashboard is designed for internal use by system administrators. Ensure proper access controls and security measures are in place before deploying to production environments.