Skip to content

aman-coder03/CLAMANS-Leave-Management-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

3 Commits
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ“˜ CLAMANS - Leave Management System

CLAMANS is a role-based, workflow-driven Leave Management System developed for the Central Library, IIT Delhi.
The system digitizes and automates the complete leave lifecycle with policy-compliant leave calculations, multi-level approvals, and automated email notifications, ensuring transparency, accuracy, and administrative efficiency.


๐Ÿš€ Key Highlights

  • โœ… 4-tier Role-Based Access Control (Staff, HOD, Head, Admin)
  • ๐Ÿ” Multi-level approval workflow with remarks at each stage
  • ๐Ÿ“† Accurate leave computation handling:
    • Weekends
    • Institutional holidays
    • Half-day policies
  • ๐Ÿ“ง SMTP-based workflow-driven email automation
  • ๐Ÿ” Email-based OTP verification & secure authentication
  • ๐Ÿ—„๏ธ PostgreSQL-backed transactional data layer
  • ๐ŸŽจ Modern Streamlit UI with custom CSS
  • โš™๏ธ Administrative user & leave balance management

๐Ÿง‘โ€๐Ÿ’ผ User Roles & Responsibilities

Role Capabilities
Staff Apply leave, view leave balance, track leave history
HOD Review staff leaves, forward or reject with remarks
Head Final approval or rejection authority
Admin User creation, role management, leave balance control

๐Ÿ”„ Leave Workflow

Staff โ†’ HOD โ†’ Head โ†’ Final Decision โ†’ Email Notification Each stage:

  • Enforces validation rules
  • Captures reviewer remarks
  • Sends automated email updates to relevant stakeholders

๐Ÿง  Leave Calculation Logic

CLAMANS ensures policy compliance using intelligent leave computation logic:

  • โŒ Excludes weekends (Saturday & Sunday)
  • โŒ Excludes institution-declared holidays
  • โž— Supports half-day leave (0.5 day) rules
  • ๐Ÿšซ Prevents invalid date ranges
  • ๐Ÿ”ข Automatically updates leave balance transactionally

Core utility functions:

is_working_day(date, holidays)
calculate_working_days(start_date, end_date, holidays)

๐Ÿ—„๏ธ Database Design (PostgreSQL)

CLAMANS uses a normalized, relational PostgreSQL schema designed to ensure data integrity, transactional safety, and institutional policy compliance.

Core Tables

users

  • Stores authentication and identity information
  • Implements role-based hierarchy using reports_to
  • Tracks remaining leave balance per user

Key Fields:

  • id (Primary Key)
  • username, email, password
  • role (staff / hod / head / admin)
  • reports_to (Foreign Key โ†’ users.id)
  • leave_count

leaves

  • Stores all leave applications and their lifecycle state
  • Supports multi-level approval workflow
  • Maintains complete audit trail

Key Fields:

  • user_id (Foreign Key โ†’ users.id)
  • leave_type, reason
  • start_date, end_date
  • status (pending, forwarded, approved, rejected)
  • hod_remarks, head_remarks
  • reviewed_by, approved_by
  • applied_date, forwarded_date, approval_date
  • is_half_day
  • reference_no

otp_verification

  • Enables email-based OTP authentication
  • Enforces time-bound verification

Key Fields:

  • email
  • otp
  • expiry

Database Features

  • ๐Ÿ”— Foreign-key integrity across users and leave records
  • ๐Ÿ”’ Transaction-safe leave deductions
  • ๐Ÿงฎ Accurate leave balance updates (full-day & half-day)
  • ๐Ÿ†” Unique reference number generation:

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published