Frontend Repo: https://github.com/malakasaber/ECommerceSystem_Frontend
Project Demo: https://drive.google.com/file/d/1yZc-7vJwi4sl1XabbeYBlKAKOP6drESl/view?usp=sharing
Microservices Architecture • Python Flask • Java JSP (Jakarta EE) • MySQL • SOA Project
This project is part of the Service-Oriented Architecture course. It demonstrates how to design and build an E-Commerce Order Management System using microservices, REST APIs, distributed databases, and a Java JSP frontend acting as an API Gateway.
The system simulates real-world architecture used in online shopping platforms.
/project-root
├──services
| ├── order_service/ # Flask microservice (Port 5001)
| ├── inventory_service/ # Flask microservice + MySQL (Port 5002)
| ├── pricing_service/ # Flask microservice + MySQL (Port 5003)
| ├── customer_service/ # Flask microservice + MySQL (Port 5004)
| ├── notification_service/ # Flask microservice (Port 5005)
│
├── database/
│ ├── dbQueries.sql
│
└── README.md
- Java JSP
- Servlets (Jakarta EE)
- Apache Tomcat 10.x
Each service uses:
- Python 3.8+
- Flask
- Requests (inter-service communication)
- mysql-connector-python (where required)
- MySQL 8.0
- Multiple service-specific tables
| Service | Port |
|---|---|
| JSP Gateway | 8080 |
| Order Service | 5001 |
| Inventory Service | 5002 |
| Pricing Service | 5003 |
| Customer Service | 5004 |
| Notification Service | 5005 |
- Accepts order creation requests
- Validates input
- Generates order ID and timestamp
- Returns confirmation
Endpoints
POST /api/orders/createGET /api/orders/<order_id>
- MySQL-powered service
- Checks product stock
- Updates inventory
- Fetches unit price
Endpoints
GET /api/inventory/check/<product_id>PUT /api/inventory/update
Database Table: inventory
Fields: product_id, product_name, quantity_available, unit_price, last_updated
- Calculates final pricing
- Fetches discounts & taxes
- Calls Inventory Service
Endpoint
POST /api/pricing/calculate
Database Tables
pricing_rulestax_rates
- Manages customer data
- Fetches profile
- Retrieves order history (calls Order Service)
- Updates loyalty points
Endpoints
GET /api/customers/<customer_id>GET /api/customers/<customer_id>/ordersPUT /api/customers/<customer_id>/loyalty
- Aggregates data from Customer + Inventory services
- Logs notifications
- Simulates email/SMS sending
Endpoint
POST /api/notifications/send
Database Table
notification_log
- index.jsp → Loads product catalog from Inventory Service
- checkout.jsp → User selects products & submits order
- confirmation.jsp → Displays order details
- Reading JSP form input
- Sending JSON requests to Python services
- Forwarding responses to JSP
Example: OrderServlet.java
CREATE DATABASE ecommerce_system;
USE ecommerce_system;(from Inventory, Pricing, Customer, Notification services)
- Products
- Pricing rules
- Customers
CREATE USER 'ecommerce_user'@'localhost' IDENTIFIED BY 'secure_password';
GRANT SELECT, INSERT, UPDATE ON ecommerce_system.* TO 'ecommerce_user'@'localhost';
FLUSH PRIVILEGES;-
Install:
- Python 3.8+
- MySQL 8.0
- Java JDK 17+
- Apache Tomcat 10
-
Clone this repository
-
Create database + tables
-
Configure credentials in each microservice
python -m venv env
source env/bin/activate # Mac/Linux
env\Scripts\activate # Windowspip install flask mysql-connector-python requestspython app.py- Open JSP project in NetBeans/IntelliJ
- Add Jakarta EE + Tomcat server
- Deploy app to Tomcat (port 8080)
- User selects products → JSP sends POST to OrderService
- OrderService validates → calls PricingService
- PricingService → calls InventoryService & DB
- OrderService finalizes → returns order_id
- NotificationService receives order_id → calls CustomerService + InventoryService
- Notification logged + output simulated
- Use Postman to test individual microservices
- Use
curlfor REST endpoints - JSP pages test the entire workflow end-to-end