Web Report Dashboard - React
Dashboard

HR Dashboard - Setup and Operation SOP
System Overview
The HR Dashboard is a full-stack application consisting of:
Frontend: React TypeScript component with Recharts for visualizations
Backend: Flask Python API for Excel file processing and data serving
Data Flow: Upload Excel → Process → Transform → Visualize
Prerequisites
Software Requirements
Python 3.8+ (for backend)
Node.js 14+ (for frontend development)
Modern web browser (Chrome, Firefox, Safari, Edge)
Python Dependencies
bashpip install flask flask-cors pandas numpy openpyxl xlrd werkzeugRequired Excel File Structure
Your Excel file should contain these sheets:
Recruiting: Year, Recruiter Salary, Recruiter Fees, Other, Total, Applicants, Success, Cost per Applicant, Cost per Success
Employee: EmployeeID, StartDate, EndDate, Reason, 90Days
Vacancy: Job, Department, Vacant, Filled, Gender, Race, Applicants, CurrentYear, Days
Installation & Setup
Step 1: Backend Setup
Create project directory:
bashmkdir hr-dashboard cd hr-dashboardCreate virtual environment:
bashpython -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activateInstall dependencies:
bashpip install flask flask-cors pandas numpy openpyxl xlrd werkzeugSave the backend code as
app.pyCreate upload directory:
bashmkdir -p c:\EDA\Project\HR # Windows mkdir -p /tmp/hr-uploads # Linux/Mac (update path in app.py)
Step 2: Frontend Setup
Save the React component as
hr_dashboard.tsxEnsure you have a React project with required dependencies:
bashnpm install recharts lucide-react
Running the Application
Option A: Full Stack Development
Start Backend Server:
bashpython app.pyServer starts on
http://localhost:5000Check health endpoint:
http://localhost:5000/health
Start Frontend:
If using Create React App:
npm startIf using Vite:
npm run devIf using Next.js:
npm run dev
Option B: Standalone Frontend (Current State)
Use the React component directly in your project
Component will use demo data until backend integration is complete
Usage Instructions
Step 1: Access the Dashboard
Navigate to your frontend URL (typically
http://localhost:3000)You'll see the upload interface
Step 2: Upload HR Data
Click "Click to upload" or drag and drop your Excel file
Supported formats: .xlsx, .xlsm, .xls
Maximum file size: 16MB
Or click "Use Demo Data" to see sample visualizations
Step 3: View Analytics
Once processed, you'll see:
KPI Cards: Total recruiting cost, applicants, success rate, avg fill time
Recruiting Cost Chart: Annual cost breakdown
Cost Analysis: Cost per applicant vs. cost per success
Diversity Charts: Gender and race distribution
Quit Rate Trend: 90-day quit rate over time
Separation Reasons: Why employees leave
Fill Time Analysis: Average days to fill positions
API Endpoints
EndpointMethodDescription/GETServe main page/uploadPOSTUpload and process Excel file/dashboard/<filename>GETGet processed dashboard data/healthGETHealth checkData Processing Flow
Upload: Excel file uploaded via
/uploadendpointValidation: File type and size validation
Processing: Extract data from multiple sheets
Transformation: Convert to dashboard-friendly format
Storage: Temporarily store processed data
Visualization: Frontend renders charts and KPIs
Troubleshooting
Common Issues
Backend Issues:
Port already in use: Change port in
app.py(line:app.run(debug=True, host='0.0.0.0', port=5001))Upload folder permissions: Ensure write permissions to upload directory
Excel reading errors: Check file format and structure
Frontend Issues:
CORS errors: Ensure Flask-CORS is properly configured
Chart rendering: Verify Recharts dependency is installed
File upload not working: Check if backend is running and accessible
Debug Steps
Check backend logs: Look for errors in Flask console
Test API endpoints: Use Postman or curl to test
/healthendpointBrowser console: Check for JavaScript errors
Network tab: Verify API calls are being made
File Structure
hr-dashboard/
├── app.py # Flask backend
├── hr_dashboard.tsx # React frontend
├── uploads/ # Excel files storage
├── venv/ # Python virtual environment
└── requirements.txt # Python dependenciesSecurity Considerations
File upload validation (type, size)
Secure filename handling
CORS configuration
Upload directory permissions
Input sanitization for Excel data
Performance Notes
Maximum file size: 16MB
Processing time depends on Excel file size
Demo data loads instantly
Charts are responsive and interactive
Support & Maintenance
Regular Tasks
Monitor upload directory disk space
Clean up old uploaded files
Update dependencies regularly
Monitor application logs
Scaling Considerations
Add database for persistent storage
Implement user authentication
Add file processing queue for large files
Consider cloud storage for uploads