A small Java Swing desktop app that simulates a library system. It has:
- Login / Register screens
- Admin dashboard (manage users, manage books, impersonate a user)
- User dashboard (borrow / return books, change password)
- Book "stock" (quantity) tracking
- Data saved to simple .properties text files on disk (no database)
- Open a terminal/command prompt in the project folder (where LibraryLoginApp.java is).
- Compile: javac -encoding UTF-8 LibraryLoginApp.java
- Run: java LibraryLoginApp
On first run the app will create a "data" folder and seed two accounts.
-
Admin invite code (required when registering an admin): LIB-ADMIN-2025
-
Seeded accounts (created automatically if no accounts exist): • admin / admin123 (admin) • user / user123 (regular user)
-
Borrow limit: a user can borrow up to 5 books at a time.
Plain text .properties files under the "data" folder:
-
Accounts: data/accounts/.properties Example keys: username, password, firstName, lastName, type, createdAt, lastLoginAt
-
Books: data/books/.properties Example keys: id, title, author, stock, available, borrowers, borrowedAt.
You can reset the app by closing it and deleting the "data" folder.
- Launch the app.
- Log in:
- Use admin/admin123 to manage users and books.
- Use user/user123 to try borrowing/returning.
- As Admin:
- Manage Users: add/remove/edit users; impersonate a user to see their view.
- Manage Books: add books, adjust stock, remove books.
- As User:
- "Borrow Books" shows only books with stock > 0.
- Select a book and click "Borrow Selected".
- Return a book from "My Borrowed Books".
- Change password from your dashboard.