How fm39hz/library works
High-Level Components
a) Client Layer (External)
• Incoming HTTP requests
• Potential client applications (web, mobile)
b) API Layer
• REST Controllers (AuthenticationController, BookController, etc.)
• Security Filter Chain (JwtAuthenticationFilter)
c) Service Layer
• Core Business Logic
• By modules (book, author, user, subscription, etc.)
• Payment Integration (VNPay)
d) Data Access Layer
• Repositories
• Database Connection
e) External Services
• VNPay Payment Gateway
Detailed Component Breakdown
Create modules/components for:
a) Authentication & Security
• SecurityConfig
• JwtTokenProvider
• CustomAuthenticationManager
• User Management
b) Core Library Modules
• Books Management
• Authors Management
• Publishers Management
• Records Management
• Subscriptions Management
c) Payment System
• Payment Service Factory
• VNPay Integration
• Invoice Management
Key Relationships to Highlight
• Security Filter → Controllers (authentication flow)
• Controllers → Services → Repositories
• Payment Service Factory → VNPay Service
• Subscription Factory → Subscription Service
• User → Subscription → Invoice relationships
Specific Implementation Details
Architectural patterns:
• Factory Pattern (PaymentServiceFactory, SubscriptionFactory)
• Repository Pattern (All *Repository interfaces)
• Service Layer Pattern (All *Service interfaces and implementations)
• DTO Pattern (Request/Response DTOs)
Additional Elements
Include:
• Configuration components (DatabaseConfig, SecurityConfig, VnPayConfig)
• Exception handling flow
• Aspect-oriented programming components (UserIdAspect)
Technical Stack Indicators
Show:
• Spring Boot framework
• Spring Security
• JPA/Hibernate
• MySQL/PostgreSQL (based on library.sql)
• JWT Authentication
Deployment Context
Include:
• Docker container boundaries (based on Dockerfile and docker-compose.yml)
• Database container
• Application container