Get Up and Running
This guide will take you from zero to a fully functional library kiosk in just a few steps.Prerequisites: Python 3.11+, pip, and git installed on your system.
Install Dependencies
Install all required Python packages:This installs:
nicegui- Web UI frameworkhttpx- For Open Library API callsbcrypt- Password hashingfastapi- Backend framework- And other supporting libraries
Seed the Database
Populate the database with the initial catalog and test accounts:
This creates
cs_library.db and seeds it with:- 16 books from the CS Library shelves
- 3 test user accounts
Test Accounts Created
| Name | Student ID | Password | |
|---|---|---|---|
| Kenneth Molina | [email protected] | 12345 | changeme123 |
| Jose Gaspar | [email protected] | 11111 | changeme123 |
| Professor James | [email protected] | 99999 | changeme123 |
Log In and Test
Open your browser to
http://localhost:8080 and test the login:- Student Login: Enter student ID
12345at the login screen - Browse Catalog: View the paginated book catalog
- Test Checkout: Scan or enter an ISBN like
0471170828 - View My Books: Navigate to the My Books tab
The login screen accepts student ID input via keyboard or barcode scanner (scanner acts as keyboard input).
Understanding the Workflow
Student Workflow
How Checkout Works
When you scan a book ISBN:- System checks local database for the book
- If not found, queries Open Library API
- Book details displayed with cover image
- Add to cart (supports multiple books)
- Confirm checkout - books marked “Checked Out”
- Due date automatically set to 14 days from today
Database Initialization
The first time you runpython3 main.py, the system automatically calls:
database.py
users, books, and loans.
Common Tasks
Adding a New Book
Books are automatically added when you scan a new ISBN. The system:- Queries Open Library API
- Retrieves metadata (title, author, cover)
- Caches locally in
cs_library.db
database.py
Checking Out Books
The checkout flow supports adding multiple books to a cart:main.py
Renewing Books
Students can renew books from the My Books tab:database.py
Next Steps
Full Installation Guide
Detailed setup for production deployment
Core Features
Complete feature documentation
Troubleshooting
Database Not Found Error
If you seecs_library.db not found:
- Run
python3 main.pyfirst (creates database) - Then run
python3 mock_data.pyto seed data
Import Errors
If you see module import errors:Port Already in Use
If port 8080 is already taken, modifymain.py:
main.py
Need help? Check the Installation Guide for more detailed troubleshooting steps.