How sosow0212/2024-pop-cloud works
Project Type and Purpose
• This is a full-stack platform that consolidates popup store information and personal exhibition data. It provides a map-based recommendation service, authentication (via OAuth, e.g., Kakao), and is built to later integrate payment capabilities.
• The project is divided between a frontend (built with Next.js and various UI components) and a robust backend (Java, built with Gradle, split into multiple modules). The backend itself is organized into several logically separated modules – API, batch processing, common utilities, domain logic, and infrastructure.
Analyzing the File Structure
• Top-level directories include:
• Frontend: Contains Next.js application code (pages, components, hooks, etc.), configuration (next.config.mjs, tailwind.config.ts), and storybook setups.
• Backend: Contains multiple Gradle projects:
• pcloud-api: The main API server containing controllers, service layers, auth modules, map, show, exhibition, popups, and recommendation functionalities.
• pcloud-batch: A batch processing module to handle scheduled tasks (e.g., handling exhibition caches, popping notifications, etc.).
• pcloud-common: Shared utilities and configurations (like auth token providers, custom exceptions, event configurations).
• pcloud-domain: Contains the domain model, entity definitions, domain-specific services, and integration with persistence (repositories, query modules) for members, shows, exhibitions, popups, and recommendations.
• pcloud-infrastructure: This module holds infrastructure-related configurations such as Redis and distribution/lock management, integration with external services (S3, Slack), and exception handling for distributed environments.
• Notice that there are several directories dedicated to testing (unit and integration) and configuration files (application.yml, build.gradle, etc.), reinforcing a well-layered architecture.
Key Architectural Components and Their Interactions
• Frontend Component:
• Built using Next.js with a clear separation of pages, layouts, UI components, and state management (using stores and hooks).
• Communicates with backend services through defined API endpoints (e.g., authentication endpoints, map/search APIs, show addition, etc.).
• Backend API (pcloud-api):
• Acts as the main entry point for HTTP requests coming from the frontend.
• Contains controllers (handling REST endpoints), service layers (application logic like AuthService, MapQueryService, ShowQueryService, etc.), and presentation layers.
• Implements features such as OAuth authentication (with dedicated configurations and implementations for Kakao), map-based recommendations, and handling of show-related data.
• Batch Processing Module (pcloud-batch):
• Runs scheduled jobs (batch processes) to handle background tasks such as cache clearing or updating recommendations.
• Uses specific batch services and publishers to trigger events that are later processed by the API or domain layers.
• Domain and Common Modules (pcloud-domain and pcloud-common):
• Business logic and core domain models (entities like Member, Exhibition, Popups, etc.) along with rules, events, exceptions, and shared utilities.
• Infrastructure Module (pcloud-infrastructure):
• Provides integration with external services – for instance, configuring Redis caches, setting up S3 for file/image storage, managing locking and idempotency for distributed or batch tasks.
• Contains aspects and utilities for ensuring distributed locking (e.g., distribution locks) and smooth integration with external APIs.
Final Elements
• Labels for each component (e.g., “Frontend (Next.js)”, “API Gateway / pcloud-api”, “Domain Logic”, “Batch Processing”, “Infrastructure Integrations”).
• Annotations showing technologies used (e.g., Gradle, Spring Boot, Redis, OAuth) and key configuration points (e.g., authentication processing, external API interactions).