Skip to content

Mini Leave Management System built with Django REST Framework. HR can manage employees & leave requests, while employees can apply and track leave.

Notifications You must be signed in to change notification settings

alibassam24/Mini-Leave-Management-Backend-Django

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

18 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“ Mini Leave Management System (Django REST API)

A simple Leave Management System built with Django REST Framework It allows HR to manage employees and leave requests with secure APIs.

MAKE SURE TO READ SETUP INSTRUCTIONS πŸ‘‡


πŸš€ Main Features (in simple terms)

  • πŸ‘©β€πŸ’Ό HR Management
    HR can add new employees and manage their profiles.

  • πŸ§‘β€πŸ’» Employee Management
    Employees can apply for leave and track their leave balance.

  • πŸ“¨ Leave Requests
    Employees apply for leave β†’ HR approves/rejects β†’ Leave balance auto-updates.

  • πŸ” Authentication
    Login/Logout with secure JWT tokens. Only HR has management privileges.

  • πŸ“Š Leave Balance Tracking
    Each employee has leave balance updated automatically after approvals.


πŸ“‚ API Endpoints

Here’s a quick reference of all available endpoints:

πŸ”‘ Authentication

Method Endpoint Description
POST /api/login/ Login and get JWT
POST /api/logout/ Logout (invalidate)

πŸ‘©β€πŸ’Ό HR Management

Method Endpoint Description
POST /api/hr/add/ Add a new HR account

πŸ§‘β€πŸ’» Employee Management

Method Endpoint Description
POST /api/employee/add/ Add new employee
DELETE /api/employee/delete/ Delete employee

πŸ“¨ Leave Management

Method Endpoint Description
POST /api/leave/apply/ Apply for leave
GET /api/leave/applications/ View all leave applications
PATCH /api/leave/approve/<application_id>/ Approve leave
PATCH /api/leave/reject/<application_id>/ Reject leave
GET /api/leave/balance/<employee_id>/ Get leave balance

βš™οΈ Tech Stack

  • Python 3.10+
  • Django 4.x
  • Django REST Framework
  • Token Authentication
  • SQLite (default, can upgrade to PostgreSQL/MySQL)

πŸ”§ Setup Instructions

# Clone the repo
git clone https://github.com/alibassam24/Mini-Leave-Management-Backend-Django.git
cd Mini-Leave-Management-Backend-Django

# Create virtual environment
python -m venv env
source env/bin/activate  # For Windows: env\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Run migrations
python manage.py makemigrations
python manage.py migrate

# Start development server
python manage.py runserver

πŸ™‹β€β™‚οΈ Author

Ali Bassam πŸ“§ alibassam063@gmail.com πŸ”— www.linkedin/in/alibassam1

About

Mini Leave Management System built with Django REST Framework. HR can manage employees & leave requests, while employees can apply and track leave.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages