Skip to content

Technical Manual

It's me Eldrex edited this page May 8, 2026 · 2 revisions



Smart Library Search and Management System: Technical Manual

This document provides a comprehensive explanation of the codebase, system architecture, and algorithmic logic for the Smart Library Search and Management System developed for Navotas Polytechnic College.


1. System Architecture

The system is built using a modular design to separate concerns between data management, algorithmic logic, and user interface.

Component Interaction

Component Responsibility
main.py Application entry point, window initialization, and event loop handling.
gui.py User Interface (Tkinter), event handling, theme configuration, and user interactions.
data_manager.py File I/O operations (JSON persistence) and CRUD data management.
algorithm.py Core searching logic (Binary Search) and utility operations.

2. Core Algorithms & Logic

A. Binary Search (O(log n))

Located in algorithm.py, this is used for fast ID-based lookup operations.

  • Repeatedly divides the dataset into halves to locate the target efficiently.
  • Requires data sorted by ID.
  • Used for instant retrieval of book records.

B. Built-in Sorting (Timsort - O(n log n))

The system uses Python’s built-in sorted() function.

  • Hybrid of Merge Sort and Insertion Sort
  • Stable sorting algorithm
  • Highly optimized in Python

Use cases:

  • Sorting by Title
  • Sorting by Author
  • Sorting by Date Added

C. Universal Search (Keyword Filtering)

Used for real-time search-as-you-type.

  • Combines:

    • ID
    • Title
    • Author
    • Location
    • Shelf
  • Optimized by merging fields into a single searchable string for fast matching.


3. Data Persistence (JSON)

  • Storage: data.json
  • Every change triggers immediate save
  • Ensures data consistency between memory and disk
  • Formatted using indentation for readability

4. GUI Implementation Details

Theme

  • Indigo (#4F46E5) → Primary color
  • Emerald (#10B981) → Success state
  • Red (#EF4444) → Error / delete / borrowed state
  • Font: Inter

Event Handling

  • Live search using trace_add("write", callback)
  • Table selection using <<TreeviewSelect>>

5. Operational Flow

  1. Launch via main.py
  2. Load data from JSON
  3. Sort using sorted() (Timsort)
  4. Search dynamically filters data
  5. User actions trigger save + refresh

6. Technical Challenges Solved

  • Fixed Windows taskbar icon using ctypes AppID
  • Optimized large dataset handling using Binary Search
  • Ensured EXE compatibility using resource path handling
  • Removed custom sorting in favor of Python built-in optimization

7. System Efficiency Summary

  • Search: O(log n)
  • Sorting: O(n log n)
  • Filtering: O(n)
  • UI: Event-driven real-time updates

End of Technical Documentation





DSA Final Project 2026
Group 1 • Byte Me Maybe

Clone this wiki locally