A powerful visual HR automation workflow platform built with React Flow, featuring smart auto-layout, undo/redo, reporting dashboards, and robust security controls. Design complex approval flows, task assignments, and automated actions with an intuitive drag-and-drop interface.
π Live Demo: https://hireflow-studio.vercel.app
- β¨ Key Features
- π Quick Start
- π Usage Guide
- ποΈ Architecture
- π§ͺ Testing
- π Documentation
- π¨ UI/UX Features
- π Future Works (Improvements / Add-ons)
- π Acknowledgments
- Drag-and-Drop Interface: Intuitive canvas powered by React Flow
- 5 Specialized Node Types:
- π’ Start Node: Workflow entry point with metadata configuration
- π΅ Task Node: Human task assignments with assignees and due dates
- π Approval Node: Manager/HR approval steps with role-based routing
- π£ Automation Node: System-triggered actions (emails, documents, system updates)
- π΄ End Node: Workflow completion with summary messages
- Dynamic Configuration Forms: Each node type has custom edit panels with validation
- Real-time Validation:
- Cycle detection (prevents infinite loops)
- Disconnected node detection
- Start/End node validation
- Edge connectivity checks
- Workflow Simulation: Step-by-step execution preview with timing and status
- Summary Report Generation: Comprehensive execution reports with downloadable text files
- Undo/Redo System:
- Automatic history tracking (50 state limit)
- Keyboard shortcuts (Ctrl+Z / Ctrl+Y)
- Smart change detection
- Auto-Layout Algorithm:
- BFS-based graph traversal
- Smooth 600ms animations with cubic-bezier easing
- Automatic centering and spacing
- Export/Import with Security:
- Custom modal for filename entry
- File size validation (5MB limit)
- Workflow size limits (1000 nodes, 2000 edges)
- JSON structure validation
- Mock API Integration: 8 pre-configured automation actions
- Interactive Mini-map: Navigate large workflows with zoom and pan controls
- Modern UI/UX:
- Color-coded sidebar icons matching node types
- Gradient backgrounds and smooth animations
- Responsive design
- Edge colors matching source node types
- Automated Tests: 10+ comprehensive test cases
- Validation Testing: Cycle detection, node validation, edge cases
- API Testing: Mock data retrieval and workflow simulation
- Security Testing: Input validation, file size checks
- Test UI: Interactive test runner with coverage reports
- Zero vulnerabilities: npm audit clean
- Node.js 18+
- npm or yarn
# Clone the repository
git clone <repository-url>
cd hr-workflow
# Install dependencies
npm install
# Start development server
npm run devThe application will be available at http://localhost:5173 (or the next available port)
# Build and run with Docker Compose
docker-compose up -d
# Or build manually
docker build -t hr-workflow .
docker run -p 3000:80 hr-workflowThe application will be available at http://localhost:3000
npm run dev # Start development server with HMR
npm run build # Build for production
npm run preview # Preview production build
npm run lint # Run ESLint
npm test # Run tests in watch mode
npm run test:ui # Open interactive test UI
npm run test:coverage # Generate coverage report-
Add Nodes:
- Drag nodes from the left sidebar onto the canvas
- Each node type has a distinct color and icon
-
Connect Nodes:
- Click and drag from a node's bottom handle
- Connect to another node's top handle
- Connections are animated and can be deleted
-
Configure Nodes:
- Click any node to open its configuration panel
- Fill in required fields (marked with validation)
- Changes are saved automatically
-
Validate Workflow:
- Check the top-right corner for validation status
- Click the validation badge to see detailed errors/warnings
- Fix issues before testing
-
Test Workflow:
- Click "Test Workflow" button
- View step-by-step execution simulation
- See timing, status, and details for each step
-
Export Workflow:
- Click "Export" to download as JSON
- Share or version control your workflow
- Import later for modifications
Employee Onboarding:
Start β Task (HR Setup) β Approval (Manager) β Automation (Send Welcome Email) β End
Leave Request:
Start β Task (Submit Request) β Approval (Manager) β Automation (Update Calendar) β End
Document Verification:
Start β Task (Upload Docs) β Approval (HR Review) β Automation (Archive) β End
- Frontend: React 19 + TypeScript 5
- UI Library: React Flow (@xyflow/react v12)
- Icons: Lucide React
- Build Tool: Vite 7
- Testing: Vitest 4 + React Testing Library
- Styling: CSS with modern gradients and animations
src/
βββ api/ # Mock API layer
β βββ mockData.ts # 8 automation actions
β βββ workflowApi.ts # API functions with summary reports
β βββ __tests__/ # API tests
βββ components/
β βββ canvas/ # Main workflow canvas
β βββ nodes/ # Custom node rendering (memo-wrapped)
β βββ panels/ # Edit and simulation panels
β βββ sidebar/ # Node palette with colored icons
β βββ modals/ # Export modal
βββ hooks/ # Custom React hooks
β βββ useWorkflowState.ts # State with auto history
β βββ useAutomations.ts
βββ types/ # TypeScript definitions
β βββ workflow.types.ts
β βββ api.types.ts
βββ utils/ # Validation & security
β βββ workflowValidation.ts
β βββ security.ts # Input sanitization
βββ test/ # Test configuration
- Custom Hooks: Encapsulated state management with automatic history
- Discriminated Unions: Type-safe node data
- BFS Algorithm: Graph traversal for auto-layout
- DFS Algorithm: Cycle detection in validation
- Mock API: Realistic async operations with delays
- Component Composition: Modular, reusable components
- React.memo: Performance optimization for nodes
- useCallback/useMemo: Stable references and memoization
- RequestAnimationFrame: Smooth animations without CSS issues
# Run all tests
npm test
# Interactive test UI
npm run test:ui
# Generate coverage report
npm run test:coverage- β Workflow validation (6 tests)
- β API functionality (4 tests)
- β Cycle detection
- β Node validation rules
- β Mock data structure
See TESTING.md for detailed test documentation.
- ARCHITECTURE.md - System architecture and design decisions
- COMPONENT_DIAGRAM.md - Component hierarchy and data flow
- TESTING.md - Test suite documentation
- SECURITY.md - Security audit report and best practices
- USAGE_EXAMPLES.md - Detailed usage examples
- QUICK_REFERENCE.md - Quick reference guide
- WORKFLOW_TEMPLATES_GUIDE.md - Pre-built workflow templates
- Modern Design: Gradient backgrounds and smooth shadows
- Color-Coded Everything:
- Node types: Green (start), Blue (task), Orange (approval), Purple (automated), Red (end)
- Sidebar icons match node colors
- Edge colors match source node types
- Smooth Animations:
- 600ms auto-layout transitions with cubic-bezier easing
- Edges follow nodes perfectly during animation
- Modal fade-in and slide-up effects
- Responsive Layout: Works on different screen sizes
- Hover States: Interactive feedback on all elements
- Metrics Badges: Visual indicators for node complexity and features
- Validation Feedback: Clear error and warning messages with click-to-fix
- Mini-map Navigation: Quick canvas overview with pan and zoom
- Custom Modals: Professional export dialog with validation
- 3 Pre-built Workflow Templates: Employee Onboarding, Expense Approval, Leave Request
- π Summary Badge: Visual indicator on end nodes when report generation is enabled
- AI-Powered Node Suggestions: Suggest the next logical step in the workflow based on historical context.
- Real-time Collaboration: Enable multi-user concurrent editing of workflows.
- Workflow Versioning & Audit Logs: Track changes and roll back to previous workflow states.
- Advanced Authentication & RBAC: Granular role-based access controls for individual workflows.
- External API Integrations: Pre-built integration nodes for popular enterprise HR platforms (e.g., Workday, Jira, Slack).
- Dark Mode Theme Switcher: Add a UI toggle to easily switch between the light and default dark mode.
- Built with React Flow
- Icons by Lucide
- Powered by Vite