Python desktop application for managing library books with a Tkinter interface and Supabase backend.
This project provides a simple library system with separate user and admin access. It supports authentication, book management, searching, borrowing, and returning books through a desktop UI.
- User and admin login
- User and admin registration
- Role-based navigation after login
- View and search books
- Add books
- Delete books
- Borrow books
- Return books
- Windows
.exepackaging with custom app icon
- Python
- Tkinter
- Supabase REST API
- PyInstaller
LibraryManagementSystem-main/
|-- LibraryManagementSystem/
| |-- LoginRegisterSystem.py
| |-- adminview.py
| |-- userview.py
| |-- BB.py
| |-- RB.py
| |-- borrowBook.py
| |-- returnBook.py
| |-- supabase_db.py
| |-- authentication.py
| `-- database.sql
|-- asset/
| |-- book.png
| `-- book.ico
|-- requirements.txt
`-- README.md
- Login as
Useropens the user panel - Login as
Adminopens the admin panel - Logout returns to the login screen
- Borrow and return actions open separate desktop windows inside the same application process
- Windows
- Python 3.12 or newer
- A Supabase project
Install project dependencies:
py -m pip install -r requirements.txtInstall the executable builder:
py -m pip install pyinstallerSet your Supabase credentials before running the app:
$env:SUPABASE_URL="https://your-project.supabase.co"
$env:SUPABASE_KEY="your-supabase-key"The app can also fall back to values defined in supabase_db.py, but environment variables are the better approach.
Run the SQL in database.sql inside Supabase SQL Editor.
Required tables:
booksusersadmins
Schema:
create table if not exists books (
id bigint generated by default as identity primary key,
book_id text unique not null,
title text not null,
author text not null,
isbn text not null,
quantity integer not null default 0,
borrowed_time timestamptz,
return_time timestamptz
);
create table if not exists users (
id bigint generated by default as identity primary key,
username text unique not null,
password text not null
);
create table if not exists admins (
id bigint generated by default as identity primary key,
admin_username text unique not null,
admin_password text not null
);From the project root:
py .\LibraryManagementSystem\LoginRegisterSystem.pypy .\LibraryManagementSystem\authentication.pyTo package the app as a single Windows executable with the custom book icon:
py -m PyInstaller --onefile --windowed --icon .\asset\book.ico --add-data "asset\book.png;asset" --name LibraryManagementSystem .\LibraryManagementSystem\LoginRegisterSystem.pyGenerated file:
.\dist\LibraryManagementSystem.exeThis project currently stores passwords in plain text for both users and admins. That may be acceptable for a classroom demo, but it is not acceptable for production use. A real deployment should use hashed passwords and proper authentication flows.
- Hash user and admin passwords
- Add form validation for all inputs
- Restrict user permissions more clearly
- Add book edit functionality
- Improve UI styling and responsiveness
- Add screenshots to this README
Library Management System project for desktop-based book and account management.