A modular e-commerce platform built with a microservice architecture where each service is independent and can be
scaled individually. The system handles products, orders, users and payments through separate services that communicate
via REST APIs. It also includes AI-generated horoscopes as a digital product with PDF generation.
Architecture: Microservices with three independent backend services (User, Product, Order)
Authentication: JWT-based authentication with a centralised user service
Deployment: Docker Compose for local development, Docker Hub for image distribution
Testing: JUnit 5 with JaCoCo coverage reports for each microservice
Architecture & integrations
The project follows microservice principles where each service has its own responsibility and database.
Services communicate via REST APIs and can be deployed and scaled independently of one another.
User Service: Handles registration, login, JWT tokens and user permissions
Product Service: Product catalogue with CRUD operations, image handling and stock management
Order Service: Order handling, payments via Stripe and AI-generated horoscopes
Frontend: React SPA with Vite, served via Nginx in Docker
OpenAPI/Swagger: Automatic API documentation for all backend services
Stripe integration: Payment Intents API for secure payments and webhook handling
OpenAI/1min.ai: AI generation of personalised horoscopes based on user data
OpenPDF: Generates PDF documents for digital products (horoscopes)
Spring Actuator: Health checks and metrics for each service
Screenshots
1. Registration where users enter personal details to create an account and are automatically signed in.2. Product gallery with buy buttons and price information.3. The cart showing selected products, quantity and total.4. Stripe checkout with card payment and Klarna as an alternative.5. The AI flow where the customer's details are sent for product generation.6. The delivered horoscope with inline PDF viewing and a download option.7. Order history with status, total and item information.
Key features
User management: Registration, login, profile management and activity logging
Product catalogue: Create, edit and delete products with image upload and categorisation
Stock management: Real-time stock updates with reservation at purchase
Order handling: A complete order flow from cart to confirmation, with order history
Stripe payments: Secure card payments with Payment Intents and webhook validation
Entitlement system: Management of digital rights and consumable products
AI horoscopes: Personalised horoscopes generated with OpenAI and delivered as PDF
Analytics: Order statistics and sales data for administrators
Service-to-service communication: The Order Service calls the User and Product services for validation
Microservice architecture
Each service is fully independent with its own database (H2 for development) and can be deployed separately.
This gives the flexibility to scale specific parts of the system based on load.
Separation of concerns: Each service has a clear responsibility without overlap
Independent deployment: Services can be updated without affecting other parts of the system
Scalability: Individual scaling of services based on need (e.g. more Product Service instances)
Resilience: If one service goes down, the whole system is not necessarily affected
Docker Compose: A simple local development environment with all services and networking configured
Version control: Each service has its own Git repository as a submodule
Lessons
This project gave me a deep understanding of microservice architecture and the challenges that come with distributed
systems. Designing API contracts between services, handling service-to-service communication and ensuring data
consistency across service boundaries requires careful planning. Implementing JWT-based authentication shared across
all services taught me the importance of centralised user management and secure token validation.
Working with Stripe webhooks taught me the importance of idempotency and secure webhook validation to avoid double
charges. The Docker Compose configuration made it possible to run the whole system locally with realistic network
conditions, which sped up development considerably.