# chikashishirozu/springboot-gradle-new_blog architecture

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

- Interactive diagram: https://gitdiagram.com/chikashishirozu/springboot-gradle-new_blog
- Repository: https://github.com/chikashishirozu/springboot-gradle-new_blog

## Overview

##### Project type and purpose
- This is a monolithic, full-stack web application built on Spring Boot.
- Its purpose is to provide a simple “new blog” platform with user registration, authentication, role-based access, CRUD operations on blog posts, and an administrative dashboard.

##### File structure
- Top-level build files (build.gradle, settings.gradle, Gradle wrapper) confirm a Gradle-based build system.
- The src/main/java/com/example/new_blog package follows the standard Spring Boot layout:
- NewBlogApplication.java – entry point annotated with @SpringBootApplication
- config/SecurityConfig.java – Spring Security setup
- controller/… – REST or MVC controllers (HomeController, BlogController)
- service/BlogService.java – business logic
- repository/BlogRepository.java – Spring Data JPA interface
- model/Blog.java – JPA Entity
- src/main/resources contains:
- application.properties – Spring Boot configuration
- db/migration/V*.sql – Flyway or Liquibase migration scripts for schema + sample data
- static/ and templates/ – front-end assets and Thymeleaf HTML templates
- External jars (H2, MySQL connector, jBCrypt) and SQL scripts at the root support local development and encryption.
- src/test replicates the above structure for unit and integration tests.

##### README
- Minimal instructions, only how to compile with Gradle.

##### Elements
- From Browser to Controller (HTTP requests/responses)
- Controller → Service → Repository → Database (data flow)

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "Client Layer"
        Browser["Web Browser"]:::client
    end

    subgraph "Backend Application"
        subgraph "Initialization"
            NewBlogApplication["NewBlogApplication"]:::entry
            Migrations["Flyway Migrations"]:::migration
        end

        subgraph "Security Module"
            SecurityConfig["SecurityConfig"]:::security
        end

        subgraph "Presentation Layer"
            HomeController["HomeController"]:::controller
            BlogController["BlogController"]:::controller
            subgraph "Thymeleaf Templates & Static Assets"
                Templates["Thymeleaf Templates"]:::template
                StaticAssets["Static Assets"]:::static
            end
        end

        subgraph "Business Logic Layer"
            BlogService["BlogService"]:::service
        end

        subgraph "Data Access Layer"
            BlogRepository["BlogRepository"]:::repository
            BlogEntity["Blog Entity"]:::model
        end
    end

    DB["Database\n(H2 / MySQL)"]:::database

    Browser -->|"HTTP Request"| SecurityConfig
    SecurityConfig -->|"Authenticated Call"| HomeController
    SecurityConfig -->|"Authenticated Call"| BlogController
    HomeController -->|"calls"| BlogService
    BlogController -->|"calls"| BlogService
    BlogService -->|"uses"| BlogRepository
    BlogRepository -->|"CRUD Operations"| DB
    Migrations -->|"applies migrations"| DB
    NewBlogApplication -->|"bootstraps"| Migrations
    NewBlogApplication -->|"bootstraps"| SecurityConfig
    NewBlogApplication -->|"boots controllers"| HomeController
    NewBlogApplication -->|"boots controllers"| BlogController
    NewBlogApplication -->|"boots services"| BlogService
    NewBlogApplication -->|"boots repositories"| BlogRepository
    HomeController -->|"renders"| Templates
    BlogController -->|"renders"| Templates
    Templates -->|"served to"| Browser
    StaticAssets -->|"served to"| Browser

    click NewBlogApplication "https://github.com/chikashishirozu/springboot-gradle-new_blog/blob/main/src/main/java/com/example/new_blog/NewBlogApplication.java"
    click SecurityConfig "https://github.com/chikashishirozu/springboot-gradle-new_blog/blob/main/src/main/java/com/example/new_blog/config/SecurityConfig.java"
    click HomeController "https://github.com/chikashishirozu/springboot-gradle-new_blog/blob/main/src/main/java/com/example/new_blog/controller/HomeController.java"
    click BlogController "https://github.com/chikashishirozu/springboot-gradle-new_blog/blob/main/src/main/java/com/example/new_blog/controller/BlogController.java"
    click BlogService "https://github.com/chikashishirozu/springboot-gradle-new_blog/blob/main/src/main/java/com/example/new_blog/service/BlogService.java"
    click BlogRepository "https://github.com/chikashishirozu/springboot-gradle-new_blog/blob/main/src/main/java/com/example/new_blog/repository/BlogRepository.java"
    click BlogEntity "https://github.com/chikashishirozu/springboot-gradle-new_blog/blob/main/src/main/java/com/example/new_blog/model/Blog.java"
    click Migrations "https://github.com/chikashishirozu/springboot-gradle-new_blog/tree/main/src/main/resources/db/migration"
    click Templates "https://github.com/chikashishirozu/springboot-gradle-new_blog/tree/main/src/main/resources/templates"
    click StaticAssets "https://github.com/chikashishirozu/springboot-gradle-new_blog/tree/main/src/main/resources/static/"

    classDef client fill:#E8F1FF,stroke:#0366D6
    classDef entry fill:#DDEBDC,stroke:#1E6441
    classDef security fill:#FFF5CC,stroke:#BF8B00
    classDef controller fill:#D6E8FC,stroke:#1C7ED6
    classDef template fill:#E6FFFA,stroke:#1CA678
    classDef static fill:#FFF0F3,stroke:#D6336C
    classDef service fill:#FFF4E6,stroke:#F76707
    classDef repository fill:#E8F5E9,stroke:#2E7D32
    classDef model fill:#EDE7F6,stroke:#5E35B1
    classDef database fill:#E8EAF6,stroke:#3949AB
    classDef migration fill:#FFF3E0,stroke:#EF6C00
```
