How plmlkff/vk-for-business-back works
Project type and purpose
• This is a monolithic Spring Boot backend service (no frontend code), modeled after the “VK for Business” logic as a training application.
• It exposes REST APIs for user management, goals, groups, subscriptions, promotions, transactions, file uploads, and integrates with object storage and a payment gateway.
File structure
• Top‐level build and deployment: Dockerfile, docker-compose.yaml, Gradle scripts.
• src/main/java/ru/itmo/blpslab1/ – Java/Kotlin code organized in:
– config: JWT, security, OpenAPI, Minio beans
– core: event definitions & handlers, Minio file manager
– domain: JPA entities, enums, Spring Data repositories & specifications
– rest: Controllers + DTO request/response trees + global error advice
– security: JwtFilter, JwtUserDetails
– service: service interfaces, impls, interceptors, Minio and payment-gateway services
– utils: JWT utilities, hashing, extension functions, etc.
• src/main/resources: application.yaml, Liquibase changelog scripts for DB schema evolution.
• Tests: a basic SpringBootTest.
README
• Confirms it’s a pedagogical clone of a business-oriented social-media API.
a. Main components
– External Clients: Web or mobile apps (or API consumers)
– API Layer: Spring MVC Controllers behind JwtFilter/SecurityConfig
– Service Layer: business logic services (AuthUserService, GoalService, etc.) + interceptors
– Domain Layer: JPA repositories managing entities in RDBMS
– Event Subsystem: TransactionEvent producer/handler for async processing
– Object Storage: Minio (UserImageService → MinioFilesManager)
– External Payment Gateway: PaymentGatewayService
– Configuration: beans defined in Config packages (JwtProperties, MinioConfig, OpenAPIConfig)
– Persistence: relational database (Liquibase → schema)
b. Relationships & data flows
1. Client → HTTP(S) → JwtFilter → Controllers
2. Controller → DTO mapping → Service layer
3. Service → Repository → Database
4. Service → Domain events → Event handler
5. Service → Minio SDK → Minio server
6. Service → REST/SDK → Payment gateway
7. Config classes inject external endpoints, credentials
c. Architectural patterns & principles
– Layered (Controller → Service → Repository)
– DTOs for request/response separation
– Spring Security + JWT filter chain
– Event-driven subcomponent for transaction processing
– Externalized configuration + DI
– Liquibase for schema migrations
d. Key technologies/frameworks
– Spring Boot, Spring MVC, Spring Security, Spring Data JPA
– JWT (io.jsonwebtoken or custom JwtUtil)
– Liquibase for DB changelogs
– Minio Java/Kotlin SDK
– Gradle Kotlin DSL, Docker/Docker-Compose