# sergeb250/blogplatform-iv architecture

> Architecture diagram of the GitHub repository sergeb250/blogplatform-iv, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sergeb250/blogplatform-iv
- Repository: https://github.com/sergeb250/blogplatform-iv

## Overview

This is a Spring MVC blogging REST API. Its main workflow is request authentication/authorization, controller dispatch, service-level domain operations, and JPA persistence before a standardized JSON response. The README also documents OAuth login, content moderation, comments, reviews, tags, statistics, audit/security reporting, caching, and administrative session controls. Controller excerpts and the source index establish some links; other documented branches are retained with explicitly unverified dashed links where implementation wiring was not sampled.

Main entry points: [`src/main/java/com/blogPlatform/III/blog/service/AuthService.java`](https://github.com/sergeb250/blogplatform-iv/blob/blogPlatform-IV/src/main/java/com/blogPlatform/III/blog/service/AuthService.java) (Authentication), [`src/main/java/com/blogPlatform/III/blog/service/UserService.java`](https://github.com/sergeb250/blogplatform-iv/blob/blogPlatform-IV/src/main/java/com/blogPlatform/III/blog/service/UserService.java) (User Accounts), [`src/main/java/com/blogPlatform/III/blog/controller`](https://github.com/sergeb250/blogplatform-iv/tree/blogPlatform-IV/src/main/java/com/blogPlatform/III/blog/controller) (Domain Endpoints), [`src/main/java/com/blogPlatform/III/blog/service/PostService.java`](https://github.com/sergeb250/blogplatform-iv/blob/blogPlatform-IV/src/main/java/com/blogPlatform/III/blog/service/PostService.java) (Post Management)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["REST API"]
  node_authctrl["Auth Endpoints"]
  node_postctrl["Post Endpoints"]
  node_otherctrl["Domain Endpoints"]
  node_responses["API Responses<br/>[ApiResponse.java]"]
end

subgraph group_content["Blog Content"]
  node_postservice["Post Management<br/>[PostService.java]"]
  node_comments["Comments"]
  node_reviews["Reviews<br/>[ReviewService.java]"]
  node_tags["Tag Management<br/>[TagService.java]"]
  node_moderation["Content Moderation"]
  node_postsrepo["Post Queries"]
  node_reviewrepo["Review Queries"]
end

subgraph group_identity["Identity Security"]
  node_authservice["Authentication<br/>[AuthService.java]"]
  node_userservice["User Accounts<br/>[UserService.java]"]
  node_jwt["JWT Service<br/>[JwtService.java]"]
  node_authuser["Security Principal<br/>[AuthUser.java]"]
  node_userdetails["User Details"]
  node_sessions["Session Registry"]
  node_attempts["Login Protection"]
  node_securityconfig["Security Pipeline"]
  node_oauth["Google Login"]
  node_usersrepo["User Queries"]
end

subgraph group_ops["Operations"]
  node_securitymon["Security Monitor"]
  node_stats["Platform Statistics<br/>[StatsService.java]"]
  node_audit["Audit Logging<br/>[AuditService.java]"]
  node_adminctrl["Admin Reports"]
  node_monitorctrl["Monitoring Endpoints"]
  node_cache[("Caffeine Cache<br/>[CacheConfig.java]")]
end

node_client(("API Client"))
node_db[("MySQL Data")]
node_google(("Google OAuth"))

node_client -->|"calls"| node_authctrl
node_client -->|"calls"| node_postctrl
node_client -.->|"calls"| node_otherctrl
node_authctrl -.->|"delegates to"| node_authservice
node_postctrl -->|"delegates to"| node_postservice
node_postctrl -->|"returns"| node_responses
node_authctrl -.->|"returns"| node_responses
node_otherctrl -.->|"delegates to"| node_comments
node_otherctrl -->|"delegates to"| node_reviews
node_otherctrl -.->|"delegates to"| node_tags
node_otherctrl -.->|"delegates to"| node_userservice
node_authservice -->|"issues token"| node_jwt
node_authservice -->|"checks attempts"| node_attempts
node_authservice -->|"registers session"| node_sessions
node_authservice -->|"records events"| node_securitymon
node_authservice -->|"uses principal"| node_authuser
node_userservice -->|"reads and writes"| node_usersrepo
node_userservice -->|"revokes tokens"| node_sessions
node_userservice -->|"records revocation"| node_securitymon
node_userservice -->|"creates principal"| node_authuser
node_userdetails -->|"loads account"| node_usersrepo
node_userdetails -->|"builds principal"| node_authuser
node_securityconfig -.->|"configures filter"| node_jwt
node_securityconfig -.->|"enables login"| node_oauth
node_google -.->|"authenticates"| node_oauth
node_oauth -->|"finds or creates"| node_userservice
node_oauth -.->|"issues JWT"| node_authservice
node_postservice -->|"queries posts"| node_postsrepo
node_postservice -->|"checks content"| node_moderation
node_postservice -->|"uses tags"| node_tags
node_postservice -->|"records changes"| node_audit
node_postsrepo -.->|"queries"| node_db
node_usersrepo -.->|"queries"| node_db
node_reviewrepo -.->|"queries"| node_db
node_reviews -->|"reads and writes"| node_reviewrepo
node_reviews -->|"checks post"| node_postsrepo
node_reviews -->|"checks user"| node_usersrepo
node_reviews -->|"evicts rankings"| node_cache
node_comments -.->|"persists comments"| node_db
node_tags -.->|"persists tags"| node_db
node_stats -.->|"aggregates content"| node_postsrepo
node_audit -.->|"stores audit"| node_db
node_adminctrl -.->|"reports events"| node_securitymon
node_monitorctrl -.->|"requests metrics"| node_stats

click node_authctrl "https://github.com/sergeb250/blogplatform-iv/blob/blogPlatform-IV/src/main/java/com/blogPlatform/III/blog/controller/AuthController.java"
click node_postctrl "https://github.com/sergeb250/blogplatform-iv/blob/blogPlatform-IV/src/main/java/com/blogPlatform/III/blog/controller/PostController.java"
click node_otherctrl "https://github.com/sergeb250/blogplatform-iv/tree/blogPlatform-IV/src/main/java/com/blogPlatform/III/blog/controller"
click node_responses "https://github.com/sergeb250/blogplatform-iv/blob/blogPlatform-IV/src/main/java/com/blogPlatform/III/blog/dto/response/ApiResponse.java"
click node_authservice "https://github.com/sergeb250/blogplatform-iv/blob/blogPlatform-IV/src/main/java/com/blogPlatform/III/blog/service/AuthService.java"
click node_userservice "https://github.com/sergeb250/blogplatform-iv/blob/blogPlatform-IV/src/main/java/com/blogPlatform/III/blog/service/UserService.java"
click node_jwt "https://github.com/sergeb250/blogplatform-iv/blob/blogPlatform-IV/src/main/java/com/blogPlatform/III/blog/security/jwt/JwtService.java"
click node_authuser "https://github.com/sergeb250/blogplatform-iv/blob/blogPlatform-IV/src/main/java/com/blogPlatform/III/blog/security/AuthUser.java"
click node_userdetails "https://github.com/sergeb250/blogplatform-iv/blob/blogPlatform-IV/src/main/java/com/blogPlatform/III/blog/security/AppUserDetailsService.java"
click node_sessions "https://github.com/sergeb250/blogplatform-iv/blob/blogPlatform-IV/src/main/java/com/blogPlatform/III/blog/security/token/ActiveSessionRegistry.java"
click node_attempts "https://github.com/sergeb250/blogplatform-iv/blob/blogPlatform-IV/src/main/java/com/blogPlatform/III/blog/security/monitor/LoginAttemptService.java"
click node_securitymon "https://github.com/sergeb250/blogplatform-iv/blob/blogPlatform-IV/src/main/java/com/blogPlatform/III/blog/security/monitor/SecurityMonitor.java"
click node_securityconfig "https://github.com/sergeb250/blogplatform-iv/blob/blogPlatform-IV/src/main/java/com/blogPlatform/III/blog/security/SecurityConfig.java"
click node_oauth "https://github.com/sergeb250/blogplatform-iv/blob/blogPlatform-IV/src/main/java/com/blogPlatform/III/blog/security/oauth2/GoogleLoginHandler.java"
click node_postservice "https://github.com/sergeb250/blogplatform-iv/blob/blogPlatform-IV/src/main/java/com/blogPlatform/III/blog/service/PostService.java"
click node_comments "https://github.com/sergeb250/blogplatform-iv/blob/blogPlatform-IV/src/main/java/com/blogPlatform/III/blog/service/CommentService.java"
click node_reviews "https://github.com/sergeb250/blogplatform-iv/blob/blogPlatform-IV/src/main/java/com/blogPlatform/III/blog/service/ReviewService.java"
click node_tags "https://github.com/sergeb250/blogplatform-iv/blob/blogPlatform-IV/src/main/java/com/blogPlatform/III/blog/service/TagService.java"
click node_moderation "https://github.com/sergeb250/blogplatform-iv/blob/blogPlatform-IV/src/main/java/com/blogPlatform/III/blog/service/ContentModerator.java"
click node_stats "https://github.com/sergeb250/blogplatform-iv/blob/blogPlatform-IV/src/main/java/com/blogPlatform/III/blog/service/StatsService.java"
click node_audit "https://github.com/sergeb250/blogplatform-iv/blob/blogPlatform-IV/src/main/java/com/blogPlatform/III/blog/service/AuditService.java"
click node_adminctrl "https://github.com/sergeb250/blogplatform-iv/blob/blogPlatform-IV/src/main/java/com/blogPlatform/III/blog/controller/AdminSecurityController.java"
click node_monitorctrl "https://github.com/sergeb250/blogplatform-iv/blob/blogPlatform-IV/src/main/java/com/blogPlatform/III/blog/controller/StatsController.java"
click node_postsrepo "https://github.com/sergeb250/blogplatform-iv/blob/blogPlatform-IV/src/main/java/com/blogPlatform/III/blog/repository/PostRepository.java"
click node_usersrepo "https://github.com/sergeb250/blogplatform-iv/blob/blogPlatform-IV/src/main/java/com/blogPlatform/III/blog/repository/UserRepository.java"
click node_reviewrepo "https://github.com/sergeb250/blogplatform-iv/blob/blogPlatform-IV/src/main/java/com/blogPlatform/III/blog/repository/ReviewRepository.java"
click node_cache "https://github.com/sergeb250/blogplatform-iv/blob/blogPlatform-IV/src/main/java/com/blogPlatform/III/blog/config/CacheConfig.java"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_authctrl,node_postctrl,node_otherctrl,node_responses,node_client toneBlue
class node_postservice,node_comments,node_reviews,node_tags,node_moderation,node_postsrepo,node_reviewrepo,node_db toneAmber
class node_authservice,node_userservice,node_jwt,node_authuser,node_userdetails,node_sessions,node_attempts,node_securityconfig,node_oauth,node_usersrepo toneMint
class node_securitymon,node_stats,node_audit,node_adminctrl,node_monitorctrl,node_cache toneRose
class node_google toneIndigo
```

## Components

### REST API

- [Auth Endpoints](https://github.com/sergeb250/blogplatform-iv/blob/blogPlatform-IV/src/main/java/com/blogPlatform/III/blog/controller/AuthController.java): `src/main/java/com/blogPlatform/III/blog/controller/AuthController.java`
- [Post Endpoints](https://github.com/sergeb250/blogplatform-iv/blob/blogPlatform-IV/src/main/java/com/blogPlatform/III/blog/controller/PostController.java): `src/main/java/com/blogPlatform/III/blog/controller/PostController.java`
- [Domain Endpoints](https://github.com/sergeb250/blogplatform-iv/tree/blogPlatform-IV/src/main/java/com/blogPlatform/III/blog/controller): `src/main/java/com/blogPlatform/III/blog/controller`
- [API Responses](https://github.com/sergeb250/blogplatform-iv/blob/blogPlatform-IV/src/main/java/com/blogPlatform/III/blog/dto/response/ApiResponse.java): `src/main/java/com/blogPlatform/III/blog/dto/response/ApiResponse.java`

### Blog Content

- [Post Management](https://github.com/sergeb250/blogplatform-iv/blob/blogPlatform-IV/src/main/java/com/blogPlatform/III/blog/service/PostService.java): `src/main/java/com/blogPlatform/III/blog/service/PostService.java`
- [Comments](https://github.com/sergeb250/blogplatform-iv/blob/blogPlatform-IV/src/main/java/com/blogPlatform/III/blog/service/CommentService.java): `src/main/java/com/blogPlatform/III/blog/service/CommentService.java`
- [Reviews](https://github.com/sergeb250/blogplatform-iv/blob/blogPlatform-IV/src/main/java/com/blogPlatform/III/blog/service/ReviewService.java): `src/main/java/com/blogPlatform/III/blog/service/ReviewService.java`
- [Tag Management](https://github.com/sergeb250/blogplatform-iv/blob/blogPlatform-IV/src/main/java/com/blogPlatform/III/blog/service/TagService.java): `src/main/java/com/blogPlatform/III/blog/service/TagService.java`
- [Content Moderation](https://github.com/sergeb250/blogplatform-iv/blob/blogPlatform-IV/src/main/java/com/blogPlatform/III/blog/service/ContentModerator.java): `src/main/java/com/blogPlatform/III/blog/service/ContentModerator.java`
- [Post Queries](https://github.com/sergeb250/blogplatform-iv/blob/blogPlatform-IV/src/main/java/com/blogPlatform/III/blog/repository/PostRepository.java): `src/main/java/com/blogPlatform/III/blog/repository/PostRepository.java`
- [Review Queries](https://github.com/sergeb250/blogplatform-iv/blob/blogPlatform-IV/src/main/java/com/blogPlatform/III/blog/repository/ReviewRepository.java): `src/main/java/com/blogPlatform/III/blog/repository/ReviewRepository.java`

### Identity Security

- [Authentication](https://github.com/sergeb250/blogplatform-iv/blob/blogPlatform-IV/src/main/java/com/blogPlatform/III/blog/service/AuthService.java): `src/main/java/com/blogPlatform/III/blog/service/AuthService.java`
- [User Accounts](https://github.com/sergeb250/blogplatform-iv/blob/blogPlatform-IV/src/main/java/com/blogPlatform/III/blog/service/UserService.java): `src/main/java/com/blogPlatform/III/blog/service/UserService.java`
- [JWT Service](https://github.com/sergeb250/blogplatform-iv/blob/blogPlatform-IV/src/main/java/com/blogPlatform/III/blog/security/jwt/JwtService.java): `src/main/java/com/blogPlatform/III/blog/security/jwt/JwtService.java`
- [Security Principal](https://github.com/sergeb250/blogplatform-iv/blob/blogPlatform-IV/src/main/java/com/blogPlatform/III/blog/security/AuthUser.java): `src/main/java/com/blogPlatform/III/blog/security/AuthUser.java`
- [User Details](https://github.com/sergeb250/blogplatform-iv/blob/blogPlatform-IV/src/main/java/com/blogPlatform/III/blog/security/AppUserDetailsService.java): `src/main/java/com/blogPlatform/III/blog/security/AppUserDetailsService.java`
- [Session Registry](https://github.com/sergeb250/blogplatform-iv/blob/blogPlatform-IV/src/main/java/com/blogPlatform/III/blog/security/token/ActiveSessionRegistry.java): `src/main/java/com/blogPlatform/III/blog/security/token/ActiveSessionRegistry.java`
- [Login Protection](https://github.com/sergeb250/blogplatform-iv/blob/blogPlatform-IV/src/main/java/com/blogPlatform/III/blog/security/monitor/LoginAttemptService.java): `src/main/java/com/blogPlatform/III/blog/security/monitor/LoginAttemptService.java`
- [Security Pipeline](https://github.com/sergeb250/blogplatform-iv/blob/blogPlatform-IV/src/main/java/com/blogPlatform/III/blog/security/SecurityConfig.java): `src/main/java/com/blogPlatform/III/blog/security/SecurityConfig.java`
- [Google Login](https://github.com/sergeb250/blogplatform-iv/blob/blogPlatform-IV/src/main/java/com/blogPlatform/III/blog/security/oauth2/GoogleLoginHandler.java): `src/main/java/com/blogPlatform/III/blog/security/oauth2/GoogleLoginHandler.java`
- [User Queries](https://github.com/sergeb250/blogplatform-iv/blob/blogPlatform-IV/src/main/java/com/blogPlatform/III/blog/repository/UserRepository.java): `src/main/java/com/blogPlatform/III/blog/repository/UserRepository.java`

### Operations

- [Security Monitor](https://github.com/sergeb250/blogplatform-iv/blob/blogPlatform-IV/src/main/java/com/blogPlatform/III/blog/security/monitor/SecurityMonitor.java): `src/main/java/com/blogPlatform/III/blog/security/monitor/SecurityMonitor.java`
- [Platform Statistics](https://github.com/sergeb250/blogplatform-iv/blob/blogPlatform-IV/src/main/java/com/blogPlatform/III/blog/service/StatsService.java): `src/main/java/com/blogPlatform/III/blog/service/StatsService.java`
- [Audit Logging](https://github.com/sergeb250/blogplatform-iv/blob/blogPlatform-IV/src/main/java/com/blogPlatform/III/blog/service/AuditService.java): `src/main/java/com/blogPlatform/III/blog/service/AuditService.java`
- [Admin Reports](https://github.com/sergeb250/blogplatform-iv/blob/blogPlatform-IV/src/main/java/com/blogPlatform/III/blog/controller/AdminSecurityController.java): `src/main/java/com/blogPlatform/III/blog/controller/AdminSecurityController.java`
- [Monitoring Endpoints](https://github.com/sergeb250/blogplatform-iv/blob/blogPlatform-IV/src/main/java/com/blogPlatform/III/blog/controller/StatsController.java): `src/main/java/com/blogPlatform/III/blog/controller/StatsController.java`
- [Caffeine Cache](https://github.com/sergeb250/blogplatform-iv/blob/blogPlatform-IV/src/main/java/com/blogPlatform/III/blog/config/CacheConfig.java): `src/main/java/com/blogPlatform/III/blog/config/CacheConfig.java`

### Other components

- **API Client**
- **MySQL Data**
- **Google OAuth**

## Connections

- API Client → Auth Endpoints: calls (evidence: `README.md`)
- API Client → Post Endpoints: calls (evidence: `src/main/java/com/blogPlatform/III/blog/controller/PostController.java`)
- API Client → Domain Endpoints: calls
- Auth Endpoints → Authentication: delegates to
- Post Endpoints → Post Management: delegates to (evidence: `src/main/java/com/blogPlatform/III/blog/controller/PostController.java`)
- Post Endpoints → API Responses: returns (evidence: `src/main/java/com/blogPlatform/III/blog/controller/PostController.java`)
- Auth Endpoints → API Responses: returns
- Domain Endpoints → Comments: delegates to (evidence: `src/main/java/com/blogPlatform/III/blog/controller/CommentController.java`)
- Domain Endpoints → Reviews: delegates to (evidence: `src/main/java/com/blogPlatform/III/blog/controller/ReviewController.java`)
- Domain Endpoints → Tag Management: delegates to (evidence: `src/main/java/com/blogPlatform/III/blog/controller/TagController.java`)
- Domain Endpoints → User Accounts: delegates to (evidence: `src/main/java/com/blogPlatform/III/blog/controller/UserController.java`)
- Authentication → JWT Service: issues token (evidence: `src/main/java/com/blogPlatform/III/blog/service/AuthService.java`)
- Authentication → Login Protection: checks attempts (evidence: `src/main/java/com/blogPlatform/III/blog/service/AuthService.java`)
- Authentication → Session Registry: registers session (evidence: `src/main/java/com/blogPlatform/III/blog/service/AuthService.java`)
- Authentication → Security Monitor: records events (evidence: `src/main/java/com/blogPlatform/III/blog/service/AuthService.java`)
- Authentication → Security Principal: uses principal (evidence: `src/main/java/com/blogPlatform/III/blog/service/AuthService.java`)
- User Accounts → User Queries: reads and writes (evidence: `src/main/java/com/blogPlatform/III/blog/service/UserService.java`)
- User Accounts → Session Registry: revokes tokens (evidence: `src/main/java/com/blogPlatform/III/blog/service/UserService.java`)
- User Accounts → Security Monitor: records revocation (evidence: `src/main/java/com/blogPlatform/III/blog/service/UserService.java`)
- User Accounts → Security Principal: creates principal (evidence: `src/main/java/com/blogPlatform/III/blog/service/UserService.java`)
- User Details → User Queries: loads account (evidence: `src/main/java/com/blogPlatform/III/blog/security/AppUserDetailsService.java`)
- User Details → Security Principal: builds principal (evidence: `src/main/java/com/blogPlatform/III/blog/security/AppUserDetailsService.java`)
- Security Pipeline → JWT Service: configures filter
- Security Pipeline → Google Login: enables login
- Google OAuth → Google Login: authenticates (evidence: `README.md`)
- Google Login → User Accounts: finds or creates (evidence: `src/main/java/com/blogPlatform/III/blog/service/UserService.java`)
- Google Login → Authentication: issues JWT (evidence: `README.md`)
- Post Management → Post Queries: queries posts (evidence: `src/main/java/com/blogPlatform/III/blog/service/PostService.java`)
- Post Management → Content Moderation: checks content (evidence: `src/main/java/com/blogPlatform/III/blog/service/PostService.java`)
- Post Management → Tag Management: uses tags (evidence: `src/main/java/com/blogPlatform/III/blog/service/PostService.java`)
- Post Management → Audit Logging: records changes (evidence: `src/main/java/com/blogPlatform/III/blog/service/PostService.java`)
- Post Queries → MySQL Data: queries (evidence: `README.md`)
- User Queries → MySQL Data: queries (evidence: `README.md`)
- Review Queries → MySQL Data: queries (evidence: `README.md`)
- Reviews → Review Queries: reads and writes (evidence: `src/main/java/com/blogPlatform/III/blog/service/ReviewService.java`)
- Reviews → Post Queries: checks post (evidence: `src/main/java/com/blogPlatform/III/blog/service/ReviewService.java`)
- Reviews → User Queries: checks user (evidence: `src/main/java/com/blogPlatform/III/blog/service/ReviewService.java`)
- Reviews → Caffeine Cache: evicts rankings (evidence: `src/main/java/com/blogPlatform/III/blog/service/ReviewService.java`)
- Comments → MySQL Data: persists comments (evidence: `README.md`)
- Tag Management → MySQL Data: persists tags (evidence: `README.md`)
- Platform Statistics → Post Queries: aggregates content
- Audit Logging → MySQL Data: stores audit (evidence: `README.md`)
- Admin Reports → Security Monitor: reports events (evidence: `README.md`)
- Monitoring Endpoints → Platform Statistics: requests metrics
