GitHunt
EH

ehtishamalik/hr-management-system

A comprehensive Human Resources Management System that helps manage employee leave requests, policies, team oversight, and administrative functions.

HRM System

A comprehensive Human Resources Management System that helps manage employee leave requests, policies, team oversight, and administrative functions.

⚡ This application was originally created for Lycus Inc. to streamline and digitize their human resource management processes.
Designed with scalability in mind, it can be adapted for startups, enterprises, and organizations of any size, offering HR teams a seamless way to manage employees, track attendance, handle leaves, and oversee performance. Its intuitive interface ensures both administrators and staff have an efficient, user-friendly experience.

image

Features

User Management

  • Role-based access (User, Manager, Admin)
  • User profiles with personal information
  • Team management for managers

Leave Management

  • Multiple leave types (Casual, Sick, Annual, Half Day, Short Leave)
  • Leave application and approval workflow
  • Leave history tracking
  • Automatic leave balance calculation
  • Leave remarks system for communication

Policy Management

  • Create and manage company policies
  • Rich text editor for policy content
  • Active/inactive policy status

Admin Tools

  • User management and creation
  • Leave type configuration
  • Leave balance oversight
  • System settings management

Tech Stack

Getting Started

Prerequisites

  • Node.js 18+ and yarn
  • PostgreSQL database (or Neon database URL)

Environment Setup

Create a .env file in the root directory with the following variables:

DATABASE_URL=your_postgres_connection_string
BETTER_AUTH_SECRET=better_auth_secret
NEXT_PUBLIC_BETTER_AUTH_URL=your_auth_url
RESEND_FROM="Company name <login@domain.com>"
RESEND_API_KEY=your_resend_api_key

Installation

  1. Clone the repository
  2. Install dependencies
    yarn install
  3. Run database migrations
    yarn migrate
  4. Seed the database
    yarn seed

Development

Start the development server:

yarn dev

The application will be available at http://localhost:3001

Build and Deployment

Build for production:

yarn build

Start the production server:

yarn start

Project Structure

├── app/                    # Next.js app router pages
├── components/             # React components
├── constants/              # Application constants
├── db/                     # Database schema, migrations
├── enum/                   # TypeScript enums
├── hooks/                  # Custom React hooks
├── lib/                    # Utility functions and helpers
├── public/                 # Static assets
└── types/                  # TypeScript types

Database Schema

The application uses several key tables:

  • user - User accounts
  • user_detail - Extended user information
  • leave - Leave requests
  • leave_type - Leave categories configuration
  • leave_year - Annual leave cycles
  • policy - Company policies
  • leave_remark - Comments on leave requests

Scripts

  • yarn dev - Start development server
  • yarn build - Build for production
  • yarn start - Start production server
  • yarn generate - Generate Drizzle migrations
  • yarn migrate - Run database migrations
  • yarn studio - Start Drizzle Studio for database inspection
  • yarn seed - Seed the database with initial data

Default Accounts

You can login with any of the following demo accounts:

Default password is: password1234

Admin User

Manager User

Regular User

License

Copyright (c) 2025 ehtishamalik

This project is proprietary and confidential. Unauthorized copying, distribution, or use is strictly prohibited.