How heeyeon205/newsion-server works
Project type and purpose
• This is a full‐stack news summary and community platform (“NEWSION”) with:
• A React+Vite+Tailwind front‐end
• A Spring Boot 3.4 monolithic back‐end in Java 17
• MySQL for primary data, Redis for caching, Elasticsearch for search, AWS S3 for file storage
• External integrations: OAuth2 (Google/Kakao/Naver), PortOne payment gateway, ELK logging stack
File structure
• Top‐level “src/main/java/com/newsvision” is organized by module:
• admin, board (community), category, news (Naver+GPT), poll (voting), notice, user, mypage, elasticsearch
• global cross‐cutting concerns: auth, aws, exception, jwt, payment, redis, security, swagger, utils
• Persistence layer: repositories in each module
• Service layer: business logic grouped per module
• Controller layer: REST API endpoints per module
• Infrastructure: docker/es-kibana for ELK, application.yml configuration
README for additional insights
• Tech stack confirms DB (MySQL), cache (Redis), search (Elasticsearch), infra (Docker, AWS)
• Teams implemented OAuth2, JWT, ELK logging, payment via PortOne
• Client Layer:
• Web Browser (end user / admin interfaces)
• Front‐end Layer:
• React App (deployed on CDN or S3/CloudFront)
• API Gateway / Load Balancer (e.g., AWS ALB / Nginx)
• Back‐end Layer (Spring Boot Monolith):
• Presentation (Controllers)
• Application Services (business logic modules)
• Domain Entities & Repositories (MySQL)
• Cache (Redis)
• Search (Elasticsearch cluster)
• Notification (NoticeService sending in‐app notifications)
• External Services:
• OAuth2 Providers (Google, Kakao, Naver)
• PortOne Payment Gateway
• AWS S3 (file uploads)
• ELK Stack (Logstash, Elasticsearch, Kibana for logs)
• Data Stores:
• MySQL Primary Database
• Redis Cache & Token Blacklist
• Elasticsearch (search indexes for news & board)
b. Relationships & interactions:
• Browser → React App (HTTP/HTTPS)
• React App → API Gateway → Spring Boot Controllers (REST calls)
• Controllers → Service Layer → Repositories (CRUD in MySQL)
• Service Layer ↔ Redis for caching tokens, session info, popular keywords
• Service Layer ↔ Elasticsearch (indexing & search queries)
• Service Layer ↔ AWS S3 (upload/download media)
• Service Layer ↔ OAuth2 providers (token exchange)
• Service Layer ↔ PortOne (payment initialization, refunds)
• Spring Boot logs → Logstash agent → Elasticsearch (logs) → Kibana UI
c. Architectural patterns & design principles:
• Layered (Controller → Service → Repository)
• Package per feature (modular monolith)
• Externalized configuration (application.yml, Docker Compose)
• Dependency inversion via Spring DI
• Separation of cross‐cutting concerns (global/auth, jwt, exception, aws)
d. Key technologies & frameworks:
• Spring Boot + Spring Security + OAuth2 + JWT
• Spring Data JPA (MySQL), Spring Data Redis, Elasticsearch Java Client
• Docker Compose for ELK
• React + Vite + TailwindCSS
• AWS SDK for S3
Diagramming conventions
• Use parallelograms or clouds for external services (OAuth2, S3, Payment Gateway)
• Blue for internal components
• Green for data stores
• Orange for external systems
• Related modules inside a larger “Spring Boot Monolith” boundary
Detailed capture of essential elements
• Layers inside the monolith: Presentation, Business Logic (feature packages), Persistence
• ELK sidecar container connected to the monolith’s log output
• Caching strategy and token blacklist in Redis
• Index pipelines in Elasticsearch for popular keywords, board & news documents