common, infrastructure, and modules.
Repository Overview
The project consists of two main components:Backend Structure
The backend follows a three-tier architecture with clear separation between common utilities, infrastructure services, and business modules.Complete Directory Tree
Architectural Layers
Common Layer
Thecommon package contains cross-cutting concerns that are used across all modules:
AI Utilities
AI Utilities
- StructuredOutputInvoker: Wrapper around Spring AI’s structured output capabilities for consistent AI response parsing
Annotations & Aspects
Annotations & Aspects
- @RateLimit: Custom annotation for API rate limiting (supports IP-based and global limits)
- RateLimitAspect: AOP implementation that enforces rate limits using Redis
Async Processing
Async Processing
- AbstractStreamProducer: Base class for Redis Stream producers
- AbstractStreamConsumer: Base class for Redis Stream consumers with retry logic
- Used by resume analysis, knowledge base vectorization, and interview evaluation
Exception Handling
Exception Handling
- BusinessException: Custom exception for business logic errors
- ErrorCode: Centralized error code enumeration (2xxx for resume, 3xxx for interview, etc.)
- GlobalExceptionHandler: @ControllerAdvice that catches exceptions and returns standardized error responses
Result Wrapper
Result Wrapper
- Result<T>: Standardized API response format with
code,message, anddatafields - Provides static factory methods:
Result.success(),Result.error()
Infrastructure Layer
Theinfrastructure package provides technical services that support business logic:
File Processing
File Processing
- DocumentParseService: Apache Tika integration for parsing PDF, DOCX, DOC, TXT files
- FileStorageService: S3-compatible storage integration (RustFS)
- FileHashService: SHA-256 hashing for duplicate detection
- FileValidationService: File type and size validation
- TextCleaningService: Text normalization and cleaning
PDF Export
PDF Export
- PdfExportService: iText 8-based PDF generation for resume analysis reports and interview reports
- Supports Chinese fonts (font-asian)
MapStruct Mappers
MapStruct Mappers
- ResumeMapper: Entity ↔ DTO conversions for resume module
- InterviewMapper: Entity ↔ DTO conversions for interview module
- KnowledgeBaseMapper: Entity ↔ DTO conversions for knowledge base module
- RagChatMapper: DTO conversions for RAG chat messages
Redis Services
Redis Services
- RedisService: General-purpose Redis operations
- InterviewSessionCache: Session caching for interview module
Modules Layer
Each business module follows the layered architecture pattern:- Resume Module
- Interview Module
- Knowledge Base Module
Purpose: Resume upload, parsing, AI analysis, and PDF exportKey Components:
ResumeController: REST API endpoints for resume operationsResumeUploadService: Handles file upload and analysis orchestrationResumeParseService: Apache Tika integration for text extractionResumeGradingService: AI-powered resume scoringResumeHistoryService: Query resume list and analysis historyAnalyzeStreamProducer/Consumer: Async resume analysis using Redis Stream
Frontend Structure
The frontend is organized by feature and follows React best practices:Configuration Files
Key Design Patterns
Async Processing with Redis Streams
All long-running AI operations (resume analysis, vectorization, interview evaluation) use Redis Streams for async processing:Layered Service Architecture
Each module separates concerns into specialized services:- Controller: HTTP request handling, validation, response formatting
- Service: Business logic orchestration
- Repository: Database operations (Spring Data JPA)
- Mapper: Entity ↔ DTO conversions (MapStruct)
Result Wrapper Pattern
All API responses follow a consistent format:Related Pages
Code Style Guide
Learn about coding conventions and best practices
Building the Project
Build and run commands for backend and frontend
Tech Stack
Detailed overview of technologies used
Backend Services
Deep dive into backend service implementations
