Skip to content
/ E_HRMS Public

Centralized HR backend built with FastAPI and PostgreSQL. Secure JWT auth, employee CRUD, attendance, leave workflow, and automated payroll/payslips.

License

Notifications You must be signed in to change notification settings

yrdaman/E_HRMS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

🚀 E-HRMS — Electronic Human Resource Management System (Backend)

A centralized backend API for a complete Human Resource Management System, built with FastAPI and PostgreSQL.
It provides secure authentication, employee management, attendance tracking, leave workflows, and automated payroll processing.


📦 Core Modules Implemented

🔐 Authentication (JWT)

  • Secure user login (/auth/login)
  • Password hashing
  • Role-based access (Admin, HR, Employee)

👥 Employee Management

  • Full CRUD operations
  • Personal info + salary details
  • Admin-controlled

⏰ Attendance Management

  • Clock-in / Clock-out system
  • Duplicate prevention logic
  • Attendance logs

📝 Leave Management

  • Leave request submission
  • Admin/HR approval or rejection
  • Leave history tracking

💰 Payroll Automation

  • Auto calculates base salary
  • Deduction from approved leaves
  • Generates net salary & payslip-ready data

🛠️ Tech Stack

  • FastAPI (Python)
  • PostgreSQL
  • SQLAlchemy ORM
  • Pydantic
  • JWT (python-jose, passlib)

▶️ How to Run This Project

1️⃣ Clone the repository

git clone https://github.com/yrdaman/E_HRMS.git
cd E_HRMS

2️⃣ Create .env file

Create a .env file in the project root:

DATABASE_URL=postgresql://your_user:your_password@localhost/ehrms_db
JWT_SECRET_KEY=your_long_random_secret_key

3️⃣ Create the database

CREATE DATABASE ehrms_db;

4️⃣ Install dependencies

py -3.12 -m venv venv
./venv/Scripts/activate
pip install -r requirements.txt

5️⃣ (Optional) Seed dummy data

python app/seed.py

This creates:

  • Dummy admin
  • Dummy employee
  • Sample employees
  • Attendance history
  • Leave requests
  • Payroll entries

6️⃣ Run the server

uvicorn app.main:app --reload

API Docs:
👉 http://127.0.0.1:8000/docs


📁 Project Structure

E_HRMS
│── .gitignore
│── readme.md
│── requirements.txt
│
└── app
    │── main.py
    │── __init__.py
    │
    ├── auth
    │   ├── dependencies.py
    │   ├── models.py
    │   ├── router.py
    │   ├── schemas.py
    │   ├── service.py
    │   └── __init__.py
    │
    ├── core
    │   ├── config.py
    │   ├── database.py
    │   └── __init__.py
    │
    └── modules
        ├── attendance
        │   ├── models.py
        │   ├── router.py
        │   ├── schemas.py
        │   ├── service.py
        │   └── __init__.py
        │
        ├── employee
        │   ├── models.py
        │   ├── router.py
        │   ├── schemas.py
        │   ├── service.py
        │   └── __init__.py
        │
        ├── leave
        │   ├── models.py
        │   ├── router.py
        │   ├── schemas.py
        │   ├── service.py
        │   └── __init__.py
        │
        └── payroll
            ├── models.py
            ├── router.py
            ├── schemas.py
            ├── service.py
            └── __init__.py

🧱 API Overview (Quick Reference)

Module Method(s) Endpoint
Auth POST /auth/login
Employees CRUD /modules/employee
Attendance GET/POST /modules/attendance
Leave GET/POST/PUT /modules/leave
Payroll POST /modules/payroll/calculate

📌 License: MIT License

About

Centralized HR backend built with FastAPI and PostgreSQL. Secure JWT auth, employee CRUD, attendance, leave workflow, and automated payroll/payslips.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages