Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
144 changes: 112 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,44 +1,124 @@
# Library Management Syste
# 📚 Library Management System

A desktop application to help librarians manage book inventory using Python and MySQL.
A robust, desktop-based library administration system developed in Python that digitizes daily operations including inventory management, member tracking, loan lifecycles, and automated fine calculation.

---
## 🎯 Overview

## 🚀 Current Features
This system enables librarians to efficiently manage their library's resources using a streamlined desktop interface backed by a local MySQL database. It replaces manual record-keeping with a unified, transactional platform ensuring data integrity and accurate tracking of all library assets and members.

## ✨ Key Features

### 👥 Module 3: Member Management & Lending
- Member registration system
- Book lending with due dates
- Active loans tracking
- Instant member search functionality
- Automatic availability updates
- **Secure Authentication**: Dedicated librarian login and session management
- **Member Management**: Comprehensive registration and tracking of library members
- **Book Inventory**: Add, update, and monitor physical book copies and availability
- **Automated Loans**: Issue books with automatically calculated due dates (14-day standard period)
- **Fine Processing**: Automatically calculate overdue fines ($5/day) upon book return
- **Reporting**: Generate inventory reports and track currently available books
- **Data Integrity**: Multi-step operations (like issuing loans) are protected by SQL transactions

### 👥 Module 4: Book Returns & Fine Management
- loned book display
- Return processing
- Active loans tracking
- Automatic fine calculation for overdue books
- Fine payment tracking
---
## Technology Stack
## 🏗️ Architecture

- **Frontend**: Tkinter (Python GUI)
- **Backend**: Python 3.9+
- **Database**: MySQL
- **Architecture**: MVC Pattern
### Frontend
- **Framework**: Tkinter (Python standard GUI library)
- **Styling**: `ttk` themed widgets (`clam` theme) with custom color palettes
- **Pattern**: Object-oriented View classes inheriting from `tk.Tk` and `tk.Toplevel`

## Installation
### Backend
- **Language**: Python 3.9+
- **Database**: MySQL (hosted locally via XAMPP or similar)
- **Driver**: `mysql-connector-python`
- **Architecture**: MVC / Service-Oriented Architecture separating Views, Services, and Models

1. **Prerequisites**:
- Python 3.9 or later
- MySQL Server
- XAMPP (recommended for easy MySQL setup)
## 🚀 Getting Started

2. **Setup Database**:
- Create a MySQL database named `library_management`
- Run the SQL script from `database/setup_db.sql`
### Prerequisites
- Python 3.9 or higher
- MySQL Server (e.g., via XAMPP)
- git

3. **Install Python Dependencies**:
### Installation

1. **Clone the repository**
```bash
git clone <repository-url>
cd LibraryManagementSystem
```

2. **Install dependencies**
```bash
pip install -r requirements.txt
pip install -r requirement.txt
```

3. **Database Setup**
- Ensure your MySQL server is running.
- Create a database named `library_management`.
- Run the setup scripts in `app/database/setup_db.py` to initialize the tables (`users`, `books`, `members`, `loans`).

### Development & Execution

**Start the application:**
```bash
python -m app.main
```

## 🧪 Sample Credentials

Use the following credentials to log in:

| Role | Username | Password |
|------------|---------------|------------|
| Admin | `AzkaShaukat` | `Azka@123` |
| Admin | `admin` | `admin123` |
| Librarian | `librarian1` | `libpass` |


## 📁 Project Structure

```text
LibraryManagementSystem/
├── app/ # Main application logic
│ ├── database/ # Database connection and setup scripts
│ ├── models/ # Data Transfer Objects (Book, User, Member, Loan)
│ ├── services/ # Business logic and SQL execution
│ ├── utils/ # Helper functions, UI styles, validators
│ ├── views/ # Tkinter GUI screens and components
│ ├── __init__.py
│ └── main.py # Application entry point
├── tests/ # Unit tests suite
│ ├── test_models/ # Tests for domain models
│ └── test_services/ # Tests for business logic services
├── requirement.txt # Python dependencies
└── README.md # Project documentation
```

## 🔐 Security & Integrity Features

- **Parameterized Queries**: Prevention against standard SQL injection via `mysql-connector-python` parameters.
- **Transactional Integrity**: Database transactions (`START TRANSACTION`, `COMMIT`, `ROLLBACK`) protect critical operations to ensure inventory counts always match loan records.
- **Architectural Isolation**: Database queries are strictly contained within the Service layer, preventing UI components from interacting directly with the database.

## 🛠️ Technology Stack

### Core Technologies
- Python 3.9+
- Tkinter & `ttk`
- MySQL

### Dependencies
- `mysql-connector-python` (8.0.33)
- `bcrypt` (4.1.2)
- `Pillow` (9.5.0)
- `matplotlib` (3.7.1)
- `pytest` (7.4.0)

## 🤝 Contributing

1. Fork the repository
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request

## 📄 License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.