Skip to content

Latest commit

Β 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

sb3-react-animalduo β€” Global Pet Product Commerce Platform

✍️ Author

  • Name: Shiwoo Min
  • Role: Full-Stack Developer Β· DevOps Engineer Β· Founder of Artiordex
  • Contact: artiordex@gmail.com

πŸ“ Overview

AnimalDuo is a comprehensive global pet product commerce platform that combines the power of Spring Boot 3 backend with a modern React frontend. The platform features a modular microservice architecture, comprehensive RESTful APIs, and Hibernate ORM for robust data management. Designed with scalability in mind, AnimalDuo provides a complete e-commerce solution for pet products, including inventory management, order processing, payment integration, and multi-language support for global reach.

πŸš€ Goals

  1. Master Spring Boot 3 features including native compilation and improved performance
  2. Implement reactive programming with Spring WebFlux for high-throughput operations
  3. Build robust data layer using Hibernate 6 with advanced ORM features
  4. Create scalable microservice architecture with clean API boundaries
  5. Develop modern React frontend with TypeScript and state management
  6. Integrate payment gateways and multi-currency support for global commerce
  7. Implement comprehensive testing strategies for API testing and integration
  8. Design cloud-native architecture ready for containerization and deployment

βš™οΈ Tech Stack

Backend

  • Framework: Spring Boot 3.2, Spring Security 6
  • Database: PostgreSQL 15, Hibernate 6.4, JPA
  • Caching: Redis 7, Spring Cache
  • Message Queue: RabbitMQ, Spring AMQP
  • API: Spring WebFlux, RESTful APIs, OpenAPI 3
  • Testing: JUnit 5, TestContainers, MockMvc
  • IDE: IntelliJ IDEA Ultimate 2024.x

Frontend

  • Framework: React 18, TypeScript, Vite
  • State Management: Redux Toolkit, React Query
  • UI Library: Material-UI (MUI), Tailwind CSS
  • Routing: React Router v6
  • Testing: Jest, React Testing Library
  • IDE: Visual Studio Code with Extensions

DevOps & Infrastructure

  • Build: Maven 3.9, Docker, Docker Compose
  • Monitoring: Spring Actuator, Micrometer, Prometheus
  • Documentation: Swagger UI, Spring REST Docs
  • JDK: Java 21 (LTS)

πŸ—“ 3-Week Development Plan

Week 1 - Backend Foundation & Core Architecture

  1. Spring Boot 3 project setup with modular structure
  2. Database design with Hibernate entities and relationships
  3. Core domain services: Product, User, Order management
  4. Authentication & authorization with Spring Security
  5. RESTful API development with proper HTTP status handling

Week 2 - Advanced Backend Features & Integration

  1. Payment gateway integration (Stripe, PayPal)
  2. File upload system for product images (AWS S3 integration)
  3. Caching strategies with Redis for performance optimization
  4. Message queuing for order processing and notifications
  5. Comprehensive API testing with TestContainers

Week 3 - Frontend Development & Deployment

  1. React application setup with TypeScript configuration
  2. Component library development with Material-UI
  3. State management implementation with Redux Toolkit
  4. API integration and error handling
  5. Responsive design and multi-language support
  6. Docker containerization and deployment preparation

πŸ—ƒ Project Structure

sb3-react-animalduo/
β”œβ”€ backend/                           # Spring Boot 3 backend
β”‚  β”œβ”€ src/
β”‚  β”‚  β”œβ”€ main/
β”‚  β”‚  β”‚  β”œβ”€ java/
β”‚  β”‚  β”‚  β”‚  └─ com/
β”‚  β”‚  β”‚  β”‚     └─ artiordex/
β”‚  β”‚  β”‚  β”‚        └─ animalduo/
β”‚  β”‚  β”‚  β”‚           β”œβ”€ AnimalDuoApplication.java
β”‚  β”‚  β”‚  β”‚           β”‚
β”‚  β”‚  β”‚  β”‚           β”œβ”€ config/          # Configuration classes
β”‚  β”‚  β”‚  β”‚           β”‚  β”œβ”€ SecurityConfig.java
β”‚  β”‚  β”‚  β”‚           β”‚  β”œβ”€ DatabaseConfig.java
β”‚  β”‚  β”‚  β”‚           β”‚  β”œβ”€ RedisConfig.java
β”‚  β”‚  β”‚  β”‚           β”‚  └─ RabbitMQConfig.java
β”‚  β”‚  β”‚  β”‚           β”‚
β”‚  β”‚  β”‚  β”‚           β”œβ”€ domain/          # Domain models & entities
β”‚  β”‚  β”‚  β”‚           β”‚  β”œβ”€ user/
β”‚  β”‚  β”‚  β”‚           β”‚  β”‚  β”œβ”€ User.java
β”‚  β”‚  β”‚  β”‚           β”‚  β”‚  β”œβ”€ Role.java
β”‚  β”‚  β”‚  β”‚           β”‚  β”‚  └─ UserAddress.java
β”‚  β”‚  β”‚  β”‚           β”‚  β”‚
β”‚  β”‚  β”‚  β”‚           β”‚  β”œβ”€ product/
β”‚  β”‚  β”‚  β”‚           β”‚  β”‚  β”œβ”€ Product.java
β”‚  β”‚  β”‚  β”‚           β”‚  β”‚  β”œβ”€ Category.java
β”‚  β”‚  β”‚  β”‚           β”‚  β”‚  β”œβ”€ Brand.java
β”‚  β”‚  β”‚  β”‚           β”‚  β”‚  └─ ProductImage.java
β”‚  β”‚  β”‚  β”‚           β”‚  β”‚
β”‚  β”‚  β”‚  β”‚           β”‚  β”œβ”€ order/
β”‚  β”‚  β”‚  β”‚           β”‚  β”‚  β”œβ”€ Order.java
β”‚  β”‚  β”‚  β”‚           β”‚  β”‚  β”œβ”€ OrderItem.java
β”‚  β”‚  β”‚  β”‚           β”‚  β”‚  β”œβ”€ Payment.java
β”‚  β”‚  β”‚  β”‚           β”‚  β”‚  └─ Shipping.java
β”‚  β”‚  β”‚  β”‚           β”‚  β”‚
β”‚  β”‚  β”‚  β”‚           β”‚  └─ common/
β”‚  β”‚  β”‚  β”‚           β”‚     β”œβ”€ BaseEntity.java
β”‚  β”‚  β”‚  β”‚           β”‚     └─ Address.java
β”‚  β”‚  β”‚  β”‚           β”‚
β”‚  β”‚  β”‚  β”‚           β”œβ”€ repository/      # JPA repositories
β”‚  β”‚  β”‚  β”‚           β”‚  β”œβ”€ UserRepository.java
β”‚  β”‚  β”‚  β”‚           β”‚  β”œβ”€ ProductRepository.java
β”‚  β”‚  β”‚  β”‚           β”‚  β”œβ”€ OrderRepository.java
β”‚  β”‚  β”‚  β”‚           β”‚  └─ CategoryRepository.java
β”‚  β”‚  β”‚  β”‚           β”‚
β”‚  β”‚  β”‚  β”‚           β”œβ”€ service/         # Business logic layer
β”‚  β”‚  β”‚  β”‚           β”‚  β”œβ”€ user/
β”‚  β”‚  β”‚  β”‚           β”‚  β”‚  β”œβ”€ UserService.java
β”‚  β”‚  β”‚  β”‚           β”‚  β”‚  └─ AuthService.java
β”‚  β”‚  β”‚  β”‚           β”‚  β”‚
β”‚  β”‚  β”‚  β”‚           β”‚  β”œβ”€ product/
β”‚  β”‚  β”‚  β”‚           β”‚  β”‚  β”œβ”€ ProductService.java
β”‚  β”‚  β”‚  β”‚           β”‚  β”‚  └─ CategoryService.java
β”‚  β”‚  β”‚  β”‚           β”‚  β”‚
β”‚  β”‚  β”‚  β”‚           β”‚  β”œβ”€ order/
β”‚  β”‚  β”‚  β”‚           β”‚  β”‚  β”œβ”€ OrderService.java
β”‚  β”‚  β”‚  β”‚           β”‚  β”‚  β”œβ”€ PaymentService.java
β”‚  β”‚  β”‚  β”‚           β”‚  β”‚  └─ ShippingService.java
β”‚  β”‚  β”‚  β”‚           β”‚  β”‚
β”‚  β”‚  β”‚  β”‚           β”‚  └─ common/
β”‚  β”‚  β”‚  β”‚           β”‚     β”œβ”€ FileUploadService.java
β”‚  β”‚  β”‚  β”‚           β”‚     β”œβ”€ EmailService.java
β”‚  β”‚  β”‚  β”‚           β”‚     └─ CacheService.java
β”‚  β”‚  β”‚  β”‚           β”‚
β”‚  β”‚  β”‚  β”‚           β”œβ”€ controller/      # REST controllers
β”‚  β”‚  β”‚  β”‚           β”‚  β”œβ”€ UserController.java
β”‚  β”‚  β”‚  β”‚           β”‚  β”œβ”€ ProductController.java
β”‚  β”‚  β”‚  β”‚           β”‚  β”œβ”€ OrderController.java
β”‚  β”‚  β”‚  β”‚           β”‚  β”œβ”€ PaymentController.java
β”‚  β”‚  β”‚  β”‚           β”‚  └─ AdminController.java
β”‚  β”‚  β”‚  β”‚           β”‚
β”‚  β”‚  β”‚  β”‚           β”œβ”€ dto/             # Data Transfer Objects
β”‚  β”‚  β”‚  β”‚           β”‚  β”œβ”€ request/
β”‚  β”‚  β”‚  β”‚           β”‚  β”‚  β”œβ”€ LoginRequest.java
β”‚  β”‚  β”‚  β”‚           β”‚  β”‚  β”œβ”€ ProductCreateRequest.java
β”‚  β”‚  β”‚  β”‚           β”‚  β”‚  └─ OrderCreateRequest.java
β”‚  β”‚  β”‚  β”‚           β”‚  β”‚
β”‚  β”‚  β”‚  β”‚           β”‚  └─ response/
β”‚  β”‚  β”‚  β”‚           β”‚     β”œβ”€ UserResponse.java
β”‚  β”‚  β”‚  β”‚           β”‚     β”œβ”€ ProductResponse.java
β”‚  β”‚  β”‚  β”‚           β”‚     └─ OrderResponse.java
β”‚  β”‚  β”‚  β”‚           β”‚
β”‚  β”‚  β”‚  β”‚           β”œβ”€ exception/       # Exception handling
β”‚  β”‚  β”‚  β”‚           β”‚  β”œβ”€ GlobalExceptionHandler.java
β”‚  β”‚  β”‚  β”‚           β”‚  β”œβ”€ BusinessException.java
β”‚  β”‚  β”‚  β”‚           β”‚  └─ ResourceNotFoundException.java
β”‚  β”‚  β”‚  β”‚           β”‚
β”‚  β”‚  β”‚  β”‚           β”œβ”€ security/        # Security configuration
β”‚  β”‚  β”‚  β”‚           β”‚  β”œβ”€ JwtTokenProvider.java
β”‚  β”‚  β”‚  β”‚           β”‚  β”œβ”€ JwtAuthenticationFilter.java
β”‚  β”‚  β”‚  β”‚           β”‚  └─ CustomUserDetailsService.java
β”‚  β”‚  β”‚  β”‚           β”‚
β”‚  β”‚  β”‚  β”‚           └─ util/            # Utility classes
β”‚  β”‚  β”‚  β”‚              β”œβ”€ DateUtil.java
β”‚  β”‚  β”‚  β”‚              β”œβ”€ ValidationUtil.java
β”‚  β”‚  β”‚  β”‚              └─ PasswordEncoder.java
β”‚  β”‚  β”‚  β”‚
β”‚  β”‚  β”‚  └─ resources/
β”‚  β”‚  β”‚     β”œβ”€ application.yml         # Main configuration
β”‚  β”‚  β”‚     β”œβ”€ application-dev.yml     # Development profile
β”‚  β”‚  β”‚     β”œβ”€ application-prod.yml    # Production profile
β”‚  β”‚  β”‚     β”œβ”€ db/
β”‚  β”‚  β”‚     β”‚  β”œβ”€ migration/           # Flyway migrations
β”‚  β”‚  β”‚     β”‚  β”‚  β”œβ”€ V1__Create_user_tables.sql
β”‚  β”‚  β”‚     β”‚  β”‚  β”œβ”€ V2__Create_product_tables.sql
β”‚  β”‚  β”‚     β”‚  β”‚  └─ V3__Create_order_tables.sql
β”‚  β”‚  β”‚     β”‚  β”‚
β”‚  β”‚  β”‚     β”‚  └─ data.sql             # Sample data
β”‚  β”‚  β”‚     β”‚
β”‚  β”‚  β”‚     β”œβ”€ static/                 # Static resources
β”‚  β”‚  β”‚     └─ templates/              # Email templates
β”‚  β”‚  β”‚
β”‚  β”‚  └─ test/
β”‚  β”‚     β”œβ”€ java/
β”‚  β”‚     β”‚  └─ com/artiordex/animalduo/
β”‚  β”‚     β”‚     β”œβ”€ integration/         # Integration tests
β”‚  β”‚     β”‚     β”‚  β”œβ”€ UserControllerTest.java
β”‚  β”‚     β”‚     β”‚  └─ ProductControllerTest.java
β”‚  β”‚     β”‚     β”‚
β”‚  β”‚     β”‚     β”œβ”€ service/             # Service tests
β”‚  β”‚     β”‚     β”‚  β”œβ”€ UserServiceTest.java
β”‚  β”‚     β”‚     β”‚  └─ ProductServiceTest.java
β”‚  β”‚     β”‚     β”‚
β”‚  β”‚     β”‚     └─ repository/          # Repository tests
β”‚  β”‚     β”‚        β”œβ”€ UserRepositoryTest.java
β”‚  β”‚     β”‚        └─ ProductRepositoryTest.java
β”‚  β”‚     β”‚
β”‚  β”‚     └─ resources/
β”‚  β”‚        β”œβ”€ application-test.yml    # Test configuration
β”‚  β”‚        └─ test-data.sql          # Test data
β”‚  β”‚
β”‚  └─ pom.xml                         # Maven configuration
β”‚
β”œβ”€ frontend/                          # React frontend
β”‚  β”œβ”€ public/
β”‚  β”‚  β”œβ”€ index.html
β”‚  β”‚  β”œβ”€ favicon.ico
β”‚  β”‚  β”œβ”€ manifest.json               # PWA manifest
β”‚  β”‚  └─ locales/                    # i18n translation files
β”‚  β”‚     β”œβ”€ en/
β”‚  β”‚     β”‚  └─ common.json
β”‚  β”‚     β”œβ”€ ko/
β”‚  β”‚     β”‚  └─ common.json
β”‚  β”‚     └─ ja/
β”‚  β”‚        └─ common.json
β”‚  β”‚
β”‚  β”œβ”€ src/
β”‚  β”‚  β”œβ”€ components/                  # Reusable components
β”‚  β”‚  β”‚  β”œβ”€ common/                  # Shared UI components
β”‚  β”‚  β”‚  β”‚  β”œβ”€ layout/
β”‚  β”‚  β”‚  β”‚  β”‚  β”œβ”€ Header.tsx
β”‚  β”‚  β”‚  β”‚  β”‚  β”œβ”€ Footer.tsx
β”‚  β”‚  β”‚  β”‚  β”‚  β”œβ”€ Navbar.tsx
β”‚  β”‚  β”‚  β”‚  β”‚  └─ Sidebar.tsx
β”‚  β”‚  β”‚  β”‚  β”‚
β”‚  β”‚  β”‚  β”‚  β”œβ”€ ui/                   # Basic UI elements
β”‚  β”‚  β”‚  β”‚  β”‚  β”œβ”€ Button.tsx
β”‚  β”‚  β”‚  β”‚  β”‚  β”œβ”€ Input.tsx
β”‚  β”‚  β”‚  β”‚  β”‚  β”œβ”€ Modal.tsx
β”‚  β”‚  β”‚  β”‚  β”‚  β”œβ”€ Loading.tsx
β”‚  β”‚  β”‚  β”‚  β”‚  β”œβ”€ ErrorBoundary.tsx
β”‚  β”‚  β”‚  β”‚  β”‚  └─ Pagination.tsx
β”‚  β”‚  β”‚  β”‚  β”‚
β”‚  β”‚  β”‚  β”‚  β”œβ”€ forms/                # Form components
β”‚  β”‚  β”‚  β”‚  β”‚  β”œβ”€ FormField.tsx
β”‚  β”‚  β”‚  β”‚  β”‚  β”œβ”€ SearchBox.tsx
β”‚  β”‚  β”‚  β”‚  β”‚  └─ FileUpload.tsx
β”‚  β”‚  β”‚  β”‚  β”‚
β”‚  β”‚  β”‚  β”‚  └─ feedback/             # User feedback
β”‚  β”‚  β”‚  β”‚     β”œβ”€ Toast.tsx
β”‚  β”‚  β”‚  β”‚     β”œβ”€ Alert.tsx
β”‚  β”‚  β”‚  β”‚     └─ ConfirmDialog.tsx
β”‚  β”‚  β”‚  β”‚
β”‚  β”‚  β”‚  β”œβ”€ product/                 # Product-related components
β”‚  β”‚  β”‚  β”‚  β”œβ”€ ProductCard.tsx
β”‚  β”‚  β”‚  β”‚  β”œβ”€ ProductDetail.tsx
β”‚  β”‚  β”‚  β”‚  β”œβ”€ ProductList.tsx
β”‚  β”‚  β”‚  β”‚  β”œβ”€ ProductFilter.tsx
β”‚  β”‚  β”‚  β”‚  β”œβ”€ ProductGallery.tsx
β”‚  β”‚  β”‚  β”‚  β”œβ”€ ProductReviews.tsx
β”‚  β”‚  β”‚  β”‚  β”œβ”€ CategoryNavigation.tsx
β”‚  β”‚  β”‚  β”‚  └─ RecommendedProducts.tsx
β”‚  β”‚  β”‚  β”‚
β”‚  β”‚  β”‚  β”œβ”€ cart/                    # Shopping cart components
β”‚  β”‚  β”‚  β”‚  β”œβ”€ CartItem.tsx
β”‚  β”‚  β”‚  β”‚  β”œβ”€ CartSummary.tsx
β”‚  β”‚  β”‚  β”‚  β”œβ”€ CartSidebar.tsx
β”‚  β”‚  β”‚  β”‚  β”œβ”€ Checkout.tsx
β”‚  β”‚  β”‚  β”‚  └─ PaymentForm.tsx
β”‚  β”‚  β”‚  β”‚
β”‚  β”‚  β”‚  β”œβ”€ user/                    # User management components
β”‚  β”‚  β”‚  β”‚  β”œβ”€ auth/
β”‚  β”‚  β”‚  β”‚  β”‚  β”œβ”€ Login.tsx
β”‚  β”‚  β”‚  β”‚  β”‚  β”œβ”€ Register.tsx
β”‚  β”‚  β”‚  β”‚  β”‚  β”œβ”€ ForgotPassword.tsx
β”‚  β”‚  β”‚  β”‚  β”‚  └─ PasswordReset.tsx
β”‚  β”‚  β”‚  β”‚  β”‚
β”‚  β”‚  β”‚  β”‚  β”œβ”€ profile/
β”‚  β”‚  β”‚  β”‚  β”‚  β”œβ”€ Profile.tsx
β”‚  β”‚  β”‚  β”‚  β”‚  β”œβ”€ AddressBook.tsx
β”‚  β”‚  β”‚  β”‚  β”‚  β”œβ”€ OrderHistory.tsx
β”‚  β”‚  β”‚  β”‚  β”‚  └─ Wishlist.tsx
β”‚  β”‚  β”‚  β”‚  β”‚
β”‚  β”‚  β”‚  β”‚  └─ dashboard/            # User dashboard
β”‚  β”‚  β”‚  β”‚     β”œβ”€ DashboardLayout.tsx
β”‚  β”‚  β”‚  β”‚     β”œβ”€ AccountSettings.tsx
β”‚  β”‚  β”‚  β”‚     └─ NotificationSettings.tsx
β”‚  β”‚  β”‚  β”‚
β”‚  β”‚  β”‚  β”œβ”€ admin/                   # Admin panel components
β”‚  β”‚  β”‚  β”‚  β”œβ”€ AdminLayout.tsx
β”‚  β”‚  β”‚  β”‚  β”œβ”€ AdminSidebar.tsx
β”‚  β”‚  β”‚  β”‚  β”œβ”€ dashboard/
β”‚  β”‚  β”‚  β”‚  β”‚  β”œβ”€ AdminDashboard.tsx
β”‚  β”‚  β”‚  β”‚  β”‚  β”œβ”€ SalesChart.tsx
β”‚  β”‚  β”‚  β”‚  β”‚  └─ AnalyticsCard.tsx
β”‚  β”‚  β”‚  β”‚  β”‚
β”‚  β”‚  β”‚  β”‚  β”œβ”€ products/
β”‚  β”‚  β”‚  β”‚  β”‚  β”œβ”€ ProductManagement.tsx
β”‚  β”‚  β”‚  β”‚  β”‚  β”œβ”€ ProductForm.tsx
β”‚  β”‚  β”‚  β”‚  β”‚  └─ CategoryManagement.tsx
β”‚  β”‚  β”‚  β”‚  β”‚
β”‚  β”‚  β”‚  β”‚  β”œβ”€ orders/
β”‚  β”‚  β”‚  β”‚  β”‚  β”œβ”€ OrderManagement.tsx
β”‚  β”‚  β”‚  β”‚  β”‚  β”œβ”€ OrderDetail.tsx
β”‚  β”‚  β”‚  β”‚  β”‚  └─ ShippingTracker.tsx
β”‚  β”‚  β”‚  β”‚  β”‚
β”‚  β”‚  β”‚  β”‚  └─ users/
β”‚  β”‚  β”‚  β”‚     β”œβ”€ UserManagement.tsx
β”‚  β”‚  β”‚  β”‚     └─ UserDetail.tsx
β”‚  β”‚  β”‚  β”‚
β”‚  β”‚  β”‚  └─ features/                # Feature-specific components
β”‚  β”‚  β”‚     β”œβ”€ search/
β”‚  β”‚  β”‚     β”‚  β”œβ”€ SearchResults.tsx
β”‚  β”‚  β”‚     β”‚  β”œβ”€ SearchFilters.tsx
β”‚  β”‚  β”‚     β”‚  └─ SearchSuggestions.tsx
β”‚  β”‚  β”‚     β”‚
β”‚  β”‚  β”‚     β”œβ”€ recommendations/
β”‚  β”‚  β”‚     β”‚  β”œβ”€ RecommendationEngine.tsx
β”‚  β”‚  β”‚     β”‚  └─ PersonalizedOffers.tsx
β”‚  β”‚  β”‚     β”‚
β”‚  β”‚  β”‚     └─ notifications/
β”‚  β”‚  β”‚        β”œβ”€ NotificationCenter.tsx
β”‚  β”‚  β”‚        └─ PushNotifications.tsx
β”‚  β”‚  β”‚
β”‚  β”‚  β”œβ”€ pages/                       # Page components
β”‚  β”‚  β”‚  β”œβ”€ public/                  # Public pages
β”‚  β”‚  β”‚  β”‚  β”œβ”€ HomePage.tsx
β”‚  β”‚  β”‚  β”‚  β”œβ”€ ProductsPage.tsx
β”‚  β”‚  β”‚  β”‚  β”œβ”€ ProductDetailPage.tsx
β”‚  β”‚  β”‚  β”‚  β”œβ”€ CategoryPage.tsx
β”‚  β”‚  β”‚  β”‚  β”œβ”€ SearchResultsPage.tsx
β”‚  β”‚  β”‚  β”‚  β”œβ”€ AboutPage.tsx
β”‚  β”‚  β”‚  β”‚  └─ ContactPage.tsx
β”‚  β”‚  β”‚  β”‚
β”‚  β”‚  β”‚  β”œβ”€ auth/                    # Authentication pages
β”‚  β”‚  β”‚  β”‚  β”œβ”€ LoginPage.tsx
β”‚  β”‚  β”‚  β”‚  β”œβ”€ RegisterPage.tsx
β”‚  β”‚  β”‚  β”‚  └─ PasswordResetPage.tsx
β”‚  β”‚  β”‚  β”‚
β”‚  β”‚  β”‚  β”œβ”€ cart/                    # Cart and checkout pages
β”‚  β”‚  β”‚  β”‚  β”œβ”€ CartPage.tsx
β”‚  β”‚  β”‚  β”‚  β”œβ”€ CheckoutPage.tsx
β”‚  β”‚  β”‚  β”‚  β”œβ”€ PaymentPage.tsx
β”‚  β”‚  β”‚  β”‚  └─ OrderConfirmationPage.tsx
β”‚  β”‚  β”‚  β”‚
β”‚  β”‚  β”‚  β”œβ”€ user/                    # User account pages
β”‚  β”‚  β”‚  β”‚  β”œβ”€ UserDashboard.tsx
β”‚  β”‚  β”‚  β”‚  β”œβ”€ ProfilePage.tsx
β”‚  β”‚  β”‚  β”‚  β”œβ”€ OrderHistoryPage.tsx
β”‚  β”‚  β”‚  β”‚  β”œβ”€ WishlistPage.tsx
β”‚  β”‚  β”‚  β”‚  └─ AddressBookPage.tsx
β”‚  β”‚  β”‚  β”‚
β”‚  β”‚  β”‚  β”œβ”€ admin/                   # Admin pages
β”‚  β”‚  β”‚  β”‚  β”œβ”€ AdminDashboardPage.tsx
β”‚  β”‚  β”‚  β”‚  β”œβ”€ ProductManagementPage.tsx
β”‚  β”‚  β”‚  β”‚  β”œβ”€ OrderManagementPage.tsx
β”‚  β”‚  β”‚  β”‚  β”œβ”€ UserManagementPage.tsx
β”‚  β”‚  β”‚  β”‚  └─ AnalyticsPage.tsx
β”‚  β”‚  β”‚  β”‚
β”‚  β”‚  β”‚  └─ error/                   # Error pages
β”‚  β”‚  β”‚     β”œβ”€ NotFoundPage.tsx
β”‚  β”‚  β”‚     β”œβ”€ UnauthorizedPage.tsx
β”‚  β”‚  β”‚     └─ ServerErrorPage.tsx
β”‚  β”‚  β”‚
β”‚  β”‚  β”œβ”€ hooks/                       # Custom React hooks
β”‚  β”‚  β”‚  β”œβ”€ api/                     # API-related hooks
β”‚  β”‚  β”‚  β”‚  β”œβ”€ useAuth.ts
β”‚  β”‚  β”‚  β”‚  β”œβ”€ useProducts.ts
β”‚  β”‚  β”‚  β”‚  β”œβ”€ useCart.ts
β”‚  β”‚  β”‚  β”‚  β”œβ”€ useOrders.ts
β”‚  β”‚  β”‚  β”‚  └─ useUsers.ts
β”‚  β”‚  β”‚  β”‚
β”‚  β”‚  β”‚  β”œβ”€ ui/                      # UI-related hooks
β”‚  β”‚  β”‚  β”‚  β”œβ”€ useModal.ts
β”‚  β”‚  β”‚  β”‚  β”œβ”€ useToast.ts
β”‚  β”‚  β”‚  β”‚  β”œβ”€ usePagination.ts
β”‚  β”‚  β”‚  β”‚  └─ useDebounce.ts
β”‚  β”‚  β”‚  β”‚
β”‚  β”‚  β”‚  β”œβ”€ business/                # Business logic hooks
β”‚  β”‚  β”‚  β”‚  β”œβ”€ useSearch.ts
β”‚  β”‚  β”‚  β”‚  β”œβ”€ useRecommendations.ts
β”‚  β”‚  β”‚  β”‚  β”œβ”€ useWishlist.ts
β”‚  β”‚  β”‚  β”‚  └─ usePayment.ts
β”‚  β”‚  β”‚  β”‚
β”‚  β”‚  β”‚  └─ utils/                   # Utility hooks
β”‚  β”‚  β”‚     β”œβ”€ useLocalStorage.ts
β”‚  β”‚  β”‚     β”œβ”€ useWindowSize.ts
β”‚  β”‚  β”‚     β”œβ”€ useIntersectionObserver.ts
β”‚  β”‚  β”‚     └─ useGeolocation.ts
β”‚  β”‚  β”‚
β”‚  β”‚  β”œβ”€ services/                    # API and external services
β”‚  β”‚  β”‚  β”œβ”€ api/                     # Backend API services
β”‚  β”‚  β”‚  β”‚  β”œβ”€ client.ts             # Axios configuration
β”‚  β”‚  β”‚  β”‚  β”œβ”€ authService.ts
β”‚  β”‚  β”‚  β”‚  β”œβ”€ productService.ts
β”‚  β”‚  β”‚  β”‚  β”œβ”€ orderService.ts
β”‚  β”‚  β”‚  β”‚  β”œβ”€ userService.ts
β”‚  β”‚  β”‚  β”‚  β”œβ”€ paymentService.ts
β”‚  β”‚  β”‚  β”‚  └─ uploadService.ts
β”‚  β”‚  β”‚  β”‚
β”‚  β”‚  β”‚  β”œβ”€ external/                # External service integrations
β”‚  β”‚  β”‚  β”‚  β”œβ”€ googleAnalytics.ts
β”‚  β”‚  β”‚  β”‚  β”œβ”€ stripeService.ts
β”‚  β”‚  β”‚  β”‚  β”œβ”€ socialAuthService.ts
β”‚  β”‚  β”‚  β”‚  └─ pushNotificationService.ts
β”‚  β”‚  β”‚  β”‚
β”‚  β”‚  β”‚  └─ workers/                 # Service workers
β”‚  β”‚  β”‚     β”œβ”€ cachingWorker.ts
β”‚  β”‚  β”‚     └─ syncWorker.ts
β”‚  β”‚  β”‚
β”‚  β”‚  β”œβ”€ store/                       # State management
β”‚  β”‚  β”‚  β”œβ”€ index.ts                 # Store configuration
β”‚  β”‚  β”‚  β”œβ”€ middleware/              # Custom middleware
β”‚  β”‚  β”‚  β”‚  β”œβ”€ authMiddleware.ts
β”‚  β”‚  β”‚  β”‚  └─ loggerMiddleware.ts
β”‚  β”‚  β”‚  β”‚
β”‚  β”‚  β”‚  β”œβ”€ slices/                  # Redux Toolkit slices
β”‚  β”‚  β”‚  β”‚  β”œβ”€ authSlice.ts
β”‚  β”‚  β”‚  β”‚  β”œβ”€ productSlice.ts
β”‚  β”‚  β”‚  β”‚  β”œβ”€ cartSlice.ts
β”‚  β”‚  β”‚  β”‚  β”œβ”€ orderSlice.ts
β”‚  β”‚  β”‚  β”‚  β”œβ”€ userSlice.ts
β”‚  β”‚  β”‚  β”‚  β”œβ”€ uiSlice.ts
β”‚  β”‚  β”‚  β”‚  └─ searchSlice.ts
β”‚  β”‚  β”‚  β”‚
β”‚  β”‚  β”‚  └─ selectors/               # Reselect selectors
β”‚  β”‚  β”‚     β”œβ”€ authSelectors.ts
β”‚  β”‚  β”‚     β”œβ”€ productSelectors.ts
β”‚  β”‚  β”‚     β”œβ”€ cartSelectors.ts
β”‚  β”‚  β”‚     └─ uiSelectors.ts
β”‚  β”‚  β”‚
β”‚  β”‚  β”œβ”€ types/                       # TypeScript type definitions
β”‚  β”‚  β”‚  β”œβ”€ api/                     # API-related types
β”‚  β”‚  β”‚  β”‚  β”œβ”€ auth.ts
β”‚  β”‚  β”‚  β”‚  β”œβ”€ product.ts
β”‚  β”‚  β”‚  β”‚  β”œβ”€ order.ts
β”‚  β”‚  β”‚  β”‚  β”œβ”€ user.ts
β”‚  β”‚  β”‚  β”‚  └─ payment.ts
β”‚  β”‚  β”‚  β”‚
β”‚  β”‚  β”‚  β”œβ”€ components/              # Component prop types
β”‚  β”‚  β”‚  β”‚  β”œβ”€ common.ts
β”‚  β”‚  β”‚  β”‚  β”œβ”€ forms.ts
β”‚  β”‚  β”‚  β”‚  └─ tables.ts
β”‚  β”‚  β”‚  β”‚
β”‚  β”‚  β”‚  └─ global/                  # Global type definitions
β”‚  β”‚  β”‚     β”œβ”€ env.ts
β”‚  β”‚  β”‚     β”œβ”€ theme.ts
β”‚  β”‚  β”‚     └─ i18n.ts
β”‚  β”‚  β”‚
β”‚  β”‚  β”œβ”€ utils/                       # Utility functions
β”‚  β”‚  β”‚  β”œβ”€ constants/               # Application constants
β”‚  β”‚  β”‚  β”‚  β”œβ”€ api.ts
β”‚  β”‚  β”‚  β”‚  β”œβ”€ routes.ts
β”‚  β”‚  β”‚  β”‚  β”œβ”€ storage.ts
β”‚  β”‚  β”‚  β”‚  └─ validation.ts
β”‚  β”‚  β”‚  β”‚
β”‚  β”‚  β”‚  β”œβ”€ helpers/                 # Helper functions
β”‚  β”‚  β”‚  β”‚  β”œβ”€ formatters.ts
β”‚  β”‚  β”‚  β”‚  β”œβ”€ validators.ts
β”‚  β”‚  β”‚  β”‚  β”œβ”€ calculations.ts
β”‚  β”‚  β”‚  β”‚  β”œβ”€ dateUtils.ts
β”‚  β”‚  β”‚  β”‚  └─ currencyUtils.ts
β”‚  β”‚  β”‚  β”‚
β”‚  β”‚  β”‚  β”œβ”€ storage/                 # Local storage utilities
β”‚  β”‚  β”‚  β”‚  β”œβ”€ localStorage.ts
β”‚  β”‚  β”‚  β”‚  β”œβ”€ sessionStorage.ts
β”‚  β”‚  β”‚  β”‚  └─ cookieUtils.ts
β”‚  β”‚  β”‚  β”‚
β”‚  β”‚  β”‚  └─ security/                # Security utilities
β”‚  β”‚  β”‚     β”œβ”€ encryption.ts
β”‚  β”‚  β”‚     β”œβ”€ sanitization.ts
β”‚  β”‚  β”‚     └─ csrfProtection.ts
β”‚  β”‚  β”‚
β”‚  β”‚  β”œβ”€ styles/                      # Styling and themes
β”‚  β”‚  β”‚  β”œβ”€ globals.css              # Global styles
β”‚  β”‚  β”‚  β”œβ”€ variables.css            # CSS variables
β”‚  β”‚  β”‚  β”œβ”€ components.css           # Component-specific styles
β”‚  β”‚  β”‚  β”œβ”€ animations.css           # CSS animations
β”‚  β”‚  β”‚  β”œβ”€ responsive.css           # Media queries
β”‚  β”‚  β”‚  β”‚
β”‚  β”‚  β”‚  β”œβ”€ themes/                  # Theme configurations
β”‚  β”‚  β”‚  β”‚  β”œβ”€ lightTheme.ts
β”‚  β”‚  β”‚  β”‚  β”œβ”€ darkTheme.ts
β”‚  β”‚  β”‚  β”‚  └─ index.ts
β”‚  β”‚  β”‚  β”‚
β”‚  β”‚  β”‚  └─ mui/                     # Material-UI customization
β”‚  β”‚  β”‚     β”œβ”€ muiTheme.ts
β”‚  β”‚  β”‚     └─ muiOverrides.ts
β”‚  β”‚  β”‚
β”‚  β”‚  β”œβ”€ assets/                      # Static assets
β”‚  β”‚  β”‚  β”œβ”€ images/                  # Image files
β”‚  β”‚  β”‚  β”‚  β”œβ”€ logos/
β”‚  β”‚  β”‚  β”‚  β”œβ”€ icons/
β”‚  β”‚  β”‚  β”‚  β”œβ”€ banners/
β”‚  β”‚  β”‚  β”‚  └─ placeholders/
β”‚  β”‚  β”‚  β”‚
β”‚  β”‚  β”‚  β”œβ”€ fonts/                   # Font files
β”‚  β”‚  β”‚  β”‚  └─ custom-fonts/
β”‚  β”‚  β”‚  β”‚
β”‚  β”‚  β”‚  └─ data/                    # Static data files
β”‚  β”‚  β”‚     β”œβ”€ categories.json
β”‚  β”‚  β”‚     β”œβ”€ countries.json
β”‚  β”‚  β”‚     └─ currencies.json
β”‚  β”‚  β”‚
β”‚  β”‚  β”œβ”€ config/                      # Configuration files
β”‚  β”‚  β”‚  β”œβ”€ environment.ts           # Environment configuration
β”‚  β”‚  β”‚  β”œβ”€ api.ts                   # API configuration
β”‚  β”‚  β”‚  β”œβ”€ theme.ts                 # Theme configuration
β”‚  β”‚  β”‚  └─ i18n.ts                  # Internationalization setup
β”‚  β”‚  β”‚
β”‚  β”‚  β”œβ”€ routes/                      # Routing configuration
β”‚  β”‚  β”‚  β”œβ”€ AppRouter.tsx            # Main router component
β”‚  β”‚  β”‚  β”œβ”€ PrivateRoute.tsx         # Protected route wrapper
β”‚  β”‚  β”‚  β”œβ”€ AdminRoute.tsx           # Admin-only route wrapper
β”‚  β”‚  β”‚  └─ routeConstants.ts        # Route path constants
β”‚  β”‚  β”‚
β”‚  β”‚  β”œβ”€ contexts/                    # React contexts
β”‚  β”‚  β”‚  β”œβ”€ AuthContext.tsx          # Authentication context
β”‚  β”‚  β”‚  β”œβ”€ ThemeContext.tsx         # Theme context
β”‚  β”‚  β”‚  β”œβ”€ CartContext.tsx          # Shopping cart context
β”‚  β”‚  β”‚  └─ NotificationContext.tsx  # Notification context
β”‚  β”‚  β”‚
β”‚  β”‚  β”œβ”€ App.tsx                     # Main App component
β”‚  β”‚  β”œβ”€ main.tsx                    # Application entry point
β”‚  β”‚  └─ vite-env.d.ts              # Vite environment types
β”‚  β”‚
β”‚  β”œβ”€ tests/                         # Frontend tests
β”‚  β”‚  β”œβ”€ __mocks__/                  # Mock files
β”‚  β”‚  β”‚  β”œβ”€ api.ts
β”‚  β”‚  β”‚  └─ localStorage.ts
β”‚  β”‚  β”‚
β”‚  β”‚  β”œβ”€ components/                 # Component tests
β”‚  β”‚  β”‚  β”œβ”€ common/
β”‚  β”‚  β”‚  β”œβ”€ product/
β”‚  β”‚  β”‚  └─ user/
β”‚  β”‚  β”‚
β”‚  β”‚  β”œβ”€ pages/                      # Page tests
β”‚  β”‚  β”‚  β”œβ”€ HomePage.test.tsx
β”‚  β”‚  β”‚  └─ ProductsPage.test.tsx
β”‚  β”‚  β”‚
β”‚  β”‚  β”œβ”€ hooks/                      # Hook tests
β”‚  β”‚  β”‚  β”œβ”€ useAuth.test.ts
β”‚  β”‚  β”‚  └─ useCart.test.ts
β”‚  β”‚  β”‚
β”‚  β”‚  β”œβ”€ utils/                      # Utility tests
β”‚  β”‚  β”‚  β”œβ”€ formatters.test.ts
β”‚  β”‚  β”‚  └─ validators.test.ts
β”‚  β”‚  β”‚
β”‚  β”‚  └─ setup/                      # Test setup files
β”‚  β”‚     β”œβ”€ setupTests.ts
β”‚  β”‚     └─ testUtils.tsx
β”‚  β”‚
β”‚  β”œβ”€ package.json                   # Dependencies and scripts
β”‚  β”œβ”€ tsconfig.json                  # TypeScript configuration
β”‚  β”œβ”€ vite.config.ts                # Vite configuration
β”‚  β”œβ”€ tailwind.config.js            # Tailwind CSS configuration
β”‚  β”œβ”€ eslint.config.js              # ESLint configuration
β”‚  β”œβ”€ prettier.config.js            # Prettier configuration
β”‚  β”œβ”€ jest.config.js                # Jest configuration
β”‚  └─ .env.example                  # Environment variables template
β”‚
β”œβ”€ docker/                           # Docker configuration
β”‚  β”œβ”€ docker-compose.yml             # Development environment
β”‚  β”œβ”€ docker-compose.prod.yml        # Production environment
β”‚  β”œβ”€ backend/
β”‚  β”‚  └─ Dockerfile
β”‚  └─ frontend/
β”‚     └─ Dockerfile
β”‚
β”œβ”€ docs/                             # Documentation
β”‚  β”œβ”€ api/                           # API documentation
β”‚  β”‚  β”œβ”€ user-api.md
β”‚  β”‚  β”œβ”€ product-api.md
β”‚  β”‚  └─ order-api.md
β”‚  β”‚
β”‚  β”œβ”€ database/
β”‚  β”‚  β”œβ”€ schema-design.md
β”‚  β”‚  └─ migration-guide.md
β”‚  β”‚
β”‚  β”œβ”€ deployment/
β”‚  β”‚  β”œβ”€ docker-setup.md
β”‚  β”‚  └─ production-guide.md
β”‚  β”‚
β”‚  └─ examples/                      # Book example codes
β”‚     β”œβ”€ hibernate-examples/
β”‚     β”‚  β”œβ”€ advanced-mapping.java    # κ³ κΈ‰ λ§€ν•‘ 예제
β”‚     β”‚  └─ query-optimization.java  # 쿼리 μ΅œμ ν™” 예제
β”‚     β”‚
β”‚     └─ spring-boot-examples/
β”‚        β”œβ”€ reactive-programming.java # WebFlux 예제
β”‚        └─ testing-strategies.java   # ν…ŒμŠ€νŠΈ μ „λž΅ 예제
β”‚
β”œβ”€ scripts/                          # Utility scripts
β”‚  β”œβ”€ setup.sh                       # Environment setup
β”‚  β”œβ”€ deploy.sh                      # Deployment script
β”‚  └─ backup.sh                      # Database backup
β”‚
└─ README.md                         # Project documentation

🌟 Key Features

E-Commerce Core

  • Product Catalog: Advanced product management with categories, brands, and variants
  • Shopping Cart: Persistent cart with real-time updates and recommendations
  • Order Management: Complete order lifecycle with status tracking
  • Payment Integration: Multiple payment gateways (Stripe, PayPal, local methods)
  • Inventory Management: Real-time stock tracking with automated reorder alerts

User Experience

  • Multi-language Support: i18n implementation for global reach
  • Responsive Design: Mobile-first approach with progressive web app features
  • Search & Filter: Elasticsearch-powered advanced product search
  • Wishlist & Reviews: Customer engagement features with rating system
  • Recommendation Engine: ML-powered product recommendations

Admin Features

  • Dashboard Analytics: Sales, inventory, and customer insights
  • Content Management: Product, category, and brand management
  • Order Processing: Order fulfillment and shipping management
  • Customer Support: Integrated ticketing and chat system
  • Reporting: Comprehensive business intelligence reports

⏳ Project Timeline & Milestones

  • Start Date: 2025-08-15
  • MVP Completion: 2025-09-05
  • Production Deploy: 2025-09-10

Updates Log

2025-08-15 - Project initialization and backend architecture setup
2025-08-17 - Hibernate entities and database schema implementation
2025-08-19 - Core REST APIs and authentication system
2025-08-22 - Payment gateway integration and order processing
2025-08-25 - React frontend foundation and component library
2025-08-28 - Frontend-backend integration and state management
2025-09-02 - Testing, optimization, and security hardening
2025-09-05 - Documentation completion and deployment preparation

πŸš€ Getting Started

Prerequisites

  • JDK 21 or higher
  • Node.js 18+ and npm/yarn
  • PostgreSQL 15+
  • Redis 7+
  • Docker & Docker Compose (recommended)

Quick Start with Docker

# Clone the repository
git clone https://github.com/yourusername/sb3-react-animalduo.git
cd sb3-react-animalduo

# Start the development environment
docker-compose up -d

# The application will be available at:
# Frontend: http://localhost:3000
# Backend API: http://localhost:8080
# API Documentation: http://localhost:8080/swagger-ui.html

Manual Setup

Backend Setup

cd backend

# Configure database
cp src/main/resources/application-dev.yml.example src/main/resources/application-dev.yml
# Edit database credentials

# Run the application
./mvnw spring-boot:run -Dspring-boot.run.profiles=dev

Frontend Setup

cd frontend

# Install dependencies
npm install

# Start development server
npm run dev

πŸ—„ Database Schema

Core Entities (Hibernate Examples)

User Entity with Advanced Mapping

@Entity
@Table(name = "users")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class User extends BaseEntity {
    
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;
    
    @Column(unique = true, nullable = false)
    private String email;
    
    @OneToMany(mappedBy = "user", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
    @Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
    private Set<UserAddress> addresses = new LinkedHashSet<>();
    
    @OneToMany(mappedBy = "customer", cascade = CascadeType.ALL)
    private List<Order> orders = new ArrayList<>();
    
    @ManyToMany(fetch = FetchType.EAGER)
    @JoinTable(
        name = "user_roles",
        joinColumns = @JoinColumn(name = "user_id"),
        inverseJoinColumns = @JoinColumn(name = "role_id")
    )
    private Set<Role> roles = new HashSet<>();
}

Product Entity with Inheritance

@Entity
@Table(name = "products")
@Inheritance(strategy = InheritanceType.JOINED)
@DiscriminatorColumn(name = "product_type")
public abstract class Product extends BaseEntity {
    
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;
    
    @Column(nullable = false)
    private String name;
    
    @Column(columnDefinition = "TEXT")
    private String description;
    
    @Column(precision = 10, scale = 2)
    private BigDecimal price;
    
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "category_id")
    private Category category;
    
    @OneToMany(mappedBy = "product", cascade = CascadeType.ALL, orphanRemoval = true)
    private List<ProductImage> images = new ArrayList<>();
    
    @ElementCollection
    @CollectionTable(name = "product_tags")
    private Set<String> tags = new HashSet<>();
}

πŸ§ͺ Testing Strategy

Test Configuration

# application-test.yml
spring:
  datasource:
    url: jdbc:h2:mem:testdb
    driver-class-name: org.h2.Driver
  jpa:
    hibernate:
      ddl-auto: create-drop
  test:
    database:
      replace: none

Integration Test Example

@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@Testcontainers
@ActiveProfiles("test")
class ProductControllerIntegrationTest {
    
    @Container
    static PostgreSQLContainer<?> postgres = new PostgreSQLContainer<>("postgres:15")
            .withDatabaseName("testdb")
            .withUsername("test")
            .withPassword("test");
    
    @Autowired
    private TestRestTemplate restTemplate;
    
    @Test
    void shouldCreateProduct() {
        // Test implementation
    }
}

πŸ“š References

πŸ“– Books & Documentation

πŸ›  Framework Documentation

🌐 Community & Tools

πŸ— Architecture Patterns

Layered Architecture

Presentation Layer (Controllers) 
    ↓
Business Layer (Services)
    ↓
Persistence Layer (Repositories)
    ↓
Database Layer (PostgreSQL)

Security Architecture

  • JWT-based authentication
  • Role-based authorization (RBAC)
  • CORS configuration for React frontend
  • Rate limiting and DDoS protection
  • Input validation and sanitization

πŸ“Š Performance Optimization

Backend Optimizations

  • Hibernate: Second-level caching with Ehcache
  • Database: Connection pooling with HikariCP
  • Caching: Redis for session and application data
  • API: Pagination and lazy loading strategies

Frontend Optimizations

  • Code Splitting: Route-based lazy loading
  • State Management: Optimized Redux selectors
  • Caching: React Query for server state
  • Bundle: Webpack optimization and tree shaking

🀝 Contributing

Please read CONTRIBUTING.md for details on our code of conduct and the process for submitting pull requests.

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

About

AnimalDuo is a global pet product commerce platform built with Spring Boot 3 and React, featuring a modular architecture, RESTful APIs for testing and integration, and scalable design for future growth.

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors