Skip to content
This repository was archived by the owner on Aug 9, 2026. It is now read-only.
shan2003034Public archive

About

A multi-module Jakarta EE enterprise application demonstrating Session Beans, Message-Driven Beans, JMS messaging, asynchronous processing, and real-time system monitoring, built on Payara Server 6.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

223 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

TechMart Online

Enterprise E-Commerce Platform Modernisation β€” Jakarta EE 10

A multi-module Jakarta EE enterprise application demonstrating Session Beans, Message-Driven Beans, JMS messaging, asynchronous processing, and real-time system monitoring, built on Payara Server 6.

Java Jakarta EE Payara Maven MySQL JUnit5 License


πŸ“– About The Project

TechMart Online is an enterprise-grade e-commerce platform built to modernise a legacy monolithic system that struggled beyond 1,000 concurrent users. The rebuilt system runs on Jakarta EE 10 and Payara Server 6, using Session Beans (Stateless, Stateful, Singleton), Message-Driven Beans, JMS (point-to-point and publish/subscribe), and JNDI-based dependency injection to deliver:

  • ⚑ Real-time inventory synchronisation across multiple warehouses
  • πŸ“¦ Automated, asynchronous order processing
  • πŸ”” Live promotion broadcasts via WebSocket + JMS
  • πŸ“Š A live admin dashboard with system health & performance metrics
  • βœ… 126 passing JUnit 5 unit tests across the entire business-logic layer

✨ Features

Customer Storefront (techmart-web)

  • πŸ” Customer registration & login (BCrypt password hashing)
  • πŸ›οΈ Product catalogue browsing & single-product detail pages
  • πŸ›’ Stateful shopping cart (per-session, in-memory)
  • πŸ’³ Checkout with address management & PayHere payment gateway integration
  • πŸ”” Real-time promotion notifications via WebSocket

Admin Dashboard (admin-web)

  • πŸ“Š Live system health dashboard (memory, DB connections, JMS queue depth)
  • πŸ“¦ Inventory control across multiple warehouses
  • 🧾 Order and customer management
  • 🏷️ Product, category, brand & promotion management
  • πŸ‘₯ Staff account & role management
  • 🚦 Built-in traffic simulator for load testing (/api/simulate-traffic)

Core Engineering

  • Stateless, Stateful & Singleton EJBs with lifecycle-optimised design
  • OrderProcessorMDB β€” point-to-point JMS consumer (15-session pool) for order fulfilment
  • PromoNotificationMDB / WebSocketNotifierMDB β€” publish/subscribe JMS for promotions
  • @Asynchronous load-simulation service returning Future<String>
  • JNDI-managed connection pooling (TechMartPool) and JMS resources

πŸ“Έ System Screenshots

Staff Signin
Staff Signin
Live Admin Dashboard
Live Admin Dashboard
Admin Inventory Control
Admin Inventory Control
Master Data Management
Master Data Management
πŸ“· Click to see more screenshots
Image
Customer Management
Image
Order Management
Image
Order Details
Image
Product Management
πŸ“· Click to see more screenshots
Image
Promotions & Brodcasts
Image
Staff Management
Image
Customer Login
Image
Home
πŸ“· Click to see more screenshots
Image
Shopping Cart
Image
Checkout
Image
Single Product View

πŸ› οΈ Tech Stack

Layer Technology
Language Java 17
Platform Jakarta EE 10
Application Server Payara Server 6
Persistence Jakarta Persistence API (JPA) + Hibernate 6
Database MySQL 8 (via TechMartPool JDBC connection pool)
Messaging Jakarta Messaging (JMS) β€” Queue + Topic
Security jBCrypt password hashing
Frontend JSP, JSTL, HTML/CSS/JS, WebSocket
Build Tool Apache Maven (multi-module)
Testing JUnit 5, Mockito
Performance Testing Apache JMeter, VisualVM
IDE IntelliJ IDEA

πŸ—οΈ System Architecture

flowchart TB
    subgraph Client["🌐 Client Browser"]
        A1[Customer Storefront]
        A2[Admin Dashboard]
    end

    subgraph Presentation["Presentation Tier"]
        B1["techmart-web<br/>JSP + Servlets + WebSocket"]
        B2["admin-web<br/>JSP + Servlets + REST APIs"]
    end

    subgraph Business["Business Logic Tier β€” techmart-ejb"]
        C1["Stateless Beans<br/>Auth, Orders, Payments, Catalogue"]
        C2["Stateful Bean<br/>ShoppingCartBean"]
        C3["Singleton Beans<br/>SystemMonitorBean, StockManagerBean"]
        C4["Message-Driven Beans<br/>OrderProcessorMDB, PromoNotificationMDB"]
    end

    subgraph Messaging["Messaging"]
        D1["jms/OrderQueue<br/>(Point-to-Point)"]
        D2["jms/PromoTopic<br/>(Publish/Subscribe)"]
    end

    subgraph Data["Data Tier"]
        E1[("MySQL 8<br/>TechMartPool")]
    end

    A1 --> B1
    A2 --> B2
    B1 -->|"@EJB"| C1
    B1 -->|"@EJB"| C2
    B2 -->|"@EJB"| C1
    B2 -->|"@EJB"| C3
    C1 -->|"send"| D1
    D1 -->|"consume"| C4
    C1 -->|"publish"| D2
    D2 -->|"consume"| C4
    C1 -->|"JPA/Hibernate"| E1
    C2 -->|"JPA/Hibernate"| E1
    C3 -->|"JPA/Hibernate"| E1
    C4 -->|"JPA/Hibernate"| E1
Loading

Deployment unit: all four modules are packaged by techmart-ear into a single .ear file and deployed to Payara Server 6.


πŸ“‚ Project Structure

TechMartOnline/
β”‚
β”œβ”€β”€ techmart-ear/               # Root EAR β€” assembles all modules for deployment
β”‚
β”œβ”€β”€ techmart-ejb/                # βš™οΈ Business logic tier (24 EJBs)
β”‚   β”œβ”€β”€ src/main/java/com/techmart/ejb/         # Session Beans & MDBs
β”‚   β”œβ”€β”€ src/main/java/com/techmart/notification/# Email/notification helpers
β”‚   β”œβ”€β”€ src/main/resources/META-INF/            # persistence.xml
β”‚   └── src/test/java/com/techmart/ejb/         # 126 JUnit 5 test cases
β”‚
β”œβ”€β”€ techmart-web/                 # πŸ›οΈ Customer-facing storefront
β”‚   β”œβ”€β”€ src/main/java/com/techmart/web/          # Servlets
β”‚   β”œβ”€β”€ src/main/java/com/techmart/web/mdb/      # Web-tier MDB
β”‚   β”œβ”€β”€ src/main/java/com/techmart/web/websocket/# Real-time promo notifications
β”‚   └── src/main/webapp/                         # JSP pages, JS, images
β”‚       β”œβ”€β”€ home.jsp Β· login.jsp Β· register.jsp
β”‚       β”œβ”€β”€ cart.jsp Β· checkout.jsp Β· single-product.jsp
β”‚
β”œβ”€β”€ admin-web/                    # πŸ“Š Admin dashboard
β”‚   β”œβ”€β”€ src/main/java/com/techmart/api/          # REST-style metric/simulation APIs
β”‚   β”œβ”€β”€ src/main/java/com/techmart/filter/       # Auth/role filters
β”‚   └── src/main/webapp/                         # dashboard.jsp, manage-*.jsp
β”‚
β”œβ”€β”€ techmart-core/                # πŸ“¦ Shared library
β”‚   β”œβ”€β”€ src/main/java/com/techmart/entity/       # JPA Entities
β”‚   β”œβ”€β”€ src/main/java/com/techmart/dto/          # Data Transfer Objects
β”‚   β”œβ”€β”€ src/main/java/com/techmart/remote/       # EJB @Local/@Remote interfaces
β”‚   └── src/main/java/com/techmart/exception/    # Custom exceptions
β”‚
└── pom.xml                       # Parent Maven POM

πŸš€ Getting Started

Prerequisites

  • β˜• JDK 17
  • πŸ“¦ Apache Maven 3.9+
  • 🐟 Payara Server 6
  • 🐬 MySQL 8
  • IntelliJ IDEA (recommended)

Installation

  1. Clone the repository

    git clone https://github.com/shan2003034/TechMartOnline.git
    cd TechMartOnline
  2. Create the database

    CREATE DATABASE techmart_online;
  3. Configure the JDBC Connection Pool in Payara

    • Open Payara Admin Console β†’ Resources β†’ JDBC β†’ JDBC Connection Pools
    • Create a pool named TechMartPool using com.mysql.cj.jdbc.MysqlDataSource
    • Add a JNDI resource: java:/TechMartPool
  4. Configure JMS Resources in Payara

    • Resources β†’ JMS Resources β†’ create:
      • Queue: jms/OrderQueue + Connection Factory jms/OrderQueueFactory
      • Topic: jms/PromoTopic + Connection Factory jms/PromoTopicFactory
  5. Build the project

    mvn clean install

    This compiles all modules, runs the JUnit test suite, and produces techmart-ear/target/techmart-ear.ear.

  6. Deploy

    • Drop the .ear file into Payara's autodeploy/ directory, or
    • Deploy via Admin Console (http://localhost:4848)
  7. Access the application

    App URL
    Customer Storefront http://localhost:8080/techmart/
    Admin Dashboard http://localhost:8080/admin/

πŸ§ͺ Running the Tests

cd techmart-ejb
mvn test

This runs all 126 JUnit 5 test cases (with Mockito mocking) covering every Stateless, Stateful, Singleton and Message-Driven Bean in the business logic layer. Reports are generated under target/surefire-reports/.

Performance and scalability were additionally validated using Apache JMeter and VisualVM against the deployed application (see the project's Test Report for full results).


πŸ‘¨β€πŸ’» Author

Prasanna Lakshan

About

A multi-module Jakarta EE enterprise application demonstrating Session Beans, Message-Driven Beans, JMS messaging, asynchronous processing, and real-time system monitoring, built on Payara Server 6.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages