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.
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
- Framework: Next.js 15
- Language: TypeScript
- Database: PostgreSQL via Neon
- ORM: Drizzle ORM
- Authentication: better-auth
- Email: Resend
- UI Components: shadcn/ui
- Styling: Tailwind CSS
- Form Handling: react-hook-form + Zod
- Rich Text Editor: TipTap
- Date Handling: date-fns
- Icons: Lucide React
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
- Clone the repository
- Install dependencies
yarn install
- Run database migrations
yarn migrate
- Seed the database
yarn seed
Development
Start the development server:
yarn devThe application will be available at http://localhost:3001
Build and Deployment
Build for production:
yarn buildStart the production server:
yarn startProject 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 accountsuser_detail- Extended user informationleave- Leave requestsleave_type- Leave categories configurationleave_year- Annual leave cyclespolicy- Company policiesleave_remark- Comments on leave requests
Scripts
yarn dev- Start development serveryarn build- Build for productionyarn start- Start production serveryarn generate- Generate Drizzle migrationsyarn migrate- Run database migrationsyarn studio- Start Drizzle Studio for database inspectionyarn 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
- Email: johndoe@ehtishamalik.com
Manager User
- Email: richard@ehtishamalik.com
- Email: jane@ehtishamalik.com
Regular User
- Email: alex@ehtishamalik.com
- Email: chris@ehtishamalik.com
- Email: sam@ehtishamalik.com
- Email: jordan@ehtishamalik.com
License
Copyright (c) 2025 ehtishamalik
This project is proprietary and confidential. Unauthorized copying, distribution, or use is strictly prohibited.