π Try the Pahana Edu Online Billing Web App: http://pahanaedu-paishanmadusha.eu-north-1.elasticbeanstalk.com/
| Role | Password | Mobile No | |
|---|---|---|---|
| Default Admin | admin@pahana.com | admin123 | 0700000000 |
| Default Staff | staff@pahana.com | staff123 | 0770000000 |
Pahana Edu is a Java-based web application developed as an academic project for a leading bookshop in Colombo, Sri Lanka. The system streamlines operations such as customer management, inventory handling, customer billing, reporting, and user access control. It supports Admin and Staff user roles, integrates with MongoDB, and features a clean, responsive UI built with Bootstrap. The application runs on Apache Tomcat 9 and is deployed using AWS Elastic Beanstalk.
- Features
- Technologies Used
- Project Architecture
- Setup & Installation
- Deployment
- Screenshots
- About This Project
- License
- Admin and Staff Login with role-based access control.
- Forgot Password feature allows users to reset their password via a registered mobile number.
- Manage Users: Add, view, update & delete Admin/Staff accounts.
- Manage Items: Maintain inventory of books and stationery.
- View Bills: Access, print, or delete bills generated by staff.
- Reports: Staff-wise bill counts, revenue reports, and date filters.
- Audit Logs: Tracks admin and staff login/logout activities.
- Admin Help Guide: Instructions for using the admin panel.
- Add Customer: Register new customers with auto-generated account numbers.
- Manage Customers: View, edit, delete customer accounts.
- View Items: Search and filter available books and stationery.
- Generate Bill: Create bills with selected customer and items.
- Billing History: View, print, or delete previous bills.
- Staff Help Guide: Instructions and usage tips for the staff panel.
- MongoDB Connection: Automatically switches between local and production database URIs using environment variables.
The following technologies are used in this project:
| Layer | Technologies |
|---|---|
| Development | IntelliJ IDEA (Ultimate Edition). |
| Frontend | HTML5, CSS3, JavaScript, Bootstrap 5, JSTL for JSP. |
| Backend | Java Servlet & JSP, Maven (Build Tool), MongoDB (Localhost & Atlas), SLF4J Logging, JUnit 5 (Testing). |
| Runtime | Apache Tomcat 9. |
| Deployment | AWS Elastic Beanstalk (WAR File Upload), GitHub Actions (CI/CD via Deploy Branch). |
The project follows professional Object-Oriented Design principles using both MVC and 3-Tier Architecture. Below is a brief overview of the applied concepts:
* Model classes (e.g., User, Customer, Bill, etc.) encapsulate data using private fields with public getters and setters.
* Admin and Staff classes extend the abstract User class, each overriding methods like getRole() to implement role-specific behavior.
* The User class is abstract, defining a shared structure for all user types & Interfaces (e.g., BillRepository, etc.) abstract core operations like billing, providing a clear contract for implementations.
* The method createUserFromDocument() acts as a factory, dynamically returning an instance of Admin or Staff based on the role field from MongoDB documents.
* The MongoDBConnection class implements the Singleton Pattern to ensure a single, reusable database connection instance throughout the application.
pahana-edu-web-app/
β
βββ src/
β βββ main/
β | βββ java/
β | β βββ com.example.pahanaeduwebapp/
β | β βββ dao/ # Data Access Objects for database interactions
β | β βββ model/ # Representing data models
β | β βββ repository/ # Interfaces to abstract data logic
β | β βββ servlet/ # Java Servlets handling HTTP requests/responses
β | β βββ util/ # Utility classes (e.g., MongoDBConnection)
β | β
β | βββ resources/
β | β
β | βββ webapp/ # Web content root (JSPs, static files, and web directories)
β | βββ admin/ # Admin-specific pages
β | βββ assets/ # Bootstrap, CSS, JS, images, and other static assets
β | βββ components/ # Reusable frontend components
β | βββ staff/ # Staff-specific pages
β | βββ WEB-INF/
β | βββ forgot-password.jsp # Forgot Password page
β | βββ index.jsp # Landing page
β | βββ login.jsp # Login page
β | βββ reset-password.jsp # Reset-password page
| βββ test/
| βββ java/
| βββ com.example.pahanaeduwebapp/
| βββ dao/ # DAO unit tests
| βββ model/ # Model validation tests
βββ .gitignore
βββ LICENSE
βββ pom.xml
βββ README.md
Follow these steps to run the project locally:
π Development Environment:, IDE: IntelliJ IDEA (Ultimate Edition), Runtime Server: Apache Tomcat 9, Database: MongoDB (Localhost or Atlas)
git clone https://github.com/PAIshanMadusha/pahana-edu-web-app.git
cd pahana-edu-web-app* IntelliJ IDEA will automatically detect the project structure and download all Maven dependencies upon opening the project.
* Install MongoDB Compass or create a cluster on MongoDB Atlas.
* Go to **Run > Edit Configurations > Startup/Connection > Environment Variables & Add: MONGODB_URI=<your_connection_string>
Artifact is deployed successfully
MongoDB Connected Successfully to database: pahana_edu
Default admin created: admin@pahana.com / admin123mvn clean packageSome screenshots of the system are shown below:
| Landing Page | Login Page |
|---|---|
| Admin Dashboard | Staff Dashboard |
|---|---|
| Manage Items | View Reports |
|---|---|
| View Items | Generate Bills |
|---|---|
| Help Guide | Bill Details |
|---|---|
This project was developed as part of an assignment for Cardiff Metropolitan University. It is a full-stack web application designed to manage core operations of a bookshop, including user management, item inventory, customer billing, and reporting. The system follows Object-Oriented Programming (OOP) principles and integrates modern development tools and technologies.
Ishan Madhusha
GitHub: PAIshanMadusha
Feel free to explore my work and get in touch if you'd like to collaborate! π
This project is licensed under the MIT License : See the LICENSE file for details.









