You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A full-stack e-commerce system built as a portfolio project. Four Spring Boot microservices communicate asynchronously via Apache Kafka, secured with JWT authentication, and served through a Vue.js frontend.
cd frontend
npm install
npm run dev # http://localhost:5173
API Reference
user-service — public
Method
Path
Description
POST
/auth/register
Register — returns JWT
POST
/auth/login
Login — returns JWT
product-service
Method
Path
Auth
Description
GET
/products
—
List all active products
GET
/products/{id}
—
Get product by ID
POST
/products
required
Create product
PUT
/products/{id}
required
Update product
PATCH
/products/{id}/deactivate
required
Deactivate product
order-service — all endpoints require JWT
Method
Path
Description
POST
/orders
Create order (userId extracted from token)
GET
/orders
List own orders (paginated, ?page=0&size=20)
GET
/orders/{id}
Get order by ID
GET
/cart
Get current user's cart
PUT
/cart/items
Add or update item in cart
DELETE
/cart/items/{productId}
Remove item from cart
DELETE
/cart
Clear cart
Tests
# All tests for a service
./mvnw -f services/order-service test# Unit tests only (fast)
./mvnw -f services/order-service test -Dtest="OrderServiceTest,CartServiceTest"# Single test class
./mvnw -f services/order-service test -Dtest=OrderServiceTest
Type
Class
What it tests
Unit
OrderServiceTest
Order creation, product validation, event publishing
Unit
CartServiceTest
Cart CRUD, add/update/remove items
Web layer
OrderControllerTest
HTTP routing, JWT auth, request/response format
Web layer
CartControllerTest
HTTP routing, JWT auth, cart endpoints
Integration
OrderEventPublisherIntegrationTest
Full Kafka flow with EmbeddedKafka + H2
Configuration
All sensitive values use environment variables with local defaults:
Variable
Default
Services
JWT_SECRET
development key
product, order, user
DB_URL
jdbc:postgresql://localhost:5432/<db>
product, order, user
DB_USERNAME
service-specific
product, order, user
DB_PASSWORD
service-specific
product, order, user
KAFKA_BOOTSTRAP_SERVERS
localhost:29092
order, payment
PRODUCT_SERVICE_URL
http://localhost:8081
order
JWT_EXPIRATION_MS
86400000 (24h)
user
Roadmap
Product catalog REST API
Order creation with Kafka event publishing
Mock payment processing via Kafka
Payment feedback loop — order status updated from Kafka events
Global exception handling with proper HTTP status codes
JWT authentication — user-service issues tokens, other services validate
Environment variable configuration
Vue.js frontend — products, cart, orders, live status via WebSocket
WebSocket real-time order status (STOMP, auto-reconnect)
Login redirect to intended page after authentication
Cart — localStorage persistence + backend API sync (local-first)
Pagination UI for orders list
Tests — unit (Mockito), web layer (MockMvc), integration (EmbeddedKafka)
Docker Compose — all services + Vue frontend via nginx reverse proxy