You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
EmpowHR is a comprehensive Employee Workload Monitoring & Management System designed to revolutionize HR operations through advanced technology integration. This full-stack web application provides a seamless experience for managing employee workloads, processing payments, and streamlining HR operations with sophisticated role-based access control.
Work Hours Analysis: Advanced filtering and summation capabilities
Employee Profiles: Comprehensive individual dashboards with charts
π‘οΈ Admin Control Center
User Management: Complete CRUD operations for all system users
Payroll Processing: Stripe-powered salary payment system
System Analytics: Real-time statistics and performance metrics
Role Management: Promote/demote users with audit trails
Fire/Rehire System: Employee status management with history
π Business Intelligence
Interactive Charts: Recharts-powered data visualization
Performance Metrics: Employee productivity comparison and trends
Payment Analytics: Salary distribution and payment history analysis
System Statistics: Live monitoring of system health and usage
Custom Reports: Flexible filtering and data export capabilities
ποΈ System Architecture
π Application Flow
graph TD
A[User Login] --> B{Role Check}
B -->|Employee| C[Employee Dashboard]
B -->|HR| D[HR Dashboard]
B -->|Admin| E[Admin Dashboard]
C --> F[Worksheet Management]
C --> G[Payment History]
D --> H[Employee Verification]
D --> I[Payment Requests]
D --> J[Progress Monitoring]
E --> K[User Management]
E --> L[Payment Processing]
E --> M[System Analytics]
I --> N[Stripe Payment Gateway]
L --> N
N --> O[Transaction Logging]
// Unique Indexes{email: 1}// Users collection{employeeEmail: 1,month: 1,year: 1}// Payments collection{employeeEmail: 1,month: 1,year: 1}// Payroll requests// Performance Indexes{email: 1,date: -1}// Worksheets by user and date{status: 1,createdAt: -1}// Payroll requests by status{paymentDate: -1}// Payments by date
π Data Relationships
erDiagram
USERS ||--o{ WORKSHEETS : creates
USERS ||--o{ PAYMENTS : receives
USERS ||--o{ PAYROLL_REQUESTS : "has requests"
USERS ||--o{ CONTACTS : submits
USERS {
string email PK
string name
string role
number salary
boolean isVerified
}
WORKSHEETS {
string email FK
string task
number hours
date workDate
}
PAYMENTS {
string employeeEmail FK
number amount
number month
number year
string transactionId
}
PAYROLL_REQUESTS {
string employeeEmail FK
number salary
string status
date createdAt
}
Loading
π Authentication & Security
π‘οΈ Security Architecture
Multi-Layer Authentication
Firebase Authentication: Industry-standard user authentication
Session Management: Automatic token refresh and validation
Data Protection Measures
Security Feature
Implementation
Benefits
Environment Variables
.env files for secrets
Prevents credential exposure
CORS Policy
Configured origins
Prevents unauthorized API access
Input Validation
Client & server-side
Prevents injection attacks
Password Requirements
6+ chars, uppercase, special
Enhances account security
Data Isolation
Email-based access control
Protects user privacy
Stripe Security
PCI-compliant processing
Secure payment handling
π Authentication Flow
sequenceDiagram
participant User
participant Frontend
participant Firebase
participant Backend
participant Database
User->>Frontend: Login Request
Frontend->>Firebase: Authenticate
Firebase->>Frontend: Return User Token
Frontend->>Backend: Sync User Data
Backend->>Database: Create/Update User
Database->>Backend: User Data
Backend->>Frontend: Complete User Profile
Frontend->>User: Dashboard Access
Loading
π₯ Role-Based Permissions
Feature
Employee
HR
Admin
View Own Worksheets
β
β
β
Create Worksheets
β
β
β
View All Employees
β
β
β
Verify Employees
β
β
β
Create Payment Requests
β
β
β
Process Payments
β
β
β
Manage Users
β
β
β
View System Statistics
β
β
β
Fire/Hire Employees
β
β
β
π Quick Start Guide
π Prerequisites
Before you begin, ensure you have the following installed:
# 1. Clone the repository
git clone https://github.com/shauncuier/EmpowHR.git
cd EmpowHR
# 2. Install server dependenciescd EmpowHR_Server
npm install
# 3. Install client dependenciescd ../EmpowHR_Client
npm install --legacy-peer-deps
# 4. Set up environment variables (see Configuration section)# Copy .env.example to .env in both directories# 5. Seed the database with test datacd ../EmpowHR_Server
npm run seed
# 6. Start the development servers# Terminal 1 - Backend
npm run dev
# Terminal 2 - Frontendcd ../EmpowHR_Client
npm run dev
graph TD
A[π Admin] --> B[π₯ HR Manager]
B --> C[π¨βπΌ Employee]
A --> D[Full System Access]
A --> E[Payment Processing]
A --> F[User Management]
A --> G[System Analytics]
B --> H[Employee Verification]
B --> I[Payment Requests]
B --> J[Progress Monitoring]
C --> K[Worksheet Management]
C --> L[Payment History View]
C --> M[Profile Management]
// Lazy loading for dashboard componentsconstAdminDashboard=lazy(()=>import('./Pages/Dashboard/Admin/AdminDashboard'));constHRDashboard=lazy(()=>import('./Pages/Dashboard/HR/HRDashboard'));// Usage with Suspense<Suspensefallback={<CircularProgress/>}><AdminDashboard/></Suspense>
State Management Optimization
// TanStack Query for efficient data fetchingconstuseEmployees=()=>{returnuseQuery({queryKey: ['employees'],queryFn: fetchEmployees,staleTime: 5*60*1000,// 5 minutescacheTime: 10*60*1000,// 10 minutes});};// Optimistic updates for worksheetsconstuseCreateWorksheet=()=>{constqueryClient=useQueryClient();returnuseMutation({mutationFn: createWorksheet,onMutate: async(newWorksheet)=>{// Optimistically update cacheawaitqueryClient.cancelQueries(['worksheets']);constpreviousWorksheets=queryClient.getQueryData(['worksheets']);queryClient.setQueryData(['worksheets'],old=>[
...old,{ ...newWorksheet,id: Date.now()}]);return{ previousWorksheets };},});};
// Firestore Security Rules (if using Firestore)rules_version='2';servicecloud.firestore{match/databases/{database}/documents{match/{document=**}{
allow read,write: ifrequest.auth!=null;}}}
π³ Stripe Configuration
1. Stripe Dashboard Setup
# Create Stripe account at https://dashboard.stripe.com# Get API keys from Dashboard > Developers > API keys# Test Environment
STRIPE_PUBLISHABLE_KEY=pk_test_...
STRIPE_SECRET_KEY=sk_test_...
# Production Environment
STRIPE_PUBLISHABLE_KEY=pk_live_...
STRIPE_SECRET_KEY=sk_live_...
# Install MongoDB Community Edition# macOS
brew install mongodb-community
# Ubuntu
sudo apt-get install -y mongodb
# Start MongoDB service
sudo systemctl start mongod
# Connection URI
MONGODB_URI=mongodb://localhost:27017/empowhr
2. MongoDB Atlas (Cloud)
# Create cluster at https://cloud.mongodb.com# Get connection string# Connection URI format
MONGODB_URI=mongodb+srv://username:password@cluster.mongodb.net/empowhr?retryWrites=true&w=majority
3. Database Initialization
# Run database seedingcd EmpowHR_Server
npm run seed
# This creates:# - Admin user (admin@empowhr.com)# - HR user (hr.manager@empowhr.com)# - Sample employees# - Test data
We welcome contributions to EmpowHR! Whether you're fixing bugs, adding features, or improving documentation, your help is appreciated.
Development Setup
# 1. Fork the repository on GitHub# 2. Clone your fork
git clone https://github.com/your-username/EmpowHR.git
cd EmpowHR
# 3. Add upstream remote
git remote add upstream https://github.com/shauncuier/EmpowHR.git
# 4. Create a new branch for your feature
git checkout -b feature/amazing-new-feature
# 5. Make your changes and commit
git add .
git commit -m "Add amazing new feature"# 6. Push to your fork and create a Pull Request
git push origin feature/amazing-new-feature
Update Documentation: Ensure README and other docs are updated
Add Tests: Include tests for new features
Check Responsiveness: Test on mobile, tablet, and desktop
Verify Accessibility: Ensure WCAG compliance
Performance: Check for performance impacts
Security: Review for security implications
π Reporting Issues
Bug Report Template
## Bug Description
Brief description of the bug
## Steps to Reproduce1. Go to '...'
2. Click on '...'
3. Scroll down to '...'
4. See error
## Expected Behavior
What you expected to happen
## Actual Behavior
What actually happened
## Environment- Device: [e.g., iPhone 12, Desktop]- Browser: [e.g., Chrome 96, Safari 15]- Screen Size: [e.g., 1920x1080, 375x812]- User Role: [e.g., Admin, Employee]## Screenshots
Add screenshots to help explain the problem
## Additional Context
Any other context about the problem
Feature Request Template
## Feature Summary
Brief description of the feature
## Problem Statement
What problem does this feature solve?
## Proposed Solution
Detailed description of the proposed solution
## Alternative Solutions
Other solutions you've considered
## Additional Context
Mockups, examples, or other context
π§ͺ Testing Contributions
Testing Checklist
All existing tests pass
New features have corresponding tests
Manual testing completed
Cross-browser compatibility verified
Mobile responsiveness confirmed
Accessibility standards met
Performance impact assessed
Running Tests
# Frontend testscd EmpowHR_Client
npm run test# Backend testscd EmpowHR_Server
npm run test# End-to-end tests
npm run test:e2e
# Coverage report
npm run test:coverage
π License
π MIT License1=-
MIT License
Copyright (c) 2024 EmpowHR Team
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
π Open Source Components
This project uses the following open source libraries:
# Check system health
curl https://empowhr-server.vercel.app/api/health
# Verify environment variables
npm run check-env
# Test API connectivity
npm run test-api
# Validate configuration
npm run validate-config
"Empowering your workforce management for the digital age"
About
EmpowHR is a comprehensive Employee Workload Monitoring & Management System designed to revolutionize HR operations through advanced technology integration.