Skip to content

titan-spyer/library_management

Repository files navigation

📚 Modern Library ERP

Python Version Build Status Tests Architecture

A robust, terminal-based Enterprise Resource Planning (ERP) system for modern libraries, engineered with Python.

Modern Library ERP is a fully engineered backend system featuring Role-Based Access Control (RBAC), the Factory Design Pattern, decoupled data persistence (Repository Pattern), and an isolated business logic engine.


🌟 Core Features

🔐 Role-Based Access Control (RBAC)

  • Multi-Tiered Users: Secure environments for Students, Faculty, Librarians, and Admins.
  • Dynamic Permissions: Borrowing limits, fine thresholds, and access rights scale securely based on the inherited user role.
  • Security: Salted password hashing implementation for secure user authentication.

⚙️ Business Rules Engine

  • State Machine: Resources transition through strict states (Available, Checked Out, Lost, Archived).
  • Financial Logic: Automated calculation of overdue fines, grace periods, payment tracking, and fine waiving workflows.
  • Concurrency Control: Strict validation rules prevent users from borrowing duplicate copies or exceeding tier limits.

🏛️ Engineering Architecture

  • Repository Pattern: File I/O operations are strictly isolated in the data access layer. The business engine never directly touches the database.
  • Factory Pattern: Polymorphic instantiation of Users and Resources (Books, Journals, Digital Media) from raw data.
  • Abstract Base Classes: Enforced architectural contracts across all resource and user types.

📂 Project Structure

The codebase is organized following industry-standard separation of concerns:

📦 Modern-Library-ERP
 ┣ 📂 .github/workflows/  # CI/CD Pipeline Configuration
 ┣ 📂 data/               # Persistent CSV Storage (Isolated Database)
 ┣ 📂 src/                # Core Application Code
 ┃ ┣ 📂 core/             # Business Logic & Rules Engine (engine.py, validator.py)
 ┃ ┣ 📂 models/           # Domain Entities & Schemas (user.py, book.py)
 ┃ ┣ 📂 repository/       # Data Access Layer (storage.py)
 ┃ ┣ 📂 utils/            # Shared Helpers (logger.py, auth_tools.py)
 ┃ ┗ 📜 main.py           # CLI Entry Point & Controller
 ┣ 📂 tests/              # 98-Test Pytest Suite (Integration & Unit)
 ┣ 📜 .gitignore          # Environment & Cache exclusion
 ┣ 📜 requirements.txt    # Project Dependencies
 ┗ 📜 README.md           # Documentation

🚀 Quick Start

Prerequisites

  • Python 3.10 or higher installed.

Installation

  1. Clone the repository:
git clone [https://github.com/yourusername/Modern-Library-ERP.git](https://github.com/yourusername/Modern-Library-ERP.git)
cd Modern-Library-ERP
  1. Create and activate a virtual environment:
# On Windows
python -m venv venv
.\venv\Scripts\activate

# On macOS/Linux
python3 -m venv venv
source venv/bin/activate
  1. Install dependencies:
pip install -r requirements-test.txt
  1. Run the Application:
python -m src.main

(Note: On first run, the storage engine will automatically initialize the secure database files in the /data directory).


🧪 Testing & CI/CD

This project is heavily tested with a 98-test pytest suite covering unit rules, database storage, and full integration workflows. It uses GitHub Actions for Continuous Integration to ensure code reliability on every push.

To run the tests locally:

pytest tests/ -v

👨‍💻 Author

Satyabrata Behera Software Engineering Intern Candidate | Machine Learning Enthusiast

  • Education: B.Tech in Electronics & Telecommunication, Veer Surendra Sai University Of Technology (VSSUT)
  • LinkedIn: Satyabrata Behera
  • GitHub: @titan-spyer

About

A professional-grade, CLI-based Library ERP system built with Python, featuring Role-Based Access Control (RBAC), the Factory Design Pattern, and a fully decoupled Repository architecture.

Topics

Resources

License

Stars

Watchers

Forks

Contributors