How imtaemin/myshop works
Project Type and Purpose
• MyShop is a full‐stack online shop platform with three Dockerized applications:
a. api (Spring Boot REST API)
b. customer (React customer portal)
c. provider (React seller portal)
• It implements features such as user authentication (JWT), carts, orders, coupons, favorites, file storage (GCP), and external payment (KakaoPay).
• CI/CD is orchestrated via Jenkins; Nginx handles load balancing and multi‐domain routing; MySQL with master‐replica (write–read) replication is used as the DB layer.
Key Components
a. Users
• Customer users (browsers)
• Provider users (browsers)
b. Nginx Layer
• Acts as edge router / load balancer
• Routes “/api” requests to api containers
• Serves or proxies static content for customer and provider frontends on separate domains
c. Dockerized Applications
• customer‐app containers (React)
• provider‐app containers (React)
• api containers (Spring Boot REST service)
d. CI/CD Pipeline (Jenkins)
• Monitors code repo
• Builds images for api, customer, provider
• Pushes images to a registry (optional) and deploys to hosting environment
e. Database Tier
• MySQL master for writes
• MySQL replicas for read queries
• JPA/QueryDSL in api service handles routing to master/replica via the RoutedDataSource
f. External Services
• GCP Cloud Storage for item images (via GCPStorageService)
• KakaoPay API for payment processing (via KakaoPayService)
Relationships and Data Flows
• Browser → Nginx
• customer.myshop.com → serves React static files from customer container
• provider.myshop.com → serves React static files from provider container
• api.myshop.com → proxies REST API requests to api containers
• customer‐app ↔ api
• Auth, item listings, cart, favorites, orders, coupons
• provider‐app ↔ api
• Provider’s item management, coupon issuance, order management
• api → MySQL master (writes via services/repositories)
• api → MySQL replica(s) (reads, analytics, paginated queries)
• api → GCP Cloud Storage (upload/download item images)
• api → KakaoPay (payment readiness, approval)
• Jenkins → Git → on‐commit triggers → build → docker push → deploy (update Nginx upstreams)
Architectural Patterns and Design Principles
• Layered Architecture in api:
• Controller → Service → Repository (with JPA + QueryDSL)
• Annotation‐driven security (JwtAuthenticationFilter, SecurityConfig)
• Read–Write Splitting via RoutingDataSource for DB replication
• Containerization: each service is an independent Docker image
• CI/CD for immutable infrastructure and zero‐downtime deploys
• Externalization of config: Spring profiles (dev, prod, GCP, JWT, pay)