# subhojitguin/blog_management_system architecture

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

- Interactive diagram: https://gitdiagram.com/subhojitguin/blog_management_system
- Repository: https://github.com/subhojitguin/blog_management_system

## Overview

1. **What this repo is**
   - A single Spring Boot backend monolith for a blog management system.
   - It exposes REST APIs for authentication, users, categories, posts, admin actions, and social interactions like likes, comments, follows, and bookmarks.

2. **Primary request flow**
   - Incoming HTTP requests hit Spring MVC controllers in `Controllers`.
   - Controllers delegate to services in `Service`.
   - Services enforce business rules, call repositories, publish domain events, and return DTOs.
   - Repositories in `Repositories` persist JPA entities in `Entities` to a relational database.

3. **Domain boundaries**
   - The code is organized around business areas rather than technical layers:
     - `AuthController` / `Security` for login, signup, token refresh
     - `UserController` / `UserServiceImpl` for profile, password, email, follow graph
     - `CategoryController` / `CategoryServiceImpl`
     - `PostController` / `PostServiceImpl` for CRUD, search, comments, likes, bookmarks, and feed views
     - `AdminController` for category administration
   - These boundaries are important for diagramming because most features are coordinated through the service layer, not directly between controllers.

4. **Persistence model**
   - The persistence layer is JPA-based and backed by Flyway migrations in `src/main/resources/db/migration`.
   - Core tables/entities are users, categories, posts, follows, likes, comments, and bookmarks.
   - `Specification` support is used for post filtering/search, so query logic is partly dynamic rather than simple CRUD.

5. **Security architecture**
   - Authentication is JWT-based.
   - `JWTAuthFilter` intercepts requests before controller execution, `JWTService` handles token creation/validation, and `WebSecurityConfig` defines protected vs public routes.
   - `AuthService` handles signup/login/refresh flows.
   - `SecurityUtils` and `SecurityConfigUtils` likely centralize current-user and authorization helpers.
   - This is a key boundary: authenticated user context is established before business services run.

6. **API response and exception handling**
   - `Advice/GlobalExceptionHandler` maps domain exceptions like `ResourceNotFoundException`, `ResourceConflictException`, and `InvalidActionException` into API errors.
   - `GlobalResponseHandler`, `ApiResponse`, and `ApiError` standardize response shape.
   - This means the controller layer is thin and the API contract is normalized centrally.

7. **Async and event-driven side effects**
   - The app uses Spring application events for actions such as new posts, comments, likes, and new followers.
   - `Listeners/EmailEventListeners` consumes those events and delegates to email services.
   - Template models and Freemarker templates in `templates/` are used to render notification emails.
   - This separates core transactional actions from non-critical side effects like email delivery.

8. **Schedulers and background processing**
   - `Schedulers/PostPublishScheduler` handles scheduled post publication, so posts can be staged and released later.
   - `Schedulers/ViewSyncScheduler` suggests periodic synchronization of view counts, likely between in-memory/Redis counters and the database.
   - `Schedulers/UserBatchScheduler` indicates batch-oriented user maintenance or reporting.
   - These are background subsystems independent of the synchronous API request path.

9. **Caching / fast counters**
   - `Service/RedisViewCountServiceImpl` and `Constants/RedisConstants` show Redis-backed view counting or read optimization.
   - `Annotations/ReadFast` suggests a read-optimized path, probably for high-frequency post views.
   - In the architecture diagram, Redis should be shown as a side store used for performance-sensitive counters rather than the system of record.

10. **Cross-cutting concerns**
    - `Logging/RequestLoggingFilter` captures request-level logs, while `LoggingAspect` adds execution logging around annotated methods such as `@LogExecution`.
    - `Deserializers/*SanitizationDeserializer` sanitize HTML/text input at the JSON boundary.
    - `Config/MapperConfig`, `AsyncConfig`, `MessageSourceConfig`, and `SwaggerConfig` provide infrastructure wiring for mapping, async execution, localization/messages, and API documentation.

11. **Data shaping and transport**
    - Controllers and services exchange DTOs from `Dto/`, not entities directly.
    - This protects the persistence model from leaking into the API contract.
    - The `Utils` package holds reusable helpers for validation, reading-time calculation, and message handling.
    - `Constants/ApiRoutes` centralizes endpoint paths, which helps keep route definitions consistent across controllers.

12. **Infrastructure and deployment**
    - The repository is container-ready with `Dockerfile` and `docker-compose.yml`.
    - `elk-config` contains Filebeat and Logstash configuration, implying logs are intended to flow into an ELK stack for centralized observability.
    - `logback-spring.xml` provides application logging configuration.
    - The presence of Swagger/OpenAPI docs in the README indicates the API is meant to be consumed externally and documented as a first-class interface.

13. **Testing structure**
    - Tests mirror the production layers: controllers, services, repositories, listeners, schedulers, security, and utilities.
    - This suggests the architecture is designed around independently testable components, with business logic concentrated in services and integration points isolated at the boundaries.

14. **How to draw the architecture**
    - A good diagram would show:
      - External clients calling REST controllers
      - A security filter/JWT layer in front of controllers
      - Controllers delegating to service implementations
      - Services coordinating repositories, Redis, events, and schedulers
      - Repositories persisting to a relational database managed by Flyway migrations
      - Event listeners sending email notifications via template rendering
      - Logging, exception handling, sanitization, and async execution as cross-cutting layers around the main flow

Main entry points: [`src/main/java/com/project/Blog_Management_System/Service/PostServiceImpl.java`](https://github.com/subhojitguin/blog_management_system/blob/main/src/main/java/com/project/Blog_Management_System/Service/PostServiceImpl.java) (Post Service), [`src/main/java/com/project/Blog_Management_System/Security/JWTAuthFilter.java`](https://github.com/subhojitguin/blog_management_system/blob/main/src/main/java/com/project/Blog_Management_System/Security/JWTAuthFilter.java) (JWT Filter), [`src/main/java/com/project/Blog_Management_System/Service/UserServiceImpl.java`](https://github.com/subhojitguin/blog_management_system/blob/main/src/main/java/com/project/Blog_Management_System/Service/UserServiceImpl.java) (User Service), [`src/main/resources/db/migration`](https://github.com/subhojitguin/blog_management_system/tree/main/src/main/resources/db/migration) (Relational DB)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API Layer"]
  node_client(("Clients<br/>external consumers"))
  node_security_filter["JWT Filter<br/>security filter<br/>[JWTAuthFilter.java]"]
  node_web_security["Web Security<br/>security config"]
  node_auth_controller["Auth API<br/>rest controller"]
  node_user_controller["User API<br/>rest controller"]
  node_category_controller["Category API<br/>rest controller"]
  node_post_controller["Post API<br/>rest controller"]
  node_admin_controller["Admin API<br/>rest controller"]
end

subgraph group_domain["Domain Services"]
  node_auth_service["Auth Service<br/>security service<br/>[AuthService.java]"]
  node_user_service["User Service<br/>domain service"]
  node_category_service["Category Service<br/>domain service"]
  node_post_service["Post Service<br/>domain service"]
  node_redis_view["View Cache<br/>redis service"]
end

subgraph group_data["Data Layer"]
  node_user_repo[("User Repo<br/>jpa repository")]
  node_category_repo[("Category Repo<br/>jpa repository")]
  node_post_repo[("Post Repo<br/>jpa repository")]
  node_interaction_repos[("Interaction Repos<br/>jpa repositories")]
  node_flyway_db[("Relational DB<br/>sql schema")]
end

subgraph group_infra["Infrastructure"]
  node_events{{"Domain Events<br/>spring events"}}
  node_email_listener["Email Listener<br/>event listener"]
  node_email_services["Email Services"]
  node_scheduler_pub["Publish Scheduler<br/>scheduled job"]
  node_scheduler_sync["View Sync Job<br/>scheduled job"]
  node_scheduler_user["User Batch Job<br/>scheduled job"]
  node_response_advice["Response Advice<br/>api advice"]
  node_exception_advice["Exception Advice<br/>api advice"]
  node_logging{{"Logging<br/>cross-cutting"}}
end

node_client -->|"HTTP request"| node_security_filter
node_security_filter -->|"auth rules"| node_web_security
node_security_filter -->|"public auth"| node_auth_controller
node_security_filter -->|"secured API"| node_user_controller
node_security_filter -->|"secured API"| node_category_controller
node_security_filter -->|"secured API"| node_post_controller
node_security_filter -->|"secured API"| node_admin_controller
node_auth_controller -->|"login/signup"| node_auth_service
node_user_controller -->|"profile ops"| node_user_service
node_category_controller -->|"category ops"| node_category_service
node_admin_controller -->|"admin category"| node_category_service
node_post_controller -->|"post ops"| node_post_service
node_post_service -->|"author/user context"| node_user_service
node_auth_service -->|"account lookup"| node_user_repo
node_user_service -->|"user data"| node_user_repo
node_category_service -->|"category data"| node_category_repo
node_post_service -->|"post data"| node_post_repo
node_post_service -->|"social data"| node_interaction_repos
node_post_service -->|"fast views"| node_redis_view
node_user_service -->|"follow events"| node_events
node_post_service -->|"post events"| node_events
node_events -->|"consume"| node_email_listener
node_email_listener -->|"send mail"| node_email_services
node_email_services -.-> node_response_advice
node_scheduler_pub -->|"publish posts"| node_post_service
node_scheduler_sync -->|"sync counters"| node_redis_view
node_scheduler_user -->|"batch users"| node_user_service
node_post_service -->|"spec queries"| node_post_repo
node_post_repo -->|"persist"| node_flyway_db
node_user_repo -->|"persist"| node_flyway_db
node_category_repo -->|"persist"| node_flyway_db
node_interaction_repos -->|"persist"| node_flyway_db
node_response_advice -->|"API response"| node_client
node_exception_advice -->|"API error"| node_client
node_logging -.->|"trace"| node_client

click node_security_filter "https://github.com/subhojitguin/blog_management_system/blob/main/src/main/java/com/project/Blog_Management_System/Security/JWTAuthFilter.java"
click node_web_security "https://github.com/subhojitguin/blog_management_system/blob/main/src/main/java/com/project/Blog_Management_System/Security/WebSecurityConfig.java"
click node_auth_controller "https://github.com/subhojitguin/blog_management_system/blob/main/src/main/java/com/project/Blog_Management_System/Controllers/AuthController.java"
click node_user_controller "https://github.com/subhojitguin/blog_management_system/blob/main/src/main/java/com/project/Blog_Management_System/Controllers/UserController.java"
click node_category_controller "https://github.com/subhojitguin/blog_management_system/blob/main/src/main/java/com/project/Blog_Management_System/Controllers/CategoryController.java"
click node_post_controller "https://github.com/subhojitguin/blog_management_system/blob/main/src/main/java/com/project/Blog_Management_System/Controllers/PostController.java"
click node_admin_controller "https://github.com/subhojitguin/blog_management_system/blob/main/src/main/java/com/project/Blog_Management_System/Controllers/AdminController.java"
click node_auth_service "https://github.com/subhojitguin/blog_management_system/blob/main/src/main/java/com/project/Blog_Management_System/Security/AuthService.java"
click node_user_service "https://github.com/subhojitguin/blog_management_system/blob/main/src/main/java/com/project/Blog_Management_System/Service/UserServiceImpl.java"
click node_category_service "https://github.com/subhojitguin/blog_management_system/blob/main/src/main/java/com/project/Blog_Management_System/Service/CategoryServiceImpl.java"
click node_post_service "https://github.com/subhojitguin/blog_management_system/blob/main/src/main/java/com/project/Blog_Management_System/Service/PostServiceImpl.java"
click node_redis_view "https://github.com/subhojitguin/blog_management_system/blob/main/src/main/java/com/project/Blog_Management_System/Service/RedisViewCountServiceImpl.java"
click node_user_repo "https://github.com/subhojitguin/blog_management_system/blob/main/src/main/java/com/project/Blog_Management_System/Repositories/UserRepository.java"
click node_category_repo "https://github.com/subhojitguin/blog_management_system/blob/main/src/main/java/com/project/Blog_Management_System/Repositories/CategoryRepository.java"
click node_post_repo "https://github.com/subhojitguin/blog_management_system/blob/main/src/main/java/com/project/Blog_Management_System/Repositories/PostRepository.java"
click node_flyway_db "https://github.com/subhojitguin/blog_management_system/tree/main/src/main/resources/db/migration"
click node_events "https://github.com/subhojitguin/blog_management_system/tree/main/src/main/java/com/project/Blog_Management_System/Events"
click node_email_listener "https://github.com/subhojitguin/blog_management_system/blob/main/src/main/java/com/project/Blog_Management_System/Listeners/EmailEventListeners.java"
click node_email_services "https://github.com/subhojitguin/blog_management_system/blob/main/src/main/java/com/project/Blog_Management_System/Service/EmailServiceImpl.java"
click node_scheduler_pub "https://github.com/subhojitguin/blog_management_system/blob/main/src/main/java/com/project/Blog_Management_System/Schedulers/PostPublishScheduler.java"
click node_scheduler_sync "https://github.com/subhojitguin/blog_management_system/blob/main/src/main/java/com/project/Blog_Management_System/Schedulers/ViewSyncScheduler.java"
click node_scheduler_user "https://github.com/subhojitguin/blog_management_system/blob/main/src/main/java/com/project/Blog_Management_System/Schedulers/UserBatchScheduler.java"
click node_response_advice "https://github.com/subhojitguin/blog_management_system/blob/main/src/main/java/com/project/Blog_Management_System/Advice/GlobalResponseHandler.java"
click node_exception_advice "https://github.com/subhojitguin/blog_management_system/blob/main/src/main/java/com/project/Blog_Management_System/Advice/GlobalExceptionHandler.java"
click node_logging "https://github.com/subhojitguin/blog_management_system/tree/main/src/main/java/com/project/Blog_Management_System/Logging"

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_client,node_security_filter,node_web_security,node_auth_controller,node_user_controller,node_category_controller,node_post_controller,node_admin_controller toneBlue
class node_auth_service,node_user_service,node_category_service,node_post_service,node_redis_view toneAmber
class node_user_repo,node_category_repo,node_post_repo,node_interaction_repos,node_flyway_db toneMint
class node_events,node_email_listener,node_email_services,node_scheduler_pub,node_scheduler_sync,node_scheduler_user,node_response_advice,node_exception_advice,node_logging toneRose
```

## Components

### API Layer

REST entrypoints, request shaping, and security boundaries.

- **Clients**: external consumers · Browsers, API clients, and external integrators calling the REST API.
- [JWT Filter](https://github.com/subhojitguin/blog_management_system/blob/main/src/main/java/com/project/Blog_Management_System/Security/JWTAuthFilter.java): security filter · Intercepts incoming requests, validates JWTs, and establishes authenticated context. · `src/main/java/com/project/Blog_Management_System/Security/JWTAuthFilter.java`
- [Web Security](https://github.com/subhojitguin/blog_management_system/blob/main/src/main/java/com/project/Blog_Management_System/Security/WebSecurityConfig.java): security config · Defines protected routes, auth rules, and filter wiring. · `src/main/java/com/project/Blog_Management_System/Security/WebSecurityConfig.java`
- [Auth API](https://github.com/subhojitguin/blog_management_system/blob/main/src/main/java/com/project/Blog_Management_System/Controllers/AuthController.java): rest controller · Handles signup, login, and token refresh flows. · `src/main/java/com/project/Blog_Management_System/Controllers/AuthController.java`
- [User API](https://github.com/subhojitguin/blog_management_system/blob/main/src/main/java/com/project/Blog_Management_System/Controllers/UserController.java): rest controller · Exposes profile, password, email, and follow operations. · `src/main/java/com/project/Blog_Management_System/Controllers/UserController.java`
- [Category API](https://github.com/subhojitguin/blog_management_system/blob/main/src/main/java/com/project/Blog_Management_System/Controllers/CategoryController.java): rest controller · Handles category retrieval and management endpoints. · `src/main/java/com/project/Blog_Management_System/Controllers/CategoryController.java`
- [Post API](https://github.com/subhojitguin/blog_management_system/blob/main/src/main/java/com/project/Blog_Management_System/Controllers/PostController.java): rest controller · Handles posts, search, comments, likes, bookmarks, and feeds. · `src/main/java/com/project/Blog_Management_System/Controllers/PostController.java`
- [Admin API](https://github.com/subhojitguin/blog_management_system/blob/main/src/main/java/com/project/Blog_Management_System/Controllers/AdminController.java): rest controller · Provides administrative category actions. · `src/main/java/com/project/Blog_Management_System/Controllers/AdminController.java`

### Domain Services

Business logic organized by blog, user, and admin flows.

- [Auth Service](https://github.com/subhojitguin/blog_management_system/blob/main/src/main/java/com/project/Blog_Management_System/Security/AuthService.java): security service · Implements authentication workflows and token lifecycle support. · `src/main/java/com/project/Blog_Management_System/Security/AuthService.java`
- [User Service](https://github.com/subhojitguin/blog_management_system/blob/main/src/main/java/com/project/Blog_Management_System/Service/UserServiceImpl.java): domain service · Coordinates profiles, account updates, and follow graph behavior. · `src/main/java/com/project/Blog_Management_System/Service/UserServiceImpl.java`
- [Category Service](https://github.com/subhojitguin/blog_management_system/blob/main/src/main/java/com/project/Blog_Management_System/Service/CategoryServiceImpl.java): domain service · Implements category business rules and admin-facing operations. · `src/main/java/com/project/Blog_Management_System/Service/CategoryServiceImpl.java`
- [Post Service](https://github.com/subhojitguin/blog_management_system/blob/main/src/main/java/com/project/Blog_Management_System/Service/PostServiceImpl.java): domain service · Coordinates post CRUD, filtering, interaction actions, and feed views. · `src/main/java/com/project/Blog_Management_System/Service/PostServiceImpl.java`
- [View Cache](https://github.com/subhojitguin/blog_management_system/blob/main/src/main/java/com/project/Blog_Management_System/Service/RedisViewCountServiceImpl.java): redis service · Stores or syncs fast-moving view counters using Redis-backed logic. · `src/main/java/com/project/Blog_Management_System/Service/RedisViewCountServiceImpl.java`

### Data Layer

Persistence, dynamic querying, and backing stores.

- [User Repo](https://github.com/subhojitguin/blog_management_system/blob/main/src/main/java/com/project/Blog_Management_System/Repositories/UserRepository.java): jpa repository · Persists user entities and supports account lookups. · `src/main/java/com/project/Blog_Management_System/Repositories/UserRepository.java`
- [Category Repo](https://github.com/subhojitguin/blog_management_system/blob/main/src/main/java/com/project/Blog_Management_System/Repositories/CategoryRepository.java): jpa repository · Persists categories and supports category queries. · `src/main/java/com/project/Blog_Management_System/Repositories/CategoryRepository.java`
- [Post Repo](https://github.com/subhojitguin/blog_management_system/blob/main/src/main/java/com/project/Blog_Management_System/Repositories/PostRepository.java): jpa repository · Persists posts and supports search and feed data access. · `src/main/java/com/project/Blog_Management_System/Repositories/PostRepository.java`
- **Interaction Repos**: jpa repositories · Persistence for follows, likes, comments, and bookmarks.
- [Relational DB](https://github.com/subhojitguin/blog_management_system/tree/main/src/main/resources/db/migration): sql schema · System of record managed by Flyway migrations and JPA entities. · `src/main/resources/db/migration`

### Infrastructure

Events, email, scheduling, logging, and cross-cutting support.

- [Domain Events](https://github.com/subhojitguin/blog_management_system/tree/main/src/main/java/com/project/Blog_Management_System/Events): spring events · Application events for post publication and social interactions. · `src/main/java/com/project/Blog_Management_System/Events`
- [Email Listener](https://github.com/subhojitguin/blog_management_system/blob/main/src/main/java/com/project/Blog_Management_System/Listeners/EmailEventListeners.java): event listener · Consumes events and triggers notification email flows. · `src/main/java/com/project/Blog_Management_System/Listeners/EmailEventListeners.java`
- [Email Services](https://github.com/subhojitguin/blog_management_system/blob/main/src/main/java/com/project/Blog_Management_System/Service/EmailServiceImpl.java): template/email services · Renders templates and sends notification emails. · `src/main/java/com/project/Blog_Management_System/Service/EmailServiceImpl.java`
- [Publish Scheduler](https://github.com/subhojitguin/blog_management_system/blob/main/src/main/java/com/project/Blog_Management_System/Schedulers/PostPublishScheduler.java): scheduled job · Publishes staged posts on a schedule. · `src/main/java/com/project/Blog_Management_System/Schedulers/PostPublishScheduler.java`
- [View Sync Job](https://github.com/subhojitguin/blog_management_system/blob/main/src/main/java/com/project/Blog_Management_System/Schedulers/ViewSyncScheduler.java): scheduled job · Synchronizes view counters and related read metrics. · `src/main/java/com/project/Blog_Management_System/Schedulers/ViewSyncScheduler.java`
- [User Batch Job](https://github.com/subhojitguin/blog_management_system/blob/main/src/main/java/com/project/Blog_Management_System/Schedulers/UserBatchScheduler.java): scheduled job · Runs batch-oriented user maintenance or reporting tasks. · `src/main/java/com/project/Blog_Management_System/Schedulers/UserBatchScheduler.java`
- [Response Advice](https://github.com/subhojitguin/blog_management_system/blob/main/src/main/java/com/project/Blog_Management_System/Advice/GlobalResponseHandler.java): api advice · Normalizes successful API responses into a common wrapper. · `src/main/java/com/project/Blog_Management_System/Advice/GlobalResponseHandler.java`
- [Exception Advice](https://github.com/subhojitguin/blog_management_system/blob/main/src/main/java/com/project/Blog_Management_System/Advice/GlobalExceptionHandler.java): api advice · Maps domain exceptions into standardized API errors. · `src/main/java/com/project/Blog_Management_System/Advice/GlobalExceptionHandler.java`
- [Logging](https://github.com/subhojitguin/blog_management_system/tree/main/src/main/java/com/project/Blog_Management_System/Logging): cross-cutting · Request logging and execution tracing around annotated methods. · `src/main/java/com/project/Blog_Management_System/Logging`

## Connections

- Clients → JWT Filter: HTTP request · Incoming API traffic first passes through authentication filtering.
- JWT Filter → Web Security: auth rules · Security configuration defines how the filter and protected routes behave.
- JWT Filter → Auth API: public auth · Public authentication endpoints are allowed through the security boundary.
- JWT Filter → User API: secured API · Authenticated user requests proceed to user endpoints.
- JWT Filter → Category API: secured API · Authenticated category requests proceed to controller layer.
- JWT Filter → Post API: secured API · Authenticated post requests proceed to controller layer.
- JWT Filter → Admin API: secured API · Admin routes are protected by the security layer.
- Auth API → Auth Service: login/signup · Authentication controller delegates auth flows to the security service.
- User API → User Service: profile ops · User endpoints delegate business logic to the user service.
- Category API → Category Service: category ops · Category endpoints delegate to category service logic.
- Admin API → Category Service: admin category · Admin category actions reuse category service rules.
- Post API → Post Service: post ops · Post endpoints delegate CRUD, social, and feed behavior to the post service.
- Post Service → User Service: author/user context · Post operations depend on user identity and profile data.
- Auth Service → User Repo: account lookup · Auth workflows read and update user records.
- User Service → User Repo: user data · User service persists and reads user entities.
- Category Service → Category Repo: category data · Category service persists and reads category entities.
- Post Service → Post Repo: post data · Post service persists posts and queries feeds/search results.
- Post Service → Interaction Repos: social data · Likes, comments, follows, and bookmarks are managed through interaction repositories.
- Post Service → View Cache: fast views · View-heavy operations use Redis-backed counters or sync paths.
- User Service → Domain Events: follow events · User actions publish follower-related domain events.
- Post Service → Domain Events: post events · Post and social interactions publish domain events.
- Domain Events → Email Listener: consume · Listeners react to published domain events.
- Email Listener → Email Services: send mail · Event handling delegates to email rendering and delivery services.
- Email Services → Response Advice
- Publish Scheduler → Post Service: publish posts · Scheduled publication reuses the post service workflow.
- View Sync Job → View Cache: sync counters · Scheduled jobs reconcile cached views with durable storage.
- User Batch Job → User Service: batch users · Scheduled user maintenance uses user service logic.
- Post Service → Post Repo: spec queries · Dynamic filtering and search rely on specification-based post queries.
- Post Repo → Relational DB: persist · JPA repositories store data in the relational database schema.
- User Repo → Relational DB: persist · User entities are backed by the Flyway-managed database.
- Category Repo → Relational DB: persist · Category entities are backed by the Flyway-managed database.
- Interaction Repos → Relational DB: persist · Social interaction entities are backed by the relational database.
- Response Advice → Clients: API response · Responses are normalized before returning to API consumers.
- Exception Advice → Clients: API error · Exceptions are translated into standardized error payloads.
- Logging → Clients: trace · Request and execution logging cross-cut the external request path.
