A small desktop library management system built with PyQt6 and MongoDB. Features include user roles (Admin, Librarian, User), book CRUD, requests for loan/renew/return, and simple reports.
- PyQt6 GUI (admin, librarian, and user interfaces)
- MongoDB backend (users, books, requests, loans collections)
- Built-in default admin user created on first run (username:
admin, password:admin)
- Python 3.10+ (the project was developed with Python 3.13)
- MongoDB running locally (default port)
- Git (to upload to GitHub)
- Clone the repo and cd into it:
git clone https://github.com/mnnjbb2006-cmyk/BookFlow
cd BookFlow- Create a virtual environment and activate it (recommended):
python3 -m venv .venv
source .venv/bin/activate # zsh / bash- Install dependencies:
pip install -r requirements.txt-
Ensure MongoDB is running on the default port (27017). The app expects a local MongoDB instance. On first run a default admin user (
admin/admin) will be created if theuserscollection is empty. -
Run the application (desktop GUI):
python main.pymain.py— login dialog and app entry pointadmin.py,librarian.py,user.py— UI windows generated by PyQt and application logic wiringdb.py— MongoDB connection and collection handlesCollections/— helpers forusersandbookscollectionsservices/— helpers forloansandrequests
- Admin user created automatically if collection is empty:
- Username:
admin - Password:
admin
- Username:
Change the password immediately in production; passwords are stored as SHA-256 hashes in the database.
- MongoDB connection: if the app prints "Cannot connect to the database; make sure MongoDB is running on the default port." start
mongodor pointdb.pyto your MongoDB URI. - UI files were generated by
pyuic6. If you re-generate them, manual edits might be overwritten. - The app uses a simple hashed password approach (SHA-256). For a production deployment you should use a stronger password hashing method (bcrypt/argon2) and secure the DB.
- Improve tests, add CI, and migrate to a packaged application (PyInstaller / briefAppImage) if packaging is needed.
See the bundled LICENSE file.