How tranduc312/shopizer works
Project Type & Purpose
• Shopizer is an open-source, headless e-commerce platform implemented as a multi-module Maven project.
• It exposes REST APIs (Spring Boot) for commerce operations (catalog, cart, checkout, etc.).
• It is consumed by separate frontends (Angular admin, React shop), but this repo contains only the Java backend.
High-Level Architecture
• sm-core-model – Domain Entities & Value Objects
• sm-core-modules – Pluggable integration modules (payment, shipping, order total, CMS cache)
• sm-core – Business logic layer (services, event configuration, Drools rule engine)
• sm-shop-model – DTOs / API models (mappers between domain and REST representations)
• sm-shop – Presentation layer (Spring Boot controllers, REST APIs, security, configuration)
Component Relationships & Data Flow
• User / Client (Angular Admin or React Shop) → HTTP(S) → sm-shop Controllers
• Controllers → (via Mapper) → Service Layer in sm-core
• Services → Business Modules (from sm-core-modules) + Domain Model (sm-core-model)
• Services → Repositories (JPA/Hibernate) → Relational DB (MySQL/H2)
• Some services fire Asynchronous Events → Event Listeners (indexing, cache invalidation)
• Integration modules invoke external systems:
– Payment gateways (Stripe, Braintree, PayPal)
– Shipping providers (UPS, USPS, custom)
– Cloud storage (AWS S3, GCP) for product and content files
– Email services (SES, SMTP)
– Search Engine (Elasticsearch) via mappings in sm-core resources
Architectural Patterns & Key Principles
• Layered Architecture:
– Presentation (sm-shop)
– Application Services (sm-core)
– Domain Model (sm-core-model)
– Infrastructure (Repositories, external modules)
• Modular / Plugin Pattern: sm-core-modules provides extension points for payment, shipping, order-total logic.
• Event-Driven Subsystem: Asynchronous event publishing and Drools for business rules.
• Configuration Profiles: Spring profiles for AWS, GCP, local, MySQL, etc.
• CI/CD & Deployment: Dockerfile for sm-shop, CircleCI, Jenkins pipelines, Maven wrapper across all modules.
2. To its right, stack two layers:
– sm-shop-model (DTO / Mapper)
– sm-core (Service Layer, Event Config, Drools)
3. Below sm-core, place sm-core-model (Domain Entities) and sm-core-modules (Plugins) side by side.
4. At the bottom, show “Relational DB (MySQL/H2)” and “Elasticsearch” side by side.
5. On the far right, attach clouds for “Payment Gateway”, “Shipping Provider”, “S3/GCP Storage”, “Email Service”.
– Controllers → mappers → services → domain/modules → repositories → DB
– Services → external modules → external services
– Services → event bus → listeners (e.g., indexing)
– Configuration loading from profiles (annotate Spring Config).
7. Cross-cutting concerns: Security filter chain (JWT, CORS, XSS), Configuration classes, Profile mechanisms.