Skip to content

rharithra/LMS

Repository files navigation

🏒 Employee Management System

A comprehensive Employee Management System that combines Leave Management and Payroll Management into a single, powerful HR solution.

✨ Features

πŸ” Authentication & Authorization

  • Multi-role system: Employee, Manager, Admin
  • JWT-based authentication
  • Role-based access control
  • Secure password handling

πŸ“… Leave Management

  • Leave request submission with validation
  • Leave approval workflow (Manager/Admin)
  • Leave balance tracking with automatic deduction
  • Multiple leave types: Annual, Sick, Personal, Maternity, Paternity
  • Leave history and status tracking
  • Single-day leave support
  • Email notifications for leave status changes

πŸ’° Payroll Management

  • Automated payroll generation with leave integration
  • Salary structure management (Basic, HRA, DA, TA, PF, Tax)
  • Leave deduction calculation from salary
  • Payroll history and detailed breakdown
  • Currency formatting (INR)
  • Print-ready payslips
  • Payroll statistics and analytics

πŸ‘₯ Employee Management

  • Employee profiles with complete information
  • Department management
  • Manager assignment and team structure
  • Salary configuration per employee
  • Bank details and payroll information

πŸ“Š Dashboard & Analytics

  • Real-time statistics for leaves and payroll
  • Leave balance visualization
  • Payroll overview for managers/admins
  • Quick action buttons
  • Notification system

πŸ”” Notifications

  • In-app notifications with real-time updates
  • Email notifications for leave requests and approvals
  • Toast notifications for user feedback
  • Notification bell with unread count

πŸ› οΈ Technology Stack

Backend

  • Node.js with Express.js
  • JWT for authentication
  • Nodemailer for email notifications
  • In-memory data store (demo mode)
  • CORS enabled for frontend integration

Frontend

  • React 18 with functional components
  • React Router for navigation
  • React Query for data fetching and caching
  • React Hook Form for form management
  • Tailwind CSS for styling
  • Heroicons for icons
  • React Hot Toast for notifications
  • Date-fns for date manipulation

πŸš€ Quick Start

Prerequisites

  • Node.js (v14 or higher)
  • npm or yarn

Installation

  1. Clone the repository
git clone <repository-url>
cd Leave-Management
  1. Install dependencies
npm install
cd client && npm install
cd ..
  1. Set up environment variables Create a .env file in the root directory:
EMAIL_USER=your-email@gmail.com
EMAIL_PASS=your-app-password
PORT=5000
JWT_SECRET=your-secret-key
  1. Start the application
# Start backend server
npm run backend

# In another terminal, start frontend
npm start
  1. Access the application

πŸ‘€ Demo Users

Role Email Password Access
Admin admin@company.com password123 Full access
Manager manager@company.com password123 Team management + Payroll
Employee employee@company.com password123 Leave requests only

πŸ“‹ User Roles & Permissions

πŸ‘¨β€πŸ’Ό Admin

  • Full system access
  • User management (create, edit, delete)
  • Department management
  • Leave type configuration
  • Payroll generation for all employees
  • System statistics

πŸ‘¨β€πŸ’» Manager

  • Team management (view team members)
  • Leave approval for team members
  • Payroll generation for team members
  • Team statistics

πŸ‘· Employee

  • Leave request submission
  • View own leave history
  • View own payroll (if generated)
  • Profile management

πŸ’Ό Payroll Features

Salary Components

  • Basic Salary: Base compensation
  • HRA: House Rent Allowance (40% of basic)
  • DA: Dearness Allowance (30% of basic)
  • TA: Transport Allowance (10% of basic)
  • PF: Provident Fund (12% deduction)
  • Tax: Income Tax (10% deduction)

Payroll Calculation

  1. Gross Salary = Basic + HRA + DA + TA
  2. Net Salary = Gross - PF - Tax
  3. Leave Deduction = (Leave Days Γ— Per Day Salary)
  4. Final Salary = Net Salary - Leave Deduction

Payroll Generation

  • Monthly payroll generation
  • Leave integration (automatic deduction)
  • Working days calculation
  • Detailed breakdown with earnings and deductions

πŸ“§ Email Notifications

Email Templates

  • Leave Request: Manager notification when employee submits
  • Leave Approved: Employee notification when approved
  • Leave Rejected: Employee notification with reason

Email Setup

  1. Enable 2FA on your Gmail account
  2. Generate App Password for mail access
  3. Update .env with email credentials
  4. Test email functionality

πŸ”§ API Endpoints

Authentication

  • POST /api/auth/login - User login
  • GET /api/auth/me - Get current user

Leave Management

  • GET /api/leaves - Get leave requests
  • POST /api/leaves - Submit leave request
  • PUT /api/leaves/:id/approve - Approve/reject leave
  • GET /api/leaves/stats - Leave statistics

Payroll Management

  • GET /api/payroll - Get payroll history
  • POST /api/payroll/generate - Generate payroll
  • GET /api/payroll/:id - Get payroll details
  • GET /api/payroll/stats - Payroll statistics

User Management

  • GET /api/users - Get users
  • POST /api/users - Create user
  • PUT /api/users/:id - Update user
  • PUT /api/users/:id/salary - Update salary

Notifications

  • GET /api/notifications - Get notifications
  • PUT /api/notifications/:id/read - Mark as read

πŸ“± Features by Role

Employee Features

  • βœ… Submit leave requests
  • βœ… View leave balance
  • βœ… Track request status
  • βœ… View payroll (if generated)
  • βœ… Receive notifications

Manager Features

  • βœ… Approve/reject team leave requests
  • βœ… View team statistics
  • βœ… Generate payroll for team
  • βœ… Manage team members
  • βœ… Receive leave notifications

Admin Features

  • βœ… Full user management
  • βœ… Department management
  • βœ… Leave type configuration
  • βœ… Generate payroll for all employees
  • βœ… System-wide statistics
  • βœ… Email configuration

🎨 UI/UX Features

Modern Design

  • Responsive layout (mobile-friendly)
  • Clean, professional interface
  • Intuitive navigation
  • Consistent styling with Tailwind CSS

User Experience

  • Real-time updates with React Query
  • Loading states and error handling
  • Toast notifications for feedback
  • Form validation and error messages
  • Confirmation dialogs for important actions

Accessibility

  • Keyboard navigation support
  • Screen reader friendly
  • High contrast color scheme
  • Responsive design for all devices

πŸ”’ Security Features

Authentication

  • JWT tokens for session management
  • Password hashing with bcrypt
  • Role-based access control
  • Secure API endpoints

Data Protection

  • Input validation on all forms
  • SQL injection prevention
  • XSS protection
  • CORS configuration

πŸ“Š System Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Frontend      β”‚    β”‚   Backend       β”‚    β”‚   Data Store    β”‚
β”‚   (React)       │◄──►│   (Node.js)     │◄──►│   (In-Memory)   β”‚
β”‚                 β”‚    β”‚                 β”‚    β”‚                 β”‚
β”‚ β€’ User Interfaceβ”‚    β”‚ β€’ API Routes    β”‚    β”‚ β€’ Users         β”‚
β”‚ β€’ State Mgmt    β”‚    β”‚ β€’ Auth Middlewareβ”‚   β”‚ β€’ Leaves        β”‚
β”‚ β€’ Routing       β”‚    β”‚ β€’ Business Logicβ”‚   β”‚ β€’ Payrolls      β”‚
β”‚ β€’ Components    β”‚    β”‚ β€’ Email Service β”‚   β”‚ β€’ Notifications β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸš€ Deployment

Production Setup

  1. Environment variables configuration
  2. Database setup (MongoDB/PostgreSQL)
  3. Email service configuration
  4. SSL certificate setup
  5. Domain configuration

Docker Deployment

# Backend Dockerfile
FROM node:16-alpine
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
EXPOSE 5000
CMD ["npm", "start"]

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test thoroughly
  5. Submit a pull request

πŸ“ License

This project is licensed under the MIT License.

πŸ†˜ Support

For support and questions:


Built with ❀️ using React, Node.js, and Tailwind CSS

About

Leave management Syatem

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages