Skip to content

baverstockUX/hr-system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HR System

A comprehensive HR management system that covers employee records, absence management, and time tracking.

Features

  • Employee Management: Store and manage employee records with personal details, contact information, and employment history.
  • Absence Management: Track and manage employee absences, including vacation, sick leave, and other types of leave.
  • Time Tracking: Record employee work hours with clock-in and clock-out functionality.
  • User Authentication: Secure login system with role-based access control.
  • Responsive UI: Modern, mobile-friendly interface built with Material UI.

Tech Stack

Backend

  • Node.js with Express
  • TypeScript
  • MongoDB with Mongoose
  • JWT Authentication

Frontend

  • React
  • TypeScript
  • Material UI
  • React Router

Project Structure

hr-system/
├── backend/                # Backend API
│   ├── src/
│   │   ├── controllers/    # Request handlers
│   │   ├── middleware/     # Express middleware
│   │   ├── models/         # Mongoose models
│   │   ├── routes/         # API routes
│   │   └── server.ts       # Entry point
│   ├── .env                # Environment variables
│   └── package.json        # Backend dependencies
│
└── frontend/               # React frontend
    ├── public/             # Static files
    ├── src/
    │   ├── components/     # Reusable components
    │   ├── pages/          # Page components
    │   ├── App.tsx         # Main app component
    │   └── index.tsx       # Entry point
    └── package.json        # Frontend dependencies

Getting Started

Prerequisites

  • Node.js (v14 or higher)
  • MongoDB (local or Atlas)

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/hr-system.git
    cd hr-system
    
  2. Install backend dependencies:

    cd backend
    npm install
    
  3. Set up environment variables: Create a .env file in the backend directory with the following variables:

    PORT=5000
    MONGO_URI=mongodb://localhost:27017/hr-system
    JWT_SECRET=your_jwt_secret_key_here
    NODE_ENV=development
    
  4. Install frontend dependencies:

    cd ../frontend
    npm install
    

Running the Application

  1. Start the backend server:

    cd backend
    npm run dev
    
  2. Start the frontend development server:

    cd ../frontend
    npm start
    
  3. Open your browser and navigate to http://localhost:3000

API Endpoints

Authentication

  • POST /api/auth/register - Register a new user
  • POST /api/auth/login - Login and get token

Employees

  • GET /api/employees - Get all employees
  • GET /api/employees/:id - Get employee by ID
  • POST /api/employees - Create a new employee
  • PUT /api/employees/:id - Update an employee
  • DELETE /api/employees/:id - Delete an employee

Absences

  • GET /api/absences - Get all absences
  • GET /api/absences/:id - Get absence by ID
  • GET /api/absences/employee/:employeeId - Get absences for a specific employee
  • POST /api/absences - Create a new absence request
  • PUT /api/absences/:id - Update an absence request
  • PUT /api/absences/:id/status - Approve or reject an absence request
  • DELETE /api/absences/:id - Delete an absence request

Time Tracking

  • GET /api/time-tracking - Get all time records
  • GET /api/time-tracking/:id - Get time record by ID
  • GET /api/time-tracking/employee/:employeeId - Get time records for a specific employee
  • GET /api/time-tracking/range - Get time records for a specific date range
  • POST /api/time-tracking/clock-in - Clock in
  • PUT /api/time-tracking/clock-out/:id - Clock out
  • PUT /api/time-tracking/:id - Update a time record
  • DELETE /api/time-tracking/:id - Delete a time record

User Roles

  • Admin: Full access to all features
  • Manager: Can approve/reject absence requests and view employee data
  • Employee: Can view own profile, submit absence requests, and track time

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

An hr-system built with cline

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors