A Java-based Bookshop Management System developed as a group assignment for the Object-Oriented Programming module. The system automates bookshop transactions using core OOP principles with a JavaFX graphical interface and file-based data storage.
- π City Bookshop β OOP Group Assessment
City Bookshop is a desktop application that supports two user roles:
Cashier
- View all books
- Search books by name, category, and price
- View stock levels
Manager (all Cashier features plus)
- Add new books and categories
- Create new user accounts (Cashier or Manager)
- User Authentication: Secure login system with role-based access control
- Book Management: Add, view, and search books with detailed information
- Category Management: Organize books into categories
- Stock Tracking: Monitor inventory levels
- User Management: Create and manage user accounts (Manager only)
- File-Based Storage: Persistent data storage using plain text files
- Intuitive GUI: User-friendly interface built with JavaFX
| Technology | Purpose |
|---|---|
| Java JDK 17+ | Core programming language |
| JavaFX | Graphical User Interface |
| Java File I/O | Data storage and retrieval |
| Scene Builder | FXML screen design |
| Git & GitHub | Version control and collaboration |
CityBookshop/
β
βββ src/
β βββ com/citybookshop/
β βββ Main.java
β β
β βββ model/
β β βββ User.java
β β βββ Cashier.java
β β βββ Manager.java
β β βββ Book.java
β β βββ Category.java
β β
β βββ service/
β β βββ FileHandler.java
β β βββ UserService.java
β β βββ BookService.java
β β βββ CategoryService.java
β β
β βββ controller/
β β βββ LoginController.java
β β βββ DashboardController.java
β β βββ BookController.java
β β βββ StockController.java
β β βββ AddBookController.java
β β βββ AddCategoryController.java
β β βββ AccountController.java
β β
β βββ view/
β βββ Login.fxml
β βββ Dashboard.fxml
β βββ Books.fxml
β βββ Stock.fxml
β βββ AddBook.fxml
β βββ AddCategory.fxml
β βββ CreateAccount.fxml
β
βββ data/
β βββ books.txt
β βββ categories.txt
β βββ users.txt
β
βββ docs/
βββ Assignment_Specification.pdf
| Concept | Where It Is Applied |
|---|---|
| Class & Object | Book, User, Category classes instantiated as objects |
| Encapsulation | All fields are private with getters and setters |
| Inheritance | Cashier and Manager both extend abstract User |
| Abstraction | User is abstract with abstract method getDetails() |
| Polymorphism | getDetails() behaves differently in Manager vs Cashier |
| Screen | Access |
|---|---|
| Login | All users |
| Dashboard | All users (role-based menu) |
| View Books | All users |
| Search Books | All users |
| View Stock | All users |
| Add New Book | Manager only |
| Add Category | Manager only |
| Create Account | Manager only |
All data is stored in plain text files inside the /data folder.
users.txt
USR001|admin|123|Manager
USR002|kabil|1896|Manager
books.txt
BK001|Clean Code|Robert C. Martin|4500|12|Programming
BK002|The Pragmatic Programmer|Andrew Hunt|5200|8|Programming
BK003|Introduction to Algorithms|Thomas H. Cormen|7800|5|Computer Science
BK004|Design Patterns|Erich Gamma|6000|7|Software Engineering
categories.txt
CT001|Programming|Books related to software development, coding practices, and programming languages
CT002|Computer Science|Core computer science concepts including algorithms, data structures, and systems
- Java JDK 17 or higher: Download from Oracle or use OpenJDK
- JavaFX SDK: Download from Gluon
- IDE: IntelliJ IDEA, Eclipse, or VS Code with Java support
-
Clone the repository
git clone https://github.com/KabileshwaranKabil/CityBookshop-JavaFX.git cd CityBookshop-JavaFX -
Open the project in your IDE
- For IntelliJ IDEA: File > Open > Select the project folder
- For Eclipse: File > Import > Existing Projects into Workspace
-
Add JavaFX SDK to the project
- In IntelliJ IDEA: File > Project Structure > Libraries > Add JavaFX SDK
- In Eclipse: Right-click project > Properties > Java Build Path > Libraries > Add External JARs
-
Configure VM options
Add the following VM options to your run configuration:
--module-path /path/to/javafx-sdk/lib --add-modules javafx.controls,javafx.fxmlReplace
/path/to/javafx-sdkwith the actual path to your JavaFX SDK. -
Run the application
- Run
Main.javaas the main class - The application will start and display the login screen
- Run
-
Login with default credentials
Username: admin Password: 123
- If you encounter JavaFX-related errors, ensure the module path and add-modules are correctly set
- Make sure your JDK version is 17 or higher
- Check that all FXML files are in the correct path
- Login: Enter your username and password
- Dashboard: Navigate through different sections based on your role
- View Books: Browse and search the book catalog
- Manage Stock: Check inventory levels
- Add Books/Categories: (Manager only) Add new items to the system
- User Management: (Manager only) Create new user accounts
We welcome contributions to improve the City Bookshop project! Here's how you can contribute:
- Fork the repository on GitHub
- Create a feature branch:
git checkout -b feature/your-feature-name - Make your changes and ensure they follow the project's coding standards
- Test your changes thoroughly
- Commit your changes:
git commit -m 'Add some feature' - Push to the branch:
git push origin feature/your-feature-name - Open a Pull Request on GitHub
- Follow Java naming conventions
- Add comments to complex logic
- Ensure all new code includes appropriate error handling
- Update documentation if necessary
- Test your changes before submitting
If you find a bug or have a feature request, please open an issue on GitHub with:
- A clear title and description
- Steps to reproduce (for bugs)
- Expected vs. actual behavior
- Screenshots if applicable
This project is licensed under the MIT License - see the LICENSE file for details.
- Special thanks to our OOP lecturer for the guidance and assignment specification
- Appreciation to the open-source community for the tools and libraries used
- Thanks to all group members for their collaboration
| Name | |
|---|---|
| M. Kabileshwaran | kabileshwaran1896@gmail.com |
| M. Dinush Khan | dinushkhan1214@gmail.com |
| Praveen | praveenvimukthi2003@gmail.com |
| Indunil | indunilexm2022@gmail.com |
| Aakash | akashliyanage16@gmail.com |
Explore the user interface of the City Bookshop application through the following gallery:
| Login Page | Dashboard |
|---|---|
![]() |
![]() |
| View Books | View Stocks |
|---|---|
![]() |
![]() |
| Add New Book | Add New Category |
|---|---|
![]() |
![]() |
| Add New User |
|---|
![]() |
Developed by DCS 22/23 Devs
OOP Group Assignment Β· 2026
If you find this project useful, please consider giving it a β on GitHub!






