A modular Java EE marketplace platform built around a central REST API, asynchronous JMS messaging, and independently persisted subsystems.
The application supports the core workflows of an online marketplace: user and account management, product listings, shopping carts, wishlists, orders, and transaction tracking. Its distributed architecture separates these responsibilities into independently running applications with dedicated MySQL databases.
- Request/response communication between the API gateway and backend services over JMS
- Clear separation of user, catalog, and order-processing domains
- Independent persistence context and database for each subsystem
- JAX-RS API layer consumed by a standalone Java client
- JPA entity models and persistence through EclipseLink
- Role-based workflows for administrators, sellers, and customers
- User login and role-based actions
- City, user, and account balance management
- Product category and item management
- Seller-side price and discount updates
- Shopping cart management
- Wishlist management
- Order and transaction overview
- REST API exposed through a central server
- Asynchronous communication between the central server and subsystems using JMS
- Separate MySQL databases for each subsystem
flowchart LR
Client[Console Client] -->|HTTP / REST| API[Central Java EE API]
API -->|JMS| S1[User Subsystem]
API -->|JMS| S2[Catalog Subsystem]
API -->|JMS| S3[Order Subsystem]
S1 --> DB1[(User Database)]
S2 --> DB2[(Catalog Database)]
S3 --> DB3[(Order Database)]
The system is composed of five Java applications:
Centar- central Java EE application that exposes REST endpoints and coordinates requests through JMSClient- console-based Java client that sends REST requests to the central serverPodsistem_1- user, role, city, and account balance managementPodsistem_2- category, product, cart, and wishlist managementPodsistem_3- order and transaction processing
The central server does not own domain data. It acts as an API gateway and coordination layer between the client and the three backend subsystems.
- Java 8
- Java EE 8
- JAX-RS
- JMS
- JPA / EclipseLink
- MySQL
- Maven and Ant
- NetBeans
- GlassFish application server
.
+-- baze/
| +-- podsistem_1_*.sql
| +-- podsistem_2_*.sql
| +-- podsistem_3_*.sql
+-- java aplikacije/
| +-- Centar/
| +-- Client/
| +-- Podsistem_1/
| +-- Podsistem_2/
| +-- Podsistem_3/
The main implementation is in java aplikacije. The baze directory contains initial SQL dump files used to create and populate the MySQL databases.
The project uses three MySQL databases:
podsistem_1podsistem_2podsistem_3
Initial SQL files are included in the baze directory and should be imported before running the applications.
Each subsystem reads its connection settings from its persistence.xml file. Before running the applications, update the JDBC URL and credentials to match your local MySQL environment. The default database host and port are localhost:3306.
The applications expect the following JMS resources to be configured on the application server:
| Resource | Purpose |
|---|---|
connFactory1 |
JMS connection factory |
myQueue1 |
Requests for subsystem 1 |
myQueueO1 |
Responses from subsystem 1 |
myQueue2 |
Requests for subsystem 2 |
myQueueO2 |
Responses from subsystem 2 |
myQueue3 |
Requests for subsystem 3 |
myQueueO3 |
Responses from subsystem 3 |
- Import the SQL files from
bazeinto MySQL. - Configure the required JMS connection factory and queues on the application server.
- Update the database credentials in each subsystem's
persistence.xmlfile. - Open the projects from
java aplikacijein NetBeans. - Start the subsystem applications:
Podsistem_1Podsistem_2Podsistem_3
- Deploy
Centarto GlassFish. - Run the
Clientconsole application.
The client sends requests to:
http://localhost:8080/Centar/api
The central server exposes a REST API under /api.
| Method | Endpoint | Description |
|---|---|---|
POST |
/ss1/1 |
Validate user credentials |
POST |
/ss1/2 |
Create a city |
POST |
/ss1/3 |
Create a user |
POST |
/ss1/4 |
Add money to a user account |
POST |
/ss1/5 |
Update a user's address and city |
GET |
/ss1/15 |
Get all cities |
GET |
/ss1/16 |
Get all users |
POST |
/ss1/100 |
Check administrator role |
| Method | Endpoint | Description |
|---|---|---|
POST |
/ss2/6 |
Create a category |
POST |
/ss2/7 |
Create an item |
POST |
/ss2/8 |
Update item price |
POST |
/ss2/9 |
Set item discount |
POST |
/ss2/10 |
Add item to cart |
POST |
/ss2/11 |
Remove item from cart |
POST |
/ss2/12 |
Add item to wishlist |
POST |
/ss2/13 |
Remove item from wishlist |
GET |
/ss2/17 |
Get all categories |
POST |
/ss2/18 |
Get items sold by a user |
POST |
/ss2/19 |
Get cart contents |
POST |
/ss2/20 |
Get wishlist contents |
| Method | Endpoint | Description |
|---|---|---|
POST |
/ss3/21 |
Get all orders for a user |
GET |
/ss3/22 |
Get all orders |
GET |
/ss3/23 |
Get all transactions |
This repository focuses on the Java applications and database initialization files. Generated build outputs and local IDE files are intentionally excluded from version control.